Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr-ressources
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Learning Lab
mooc-rr-ressources
Commits
7fd3cd06
Commit
7fd3cd06
authored
Mar 29, 2019
by
Arnaud Legrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics
parent
5e828909
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
emacs_newbie.org
module2/ressources/emacs_newbie.org
+12
-11
No files found.
module2/ressources/emacs_newbie.org
View file @
7fd3cd06
...
@@ -11,7 +11,7 @@ the screenshots in this demo are done under the Windows operating
...
@@ -11,7 +11,7 @@ the screenshots in this demo are done under the Windows operating
system but similar results should be obtained on any OS.
system but similar results should be obtained on any OS.
* First steps with Emacs as a computationnal environment
* First steps with Emacs as a computationnal environment
**
Run Emacs
**
A first org-mode document
- Launch emacs
- Launch emacs
#+BEGIN_CENTER
#+BEGIN_CENTER
[[file:emacs_orgmode_images/emacs.png]]
[[file:emacs_orgmode_images/emacs.png]]
...
@@ -59,13 +59,13 @@ system but similar results should be obtained on any OS.
...
@@ -59,13 +59,13 @@ system but similar results should be obtained on any OS.
If you do not like this behavior, you can edit the =init.el= file and
If you do not like this behavior, you can edit the =init.el= file and
replace =(org-babel-temp-file \"figure\" \".png\")= by
replace =(org-babel-temp-file \"figure\" \".png\")= by
=\"D:/temp/figure.png\"= or whichever location/name you prefer (both
=\"D:/temp/figure.png\"= or whichever location/name you prefer (both
for =<R=
et
=<PP=).
for =<R=
and
=<PP=).
** Running
p
ython code
** Running
P
ython code
- You may want to read the [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html][Python Source Code Blocks in Org Mode]]
- You may want to read the [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html][Python Source Code Blocks in Org Mode]]
webpage for more examples
webpage for more examples
- The =<p= + =tab= will insert a
p
ython block in a /non-session/ mode. This
- The =<p= + =tab= will insert a
P
ython block in a /non-session/ mode. This
means that a new
p
ython shell will be started for this block and
means that a new
P
ython shell will be started for this block and
that variables will not be shared between blocks. Again, the code
that variables will not be shared between blocks. Again, the code
is executed with the =C-c C-c= shortcut.
is executed with the =C-c C-c= shortcut.
#+BEGIN_CENTER
#+BEGIN_CENTER
...
@@ -80,20 +80,20 @@ system but similar results should be obtained on any OS.
...
@@ -80,20 +80,20 @@ system but similar results should be obtained on any OS.
# [[file:emacs_orgmode_images/python3.png]]
# [[file:emacs_orgmode_images/python3.png]]
# #+END_CENTER
# #+END_CENTER
# Then try to follow the steps in the installation section.
# Then try to follow the steps in the installation section.
- The =<P= + =tab= will insert a
p
ython block in /session/ mode. This
- The =<P= + =tab= will insert a
P
ython block in /session/ mode. This
allows to keep variables alive from a block to an other. Internally,
allows to keep variables alive from a block to an other. Internally,
emacs will have a buffer with a
p
ython session running. Again, the
emacs will have a buffer with a
P
ython session running. Again, the
code is executed with the =C-c C-c= shortcut.
code is executed with the =C-c C-c= shortcut.
#+BEGIN_CENTER
#+BEGIN_CENTER
[[file:emacs_orgmode_images/python2.png]]
[[file:emacs_orgmode_images/python2.png]]
#+END_CENTER
#+END_CENTER
- The =<PP= + =tab= will insert a
p
ython block in /session/ mode and ready
- The =<PP= + =tab= will insert a
P
ython block in /session/ mode and ready
to generate graphics.
to generate graphics.
#+BEGIN_CENTER
#+BEGIN_CENTER
[[file:emacs_orgmode_images/python4.png]]
[[file:emacs_orgmode_images/python4.png]]
#+END_CENTER
#+END_CENTER
If this fails, try to update the
p
ython =numpy= library, for exemple
If this fails, try to update the
P
ython =numpy= library, for exemple
like this in a dos/shell command:
like this in a dos/shell command:
#+begin_src shell :results output :exports both
#+begin_src shell :results output :exports both
python -m pip install -U numpy
python -m pip install -U numpy
...
@@ -119,12 +119,13 @@ system but similar results should be obtained on any OS.
...
@@ -119,12 +119,13 @@ system but similar results should be obtained on any OS.
#+BEGIN_CENTER
#+BEGIN_CENTER
[[file:emacs_orgmode_images/org_mode.png]]
[[file:emacs_orgmode_images/org_mode.png]]
#+END_CENTER
#+END_CENTER
When you are done
s
, simply hit =C-c C-c= to save your modifications
When you are done, simply hit =C-c C-c= to save your modifications
and close the mini-buffer.
and close the mini-buffer.
** Fast editing of an org document
** Fast editing of an org document
- It is common when taking notes in a brainstorming session to have to
- It is common when taking notes in a brainstorming session to have to
clean and reorganize them. The =Alt= + =\leftarrow= or =Alt= +
clean and reorganize them. The =Alt= + =\leftarrow= or =Alt= +
=\rightarrow= will allow you to shift items to the left or to the right.
=\rightarrow= will allow you to shift items to the left or to the
right. Likewise, entries can be moved up or down.
- Org-mode shortcuts are actually much more intuitive than prehistoric
- Org-mode shortcuts are actually much more intuitive than prehistoric
emacs shortcuts. You'll quickly get use to it. Again, have a look to
emacs shortcuts. You'll quickly get use to it. Again, have a look to
the first entry of the =journal.org= file we gave you and which
the first entry of the =journal.org= file we gave you and which
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment