## Writing Papers Using org-mode

With LaTeX, it seems like I am spending more time researching LaTeX itself then the topic I am working on, so for sometime now I dropped LaTeX in favor of Org-mode. I am posting this as a personal cheat sheet, it is much more easier to search this site then to dig through old papers to figure out how I did stuff.

Org-mode allows you to control certain things during export using export options, following sets the default font to Arial,

#+LATEX_HEADER: \renewcommand{\rmdefault}{phv} % Arial


and following gets rid of the red boxes drawn around the links.

#+LATEX_HEADER: \usepackage{hyperref}


For those who write in non English, babel package will translate, automatically generated text strings to the language you specify.

#+LATEX_HEADER: \usepackage[turkish]{babel}


For specifying date, author, and title of the paper you are writing,

#+TITLE: Writing Papers Using org-mode
#+AUTHOR: Nurullah Akkaya
#+EMAIL: [email protected]


You can't have papers without figures, images,

#+CAPTION: Arduino Duemilanove
#+ATTR_LaTeX: scale=0.75
[[./img/arduino-duemilanove.jpeg]]


or pre-formatted text,

#+BEGIN_EXAMPLE
Some example from a text file.
#+END_EXAMPLE


for embedding source,

#+BEGIN_SRC lisp
(let [i (atom 0)]
(defn generate-unique-id
"Returns a distinct numeric ID for each call."
[]
(swap! i inc)))
#+END_SRC


If you want to listing to look like the fontified Emacs buffer you need to add these to your .emacs,

(setq org-latex-listings t)


(setq-default TeX-master t)
(setq reftex-default-bibliography
(quote
("/path/to/default.bib")))

(defun na-org-mode-reftex-setup ()
(interactive)
(and (buffer-file-name)
(file-exists-p (buffer-file-name))
(reftex-parse-all)))



\bibliographystyle{plain}

reftex-citation