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
61d32194
Commit
61d32194
authored
Jul 24, 2018
by
Arnaud Legrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use python3 by default and fix babel chunks
parent
6c7dc12e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
init.el
module2/ressources/rr_org/init.el
+4
-2
init.org
module2/ressources/rr_org/init.org
+7
-2
No files found.
module2/ressources/rr_org/init.el
View file @
61d32194
...
@@ -155,6 +155,8 @@ Entered on %U
...
@@ -155,6 +155,8 @@ Entered on %U
))
))
(
setq
org-src-preserve-indentation
t
)
(
setq
org-src-preserve-indentation
t
)
(
setq
org-babel-python-command
"python3"
)
(
add-to-list
'org-structure-template-alist
(
add-to-list
'org-structure-template-alist
'
(
"s"
"#+begin_src ?\n\n#+end_src"
"<src lang=\"?\">\n\n</src>"
))
'
(
"s"
"#+begin_src ?\n\n#+end_src"
"<src lang=\"?\">\n\n</src>"
))
...
@@ -174,10 +176,10 @@ Entered on %U
...
@@ -174,10 +176,10 @@ Entered on %U
'
(
"p"
"#+begin_src python :results output :exports both\n\n#+end_src"
"<src lang=\"python\">\n\n</src>"
))
'
(
"p"
"#+begin_src python :results output :exports both\n\n#+end_src"
"<src lang=\"python\">\n\n</src>"
))
(
add-to-list
'org-structure-template-alist
(
add-to-list
'org-structure-template-alist
'
(
"P"
"#+begin_src python :results output :session
*python*
:exports both\n\n#+end_src"
"<src lang=\"python\">\n\n</src>"
))
'
(
"P"
"#+begin_src python :results output :session :exports both\n\n#+end_src"
"<src lang=\"python\">\n\n</src>"
))
(
add-to-list
'org-structure-template-alist
(
add-to-list
'org-structure-template-alist
'
(
"PP"
"#+begin_src python :results
file :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both \nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nreturn
(matplot_lib_filename)\n#+end_src"
"<src lang=\"python\">\n\n</src>"
))
'
(
"PP"
"#+begin_src python :results
output file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nprint
(matplot_lib_filename)\n#+end_src"
"<src lang=\"python\">\n\n</src>"
))
(
add-to-list
'org-structure-template-alist
(
add-to-list
'org-structure-template-alist
'
(
"b"
"#+begin_src shell :results output :exports both\n\n#+end_src"
"<src lang=\"sh\">\n\n</src>"
))
'
(
"b"
"#+begin_src shell :results output :exports both\n\n#+end_src"
"<src lang=\"sh\">\n\n</src>"
))
...
...
module2/ressources/rr_org/init.org
View file @
61d32194
...
@@ -281,6 +281,11 @@ Additional shortcuts for navigating through org-mode documents:
...
@@ -281,6 +281,11 @@ Additional shortcuts for navigating through org-mode documents:
(setq org-src-preserve-indentation t)
(setq org-src-preserve-indentation t)
#+end_src
#+end_src
** Python
*** We use python3
#+begin_src emacs-lisp :tangle init.el
(setq org-babel-python-command "python3")
#+end_src
** Adding source code blocks: :LUKA:
** Adding source code blocks: :LUKA:
*** With capital letters:
*** With capital letters:
To use this type <s and then TAB
To use this type <s and then TAB
...
@@ -325,12 +330,12 @@ To use this type <p and then TAB
...
@@ -325,12 +330,12 @@ To use this type <p and then TAB
#+begin_src emacs-lisp :tangle init.el
#+begin_src emacs-lisp :tangle init.el
(add-to-list 'org-structure-template-alist
(add-to-list 'org-structure-template-alist
'("P" "#+begin_src python :results output :session
*python*
:exports both\n\n#+end_src" "<src lang=\"python\">\n\n</src>"))
'("P" "#+begin_src python :results output :session :exports both\n\n#+end_src" "<src lang=\"python\">\n\n</src>"))
#+end_src
#+end_src
#+begin_src emacs-lisp :tangle init.el
#+begin_src emacs-lisp :tangle init.el
(add-to-list 'org-structure-template-alist
(add-to-list 'org-structure-template-alist
'("PP" "#+begin_src python :results
file :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both \nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nreturn
(matplot_lib_filename)\n#+end_src" "<src lang=\"python\">\n\n</src>"))
'("PP" "#+begin_src python :results
output file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nprint
(matplot_lib_filename)\n#+end_src" "<src lang=\"python\">\n\n</src>"))
#+end_src
#+end_src
*** Bash "sh" code:
*** Bash "sh" code:
To use this type <b and then TAB
To use this type <b and then TAB
...
...
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