Published May 15, 2026  ·  Updated July 27, 2026  ·  latex · tools

My LaTeX setup

After some time using Overleaf to write LaTeX, I sought something more intuitive. I stumbled upon a method pioneered by the late Gilles Castel, which does a great job turning LaTeX from a rigid final layer into something more responsive. It's fast, flexible, fun, and much better explained by him than I could do here. Nonetheless, here's an overview of how I adapted my own skeleton structure.

Editor

I use Neovim with VimTeX.

Neovim is a highly-customizable keyboard-based text editor. Using Neovim, or something like it, is critical for the fine user customization via plugins and configuration files required to make the setup lightning-fast. You can spend an unbounded amount of time customizing your own setup, but simply following a tutorial can yield a sufficient start. Some helper plugins I appreciate are:

  • lualine: a customized statusline displaying editing mode, current file, file length, etc.
  • WhichKey: a popup display showing available shortcut completions, which is especially helpful when familiarizing with Neovim
  • nvim-autopairs: closes your brackets for you
  • UltiSnips: this shortcut (or 'snippet') engine is what makes the workflow possible
VimTeX handles continuous compilation, forward/inverse PDF search, and useful commands. This guide, linked on the VimTeX repo is very useful in getting started.

Compiler

I compile with latexmk, generally using the default options provided in examples you can find online. Here are two options worth noting:

vim.g.vimtex_view_method = 'skim' 
vim.g.vimtex_view_skim_activate = 0

The first must be customized to your pdf viewer. The second stops Skim (my pdf viewer for macOS) from being 'focused,' or brought to the foreground during forwards search, which is useful to avoid having to switch back with alt-tab or mouse actions.

PDF viewer

Skim is the equivalent of Zathura for macOS. It auto-reloads on recompile and supports SyncTeX for jumping between source and PDF. It's not perfect, but more than good enough for my purpose of live-viewing the compiled LaTeX as I write it.

Directory structure

I keep one repo per course notes in the style detailed below, which is generalizable to other project types:

preamble.tex     // all packages and macros, shared across my classes
ECE203/          // a given course has its own sub-directory
  main.tex       // root file which just inputs everything
  lec_1.tex      // all lectures get their own file
  lec_2.tex 
  ...
  figures/       // a directory for any figures built or imported
One subtle organizational change I appreciate is the use of a build folder to declutter the working directory when writing documents. This results in the auxiliary files produced by the compiler being stored in ./build/ (or whatever you choose to name it), leaving just the .tex and .pdf files on the local tree.

To set this up, add this line to your VimTeX configuration file to tell VimTeX about your auxiliary file 'build' directory:

vim.g.vimtex_compiler_latexmk = {
  aux_dir = 'build',
}
Note that I am using Neovim's Lua compatibility in my setup, but this could be adapted for Vimscript. An alternative approach would be adding a line to a local (in the project directory) or global (in the home directory) .latexmkrc configuration file as:
$aux_dir = 'build';
This could allow for more granular control, but overall has the same effect.

One small note I'd like to add pertains to biber, a useful bibliography resource. I find that sometimes, especially on a bigger project, my bibliography will suddenly fail and refuse to compile. For me, the problem seems to always be a malformed cache. You can find the cache with:

biber --cache
And force a reset by simply deleting it:
rm -rf <biber_cache>
If this fails, another handy tool is:
biber -debug <path/to/filename.bcf>

What I'd recommend

Using this setup took me some time to adjust to. For the Neovim setup, I'd recommend following a tutorial, but keeping things as simple as possible. Try to trim away the clutter so that you know the boundaries of your setup and how to change it. You probably need less than you think.

For VimTeX, if you haven't worked with LaTeX before, I'd start in Overleaf with this great resource by Tobias Oetiker.

As per the most efficient way to familiarize yourself with UltiSnips, I would recommend downloading Gilles' snippets files and combining them into one .txt file, not a .snippets file. When you feel you are doing something repetitive and inefficient, then I would look through the text file, find an appropriate snippet (if it exists) and only then add it to your .snippets file. This will save you the time of having to create each snippet yourself when someone else has already taken the time to create one with an efficient bind. However, it will also ensure that all the snippets in your config are in your repertoire. Of course, if a snippet doesn't exist, add it yourself! It's good practice.

← All posts