\n\n"))
+(rrmooc/add-org-template
+ '("RR" "#+begin_src R :results output graphics :file (org-babel-temp-file (concat (file-name-directory (or load-file-name buffer-file-name)) \"figure-\") \".png\") :exports both :width 600 :height 400 :session *R* \n\n#+end_src" "\n\n"))
#+end_src
*** Python code
To use this type \n\n"))
+(rrmooc/add-org-template
+ '("p" "#+begin_src python :results output :exports both\n\n#+end_src" "\n\n"))
#+end_src
#+begin_src emacs-lisp :tangle init.el
-(add-to-list 'org-structure-template-alist
- '("P" "#+begin_src python :results output :session :exports both\n\n#+end_src" "\n\n"))
+(rrmooc/add-org-template
+ '("P" "#+begin_src python :results output :session :exports both\n\n#+end_src" "\n\n"))
#+end_src
#+begin_src emacs-lisp :tangle init.el
-(add-to-list 'org-structure-template-alist
- '("PP" "#+begin_src python :results 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)\nmatplot_lib_filename\n#+end_src" "\n\n"))
+(rrmooc/add-org-template
+ '("PP" "#+begin_src python :results 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)\nmatplot_lib_filename\n#+end_src" "\n\n"))
#+end_src
*** Bash "sh" code:
To use this type \n\n"))
- (add-to-list 'org-structure-template-alist
- '("b" "#+begin_src shell :results output :exports both\n\n#+end_src" "\n\n")))
+ (rrmooc/add-org-template
+ '("b" "#+begin_src shell :session session :results output :exports both\n\n#+end_src" "\n\n"))
+ (rrmooc/add-org-template
+ '("b" "#+begin_src shell :results output :exports both\n\n#+end_src" "\n\n")))
#+end_src
To use this type \n\n"))
+(rrmooc/add-org-template
+ '("B" "#+begin_src shell :session *shell* :results output :exports both \n\n#+end_src" "\n\n"))
#+end_src
*** Graphviz
#+begin_src emacs-lisp :tangle init.el
-(add-to-list 'org-structure-template-alist
- '("g" "#+begin_src dot :results output graphics :file \"/tmp/graph.pdf\" :exports both
- digraph G {
- node [color=black,fillcolor=white,shape=rectangle,style=filled,fontname=\"Helvetica\"];
- A[label=\"A\"]
- B[label=\"B\"]
- A->B
- }\n#+end_src" "\n\n"))
+(rrmooc/add-org-template
+ '("g" "#+begin_src dot :results output graphics :file \"/tmp/graph.pdf\" :exports both
+digraph G {
+node [color=black,fillcolor=white,shape=rectangle,style=filled,fontname=\"Helvetica\"];
+A[label=\"A\"]
+B[label=\"B\"]
+A->B
+}\n#+end_src" "\n\n"))
#+end_src
** Evaluating whole subtree: :LUKA:
#+begin_src emacs-lisp :tangle init.el