1. Suggested Prerequisites for Writing LaTeX in Vim

Last modified: 8 June 2022

This is part one in a seven-part series explaining how to use the Vim or Neovim text editors to efficiently write LaTeX documents. I wrote this series with beginners in mind, but some prerequisite knowledge is unavoidable. Each prerequisites is listed below and includes a suggestion or mini-tutorial for getting up to speed. You should be comfortable with the material below to get the most out of this series.

Contents of this article

Operating system

Prerequisite: you are working on macOS, Linux, or some other Unix variant.

Suggestion (click arrow to expand)

If you use Windows, I suggest you follow along with the series as is; you will still find plenty of helpful techniques and ideas, and if XYZ doesn't work as expected, search the Internet for “how to use XYZ Vim/LaTeX/shell feature on Windows”. I do not have formal experience with Windows and cannot offer advice at the level of detail required for this series, but there should be plenty of Windows users on the Internet more knowledgeable than I am who have figured out a solution or workaround.

If you use some exotic flavor of Unix, I assume you know enough of what you are doing to adapt this series’s Linux-based suggestions to your platform.

LaTeX knowledge

Prerequisite: you know what LaTeX is, have a working LaTeX distribution installed locally on your computer, and know how to use it, at least for creating basic documents. Among other things, this means you should have the pdflatex and latexmk programs installed on your system and available from a command line.

Suggestions (click arrow to expand)

Vim knowledge

Prerequisite: you know what Vim is, have a working local installation of Vim/Neovim (or gVim/MacVim) on your computer, and know how to use it, at least for basic text editing (for example at the level of vimtutor). At the risk of belaboring the obvious, this means you must have either the vim or nvim programs (or their GUI variants) installed and available on a command line.

Suggestions (click arrow to expand)

Literacy in basic Vim/Neovim differences

Prerequisite: if you use Neovim, you should know how to navigate the small differences between Neovim and Vim, for example Neovim’s init.vim file replacing Vim’s vimrc or the user’s Neovim configuration files living at ~/.config/nvim as opposed Vim’s ~/.vim.

(Nontrivial differences, such as the server configuration required to set up inverse search with a PDF reader, are explained separately for both editors.)

Suggestion (click arrow to expand)

Read through Neovim’s :help vim-differences or read the equivalent online version.

Vim plugins

Prerequisite: you have installed Vim plugins before, have a preferred plugin installation method (e.g. Vim 8+/Neovim’s built-in plugin system, vim-plug, packer, etc…), and will know what to do when told to install a Vim plugin.

Suggestion (click arrow to expand)

Prerequisite: You should be comfortable using Vim/Neovim’s excellent built-in documentation, which you access with the :help command.

Quick crash course (click arrow to expand)

The Vim documentation is hyperlinked, and if you have syntax highlighting enabled, clickable hyperlinks to help chapters and sections should be clearly highlighted. The following two key combinations are your friend:

For more information, read :help 01.1, which explains the basics of the Vim documentation, and :help notation, which explains the notation used in the Vim documentation

Python 3 installation

Prerequisite: you have a working Python 3+ installation and are able to use pip/pip3 to install Python packages.

Suggestion (click arrow to expand)

I suggest installing Python using your distribution's package manager on Linux and using Homebrew on macOS. Both of these options should give you a reliable, up-to-date version of Python that includes pip. If you discover that you have multiple, conflicting installations of Python on your system (this is risk on macOS in particular, which ships an outdated version by default), refer to one of the many guides on the Internet for cleaning up a Python 3 installation on your operating system.

In any case, you should end up with the python/python3 and pip/pip3 commands available from a command line.

Command line usage

Prerequisite: You are comfortable with the concept of calling simple command line programs from a terminal emulator, for example using pdflatex myfile.tex to compile the LaTeX file myfile.tex, using python3 myscript.py to run a Python script, or even something as simple as echo "Hello world!" to write text to standard output.

Suggestion (click arrow to expand)

I tentatively assume that someone interested in using a command line editor like Vim is already familiar with the command line. But in case you need practice, search YouTube for one of the many guides on getting started with the command line.

Installing system packages

Prerequisite: you have a preferred method for installing new software onto your computer and know yow to use it.

Suggestion (click arrow to expand)

Use your distribution’s package manager on Linux and the Homebrew package manager on macOS.

Shell scripting abbreviations

Prerequisite: You are familiar with the more common abbreviations and macros used in shell scripting.

Quick crash course (click arrow to expand)

The abbreviations you should know for this series are:

The abbreviations e.g. and i.e.

Prerequisite: You know what “e.g.” and “i.e.” mean—I will use both throughout this series. (While these abbreviations might be obvious to some people, they could very well be exotic to others, for example non-native English speakers or anyone previously unfamiliar with technical or academic writing.)

Quick crash course (click arrow to expand)

Probably thanks to their conciseness, “e.g.” and “i.e.” commonly appear in technical and academic writing; they look weird the first time you see them, but you quickly get used to and come to appreciate them.

The original writing, images, and animations in this series are licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
CC BY-NC 4.0