diff --git a/module2/ressources/emacs_orgmode.html b/module2/ressources/emacs_orgmode.html index 648c854e8fa6bb6562d47232cb7933fa6f1b71e5..3e7b3fc4539f573468af21f80156fa7a35d8b0e6 100644 --- a/module2/ressources/emacs_orgmode.html +++ b/module2/ressources/emacs_orgmode.html @@ -4,64 +4,66 @@

Table of Contents

+

+Disclaimer: The two sections A simple "reproducible research" +emacs configuration and A stub of replicable article explain how to +set up org-mode for this MOOC. You really should follow them +carefully or you may have trouble doing the exercices later on. +

-
-

Installing emacs, org-mode, ess, and auctex.

-
+
+

Installing emacs, org-mode, ess, and auctex.

+
-
-

OS-specific installation procedure

-
+
+

OS-specific installation procedure

+
-
-

Linux (Debian, Ubuntu)

-
+
+

Linux (Debian, Ubuntu)

+

We provide here only instructions for debian-based distributions. Feel free to contribute to this document to provide up-to-date information @@ -123,9 +125,9 @@ which is now deprecated.

-
-

Mac OS X

-
+
+

Mac OS X

+
  • Option 1: Install the .dmg file from Vincent Goulet: @@ -158,9 +160,9 @@ brew install wget

-
-

Windows

-
+
+

Windows

+

Install the .exe file from Vincent Goulet: https://vigou3.github.io/emacs-modified-windows/. It ships with recent @@ -174,9 +176,15 @@ versions:

-
-

A simple "reproducible research" emacs configuration

-
+
+

TODO A simple "reproducible research" emacs configuration

+
+
+

+There will be a mini video illustrating these steps at some point +

+
+

Emacs comes with very basic default configuration and it appears like everyone has its own taste. You will for example find here several @@ -189,9 +197,9 @@ adding a few org-mode specific configurations.

-
-

Step 0: Backup and download our configuration

-
+
+

Step 0: Backup and download our configuration

+

The procedure we propose will wipe your already existing custom emacs configuration if you already have one. You should thus beforehand make @@ -200,7 +208,7 @@ exists).

-Then download this archive and uncompress it. It contains the +Then download this archive and uncompress it. It contains the following files and we will refer to them in the following:

@@ -212,9 +220,9 @@ rr_org/journal.org
-
-

Step 1: Prepare your journal

-
+
+

Step 1: Prepare your journal

+

Create an org/ directory in the top of your home:

@@ -226,14 +234,14 @@ Create an org/ directory in the top of your home: Then copy rr_org/journal.org file in your ~/org/ directory. This file will be your laboratory notebook and all the notes you will capture with C-c c will go automatically go in this file. The first -entry of this notebook is populated with many emacs shortcuts that you +entry of this notebook is populated with many emacs shortcuts that you should give a try.

-
-

Step 2: Set up Emacs configuration

-
+
+

Step 2: Set up Emacs configuration

+

Copy rr_org/init.el in your ~/.emacs.d/ directory.

@@ -245,9 +253,9 @@ configuration with the following command: emacs -q -l rr_org/init.el
-
-

Step 3: Check whether the installation is working or not

-
+
+

Step 3: Check whether the installation is working or not

+

Open a new instance of Emacs and open a foo.org file. Copy the following lines in this file: @@ -274,13 +282,13 @@ worked. In the video, we already have demonstrated the main features and shortcuts of emacs/org-mode that will help you maintain a document and benefit from literate programming. The list of features and shortcuts -is demonstrated in the first entry of your labbook. +is demonstrated in the first entry of your labbook.

-
-

Step 4: Open and play with your journal:

-
+
+

Step 4: Open and play with your journal:

+

In step 1, you were told to create an journal in ~org/journal.org. First you probably want to make sure this file is @@ -291,58 +299,126 @@ forums.

+
+

TODO A stub of replicable article

+
+
+

+There will be a mini video illustrating these steps at some point +

+
+ +

+Remember, you need a working LaTeX and R environment. If you can't +open a terminal and run the commands R, pdflatex, and python, you will not be +able to generate this document. When being compiled, the article downloads the +corresponding LaTeX packages so you also need to have a working wget +command (alternatively, it uses curl). Once downloaded, you may still read the +source (article.org) and understand how it works though. +

+ +

+Download the following archive and untar it. +

+ +

+ and simply make to generate the +article. You should then be able to open the resulting article. This +is summarized in the following command: +

+
+
wget --no-check-certificate -O replicable.tgz https://github.com/alegrand/RR_webinars/raw/master/1_replicable_article_laboratory_notebook/replicable/replicable.tgz ### Fix the broken URL
+tar zxf replicable.tgz; cd replicable; make ; evince article.pdf
+
-
-

Emacs Tips and tricks

-
+ +

+If the make command fails (especially on Mac), it may be because emacs +or something else is not correctly installed. In that case, open the +article directly with the following command: +

+
+
emacs -q --eval "(setq enable-local-eval t)" --eval "(setq enable-local-variables t)"  article.org
+
-
-

Cheat-sheets

-
+

+and export it to pdf with the following shortcut: C-c C-e l o +

+ +

+If it still doesn't work and emacs complains about not finding ESS, it +may be because you installed ESS in your home instead of +system-wide. In that case, try to remove the -q in the previous +command line to load your personal emacs configuration. +

+ +

+Finally, when you'll be tired of always reexecuting all the source +code when exporting, just look for the following line in article.org: +

+
+# #+PROPERTY: header-args :eval never-export
+
+

+If you remove the in the beginning of the line, it will not be a +comment anymore and will indicate org-mode to stop evaluating every +chunk of code when exporting. +

+
+
+
+ +
+

Emacs Tips and tricks

+
+
+
+

Cheat-sheets

+

Learning emacs and org-mode can be difficult as there is an inordinate amount of shortcuts. Many people have thus come up with cheat-sheats. Here is a selection in case it helps:

-
-

Emacs

-
+ -
-

Org-mode

- -
-

Video tutorials

-
+
+

Video tutorials

+

For those of you who prefer video explanations, here is a Youtube channel with many step by step emacs tutorials.

-
-

Additional useful emacs packages

-
+
+

Additional useful emacs packages

+
-
-

Company-mode

-
+
+

Company-mode

+

Company-mode is a text completion framework for Emacs. It allows to have smart completion in emacs for the most common languages. If you @@ -351,9 +427,9 @@ official webpage: http://company-mode.g

-
-

Magit

-
+
+

Magit

+

Magit is an emacs interface for Git. It is very powerfull and we use it on a daily basis but you should definitely understand what git does @@ -364,9 +440,9 @@ you should follow the instructions from here:

-
-

Other resources

-
+
+

Other resources

+
-
-

A replicable article

-
-
-
-

A stub of replicable article

-
-

-Remember, you need a working LaTeX and R environment. If you can't -open a terminal and run the commands R and pdflatex, you will not be -able to generate this document. The article downloads the -corresponding LaTeX packages so you also need to have a working wget -command (alternatively, you can use curl). You may still read the -source (article.org) and understand how it works though. -

- -

-Download the archive, untar it and simply make to generate the -article. You should then be able to open the resulting article. This -is summarized in the following command: -

-
-
wget --no-check-certificate -O replicable.tgz https://github.com/alegrand/RR_webinars/raw/master/1_replicable_article_laboratory_notebook/replicable/replicable.tgz ### Fix the broken URL
-tar zxf replicable.tgz; cd replicable; make ; evince article.pdf
-
-
- -

-If the make command fails (especially on Mac), it may be because emacs -or something else is not correctly installed. In that case, open the -article directly with the following command: -

-
-
emacs -q --eval "(setq enable-local-eval t)" --eval "(setq enable-local-variables t)"  article.org
-
-
-

-and export it to pdf with the following shortcut: C-c C-e l o -

- -

-If it still doesn't work and emacs complains about not finding ESS, it -may be because you installed ESS in your home instead of -system-wide. In that case, try to remove the -q in the previous -command line to load your personal emacs configuration. -

- -

-Finally, when you'll be tired of always reexecuting all the source -code when exporting, just look for the following line in article.org: -

-
-# #+PROPERTY: header-args :eval never-export
-
-

-If you remove the in the beginning of the line, it will not be a -comment anymore and will indicate org-mode to stop evaluating every -chunk of code when exporting. -

-
-
-