IEEE Org Template

Setting up Emacs and org-mode to use IEEE’s two-column template.

Academic Publishing with org-mode

As a PhD student, writing papers to tell the world about your research is important - but the formatting of those papers is also important. Most academics I know use LaTeX for this purpose - although some use Microsoft Word. While I slightly prefer Word over LaTeX, I vastly prefer org-mode to both. But the formatted results look great - so dealing with one or the other is necessary.

This week I am submitting a paper where I am the primary author for the first time. So I am using an org-mode based workflow, but exporting the results in the format required by the conference: IEEE’s A4 Manuscript template.

IEEE Template

Although I’m an enthusiastic user of Emacs, I would not consider myself much of an elisp hacker, nor particularly adept at navigating the Emacs ecosystem. Mostly I search for bundles of functionality that seem to fit my needs, and stitch them together as well as I can manage. This is why I use doom-emacs as my basic Emacs configuration - it has most of the functionality I want “out of the box”.

I say all this as a disclaimer that I basically hack and slash my way toward a working Emacs setup, so I don’t always know what modifications are responsible for the final product. With that disclaimer out of the way, here is how I use an IEEE template with org-mode to produce great-looking results:

Finally, I needed to add “IEEEtran” to org-latex-classes like so:

;;; custom.el
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(org-html-head-extra "
")
 '(org-latex-classes
   '(("IEEEtran" "\\documentclass[conference]{IEEEtran}"
      ("\\section{%s}" . "\\section*{%s}")
      ("\\subsection{%s}" . "\\subsection*{%s}")
      ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
      ("\\paragraph{%s}" . "\\paragraph*{%s}")
      ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
     ("article" "\\documentclass[11pt]{article}"
      ("\\section{%s}" . "\\section*{%s}")
      ("\\subsection{%s}" . "\\subsection*{%s}")
      ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
      ("\\paragraph{%s}" . "\\paragraph*{%s}")
      ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
     ("report" "\\documentclass[11pt]{report}"
      ("\\part{%s}" . "\\part*{%s}")
      ("\\chapter{%s}" . "\\chapter*{%s}")
      ("\\section{%s}" . "\\section*{%s}")
      ("\\subsection{%s}" . "\\subsection*{%s}")
      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
     ("book" "\\documentclass[11pt]{book}"
      ("\\part{%s}" . "\\part*{%s}")
      ("\\chapter{%s}" . "\\chapter*{%s}")
      ("\\section{%s}" . "\\section*{%s}")
      ("\\subsection{%s}" . "\\subsection*{%s}")
      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
 '(org-latex-image-default-width "0.3\\linewidth")
 '(package-selected-packages '(org-ref)))

Exporting

A minimal requires a bibliography file and an org-mode document. IEEEtran is included as a separate .org file with the SETUPFILE directive in the first line: #+SETUPFILE: ieee.org I use bibtex format in my bibliography file, and saved it as references.bib.

SETUPFILE

This is the content of ieee.org:

#+LATEX_CLASS: IEEEtran
#+LATEX_CLASS_OPTIONS: [conference]
#+LATEX_HEADER: \IEEEoverridecommandlockouts
#+LATEX_HEADER: \usepackage{cite}
#+LATEX_HEADER: \usepackage{amsmath,amssymb,amsfonts}
#+LATEX_HEADER: \usepackage{algorithmic}
#+LATEX_HEADER: \usepackage{graphicx}
#+LATEX_HEADER: \usepackage{textcomp}
#+LATEX_HEADER: \usepackage{xcolor}
#+LATEX_HEADER: \usepackage[hidelinks]{hyperref}

# Above lines from https://github.com/samb33t/org-ieee; next line added by me:
#+LATEX_HEADER: \usepackage{hanging} %% for IEEE-style hanging indent in References section.

The Main Document

This is the file where you’d add your content:

#+TITLE: Your Title Here
#+SETUPFILE: ieee.org
#+LATEX_HEADER: \input{def.tex}
#+LATEX_HEADER: \input{author.tex}
#+OPTIONS: toc:nil ^:{} author:nil date:nil
#+BIBLIOGRAPHY: references.bib
#+INCLUDE: abstract.org
* Introduction
Some text with a citation [cite:@taylorgetting].
* Methods
words and another [cite:@vu2020typosquatting] citation.

* Results
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
more words more words more words more words more words more words more words more words
* Discussion
words words words words words words words words words words words words words words words words words words words words
words words words words words words words words words words words words words words words words words words words words
words words words words words words words words words words words words words words words words words words words words

Here's a new paragraph with more words words words words words words words words words words words words words words
words words words words words words words words words words words words words words words words words words words words
words words words words words words words words words words words words words words words words words words words words
words words words words words words words words words words words words words words words words words words words words
words words words words words words words words words words words words words words words words words words words words
* References
:PROPERTIES:
:UNNUMBERED: t
:END:
#+begin_export latex
\begin{hangparas}{.25in}{1}
#+end_export
# download: https://github.com/citation-style-language/styles/master/ieee.csl
#+CITE_EXPORT: csl ieee.csl
#+PRINT_BIBLIOGRAPHY:
#+begin_export latex
\end{hangparas}
#+end_export

The #+LATEX_HEADER: lines include LaTeX-formatted headers, before any content. I wrote my abstract as a separate abstract.org file and used #+INCLUDE: to include its content.

Since I wanted the References to use hanging indent style, I added the hanging package and wrapped the bibliography with hangparas.

Results

In doom-emacs, the key sequence to export is SPC m e l o, and the result looks like this:

ieee-export-example.png