Working with Emacs/org-mode, notes set 1
- Install Emacs first from gnu repos, depends on your OS
- Create or copy an `init.el` file in either the `~/.emacs` or `~/.emacs.d` file (for Mac or Linux, check documentation for Windows)
- Initialise elpa and melpa package repositories, then install the following packages
- ESS to work with R and Julia etc
- Org-mode to work with text and notes
- Auctex for rich latex support and bibtex support
- org-ref or ox-bibtex for bibliography management
- If you want to use beamer for presentations in org-mode, install beamer package separately for your system
- Follow instructions in each package as to how to configure the `init.el` file
- Many many modes exist, we touch org-mode for note taking, document authoring and time/task management. Check http://www.emacswiki.org for more information. Search for the website of Sacha Chua, org-mode, ESS, R for more information as to how to install them.
- Emacs is different, if you use plain text and learn keystrokes, you will get a lot out of it, without any programming on your part, :-), give it a shot. Below are some points to get you started.
- It is free and open source, enormous community support.
Usage notes
- Open and start new files C-x C-f
- Close files with C-x C-c
- Save files/buffers with C-x C-s
- Insert a basic header file for export with `M-org-export-default`. This is a nice template you can change to suit your taste and requirements
- First level header with one asterisk, second level header ** and so on. All forms of text decorations, emphasis, etc supported. Insert horizontal lines with 5 dashes
- Hyperlinks with [[URL][descriptor]]
- Insert mages with [[./file_address.ext]]
- Use block images with `#+NAME: id` and then crosslink with `[[id]]`
- Code block start with `#+begin_src language parameters`
- Code blocks end with `#+end_src`
- Comment blocks between `#+begin_comments` and `#+end_comments`
- Install auctex in Emacs or ox-bibtex, then configure .emacs file and use a bibtex file to store bibliography, for export of bibliography to html install bibtex2html for your OS
- For citation management, C-c C-x [ and select the reference
- In the end of the document, put `#+bibliography: filename plain`
- To add footnote, C-c C-x f, footnotes generally follow the convention of `[fn:<number>] and footnote text somewhere.
- To add tables, use | table header <tab>
- For export to other formats, C-c C-e h h (html), C-c C-e l p (pdf through latex), and similar commands for exporting to Odt
- Add Todo items with C-c C-x t
- Add timestamp with C-u C-c .
- Can configure C-c/C-v etc for copy/paste but better with M-w for copy, C-w for kill, C-y to yank back from kill-ring
- M-h to select lines, regions etc. Then use commands in 18 to work with them
- Evaluate expressions in code blocks with C-c C-c
- With R, Python, Julia, etc, use :session as an option to make data persistent across code blocks
- With R, `:results value` yields formatted table of the last run code, `:results: output` yields all code outputs
- With R, separate the figures and tables/outputs as separate blocks
- Use M-up/down arrows to move blocks of text up and down the buffer
- Use M-< or M-> to demote/promote headings
- A buffer is not a file. Save files in buffers with C-x C-s
- Open shell with M-x shell, you can run any shell code you like
- You can open shell in minor mode with M-!, or, M-|. With M-|, you can read from the buffer and make changes in the buffer