My LaTeX setup

Posted on December 1, 2023 by

I write my research papers directly in Emacs, marked up with LaTeX. The AuCTeX Emacs package provides lots of time-saving functions, macros, and keymaps that have become so automatic to me that I can just focus on the writing.


  • I compile my LaTeX documents with LuaTeX (instead of pdfTeX) for a few reasons:
    • With fontspec and unicode-math, I can create documents using any installed font, rather than being limited to fonts provided in LaTeX packages.
    • Sometimes there is a need to run calculations as part of the document, such as when drawing figures using TikZ.
    • Some LaTeX packages require LuaTeX. An example is lua-check-hyphen, which generates a list of all hyphenated words in the document, so I can confirm that they are hyphenated at the right places.
  • The preview-latex (now included in AuCTeX) embeds compiled chunks of rendered LaTeX (e.g., math symbols and equations) directly in the emacs frame. That way I can see the all of the content – text and math – together in the same frame I am writing in, without having to glance to the output pdf.
  • Reference management: I use biber (http://biblatex-biber.sourceforge.net){:xn} and biblatex to insert citations and create bibliographies. Biblatex is designed to be more flexible and customizable than bibtex, but my references are stored in bibtex format. My bibtex database (which I maintain using BibDesk contains 1,800 references (and in most cases, pdfs) of academic papers I have downloaded, read, intend to read, intended to read, or otherwise needed for some reason, collected since I was a graduate student. I write everything in Emacs: code, reviews, manuscripts, lecture slides, and even recommendation letters. Specifically, I use Aquamacs Emacs, an emacs port for MacOS. GNU Emacs has been around since 1985, so it is just plain solid, with a huge user base for support, and thousands of packages and modes that can do anything from syntax highlighting of your favorite programming language (ess-r-mode) to psychotherapy (doctor). By using the same program for ever a fully-featured platform, I can use the same program (and thus, the same keybindings) for everything I do.