diff --git a/module2/ressources/rr_org/init.el b/module2/ressources/rr_org/init.el index e833e545e15f14df4ba4a50a05f5d9986e8aa1b4..02fb613e370922ffc0877e1130c7a3d11e88fab5 100644 --- a/module2/ressources/rr_org/init.el +++ b/module2/ressources/rr_org/init.el @@ -1,3 +1,15 @@ +;; Machine-dependent configuration - adapt as required for your computer! + +;; If a full path to the interpreter is used, be careful it if contains spaces +;; (which seems to be typical for Windows and not rare for macOS). The path +;; must then be surrounded by backslash-escaped quotation marks, as in +;; (setq org-babel-python-command "\"C:/Program Files/Python/Python37/python.exe\"") +(setq org-babel-python-command "python3") + +;; For Unix-like systems, this can be normally left commented out. Under Windows, +;; insert the path to your R interpreter. +;; (setq inferior-R-program-name "C:/Program Files/R/R-3.5.1/bin/x64/Rterm.exe") + (require 'org) (setq inhibit-splash-screen t) @@ -154,8 +166,6 @@ Entered on %U )) (setq org-src-preserve-indentation t) -(setq org-babel-python-command "python3") - (add-to-list 'org-structure-template-alist '("s" "#+begin_src ?\n\n#+end_src" "\n\n")) diff --git a/module2/ressources/rr_org/init.org b/module2/ressources/rr_org/init.org index 539f2381f1e462962db01543ec9ab74007a77fb0..9a19c03e24f8f868073eccdf96a03b19c8bbadc5 100644 --- a/module2/ressources/rr_org/init.org +++ b/module2/ressources/rr_org/init.org @@ -18,6 +18,29 @@ to work, you'll need: Backup you own =.emacs= if you have one and replace it with [[file:init.el][the content of this file]]. If you ever want to regenerate if from this org document, simply =M-x org-babel-tangle=. + +* Machine-dependent configuration +For Linux, macOS, and other Unix-like systems, the following settings will probably work fine. If you use Windows, or if running Python and/or R code from OrgMode fails with an error message, please replace "python3" by the full path to your Python interpreter. + +#+begin_src emacs-lisp :tangle init.el +;; Machine-dependent configuration - adapt as required for your computer! +#+end_src + +** Python +*** We use python3 +#+begin_src emacs-lisp :tangle init.el +;; If a full path to the interpreter is used, be careful it if contains spaces +;; (which seems to be typical for Windows and not rare for macOS). The path +;; must then be surrounded by backslash-escaped quotation marks, as in +;; (setq org-babel-python-command "\"C:/Program Files/Python/Python37/python.exe\"") +(setq org-babel-python-command "python3") +#+end_src +** R +#+begin_src emacs-lisp :tangle init.el +;; For Unix-like systems, this can be normally left commented out. Under Windows, +;; insert the path to your R interpreter. +;; (setq inferior-R-program-name "C:/Program Files/R/R-3.5.1/bin/x64/Rterm.exe") +#+end_src * Loading files: ** Loading babel: :ARNAUD: #+begin_src emacs-lisp :tangle init.el @@ -280,11 +303,6 @@ Additional shortcuts for navigating through org-mode documents: (setq org-src-preserve-indentation t) #+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: *** With capital letters: To use this type