This LaTeX project adopts the following conventions in all .tex
files:
- All sentences should be separated by a newline character so that it's easier to review changes in PRs:
% Like this: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. % _Not_ like this: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Please ensure that nix is installed in your system and flakes are enabled.
Build in one step:
bash make nix-build
Alternative build workflow, step-by-step:
- Open a nix shell with the necessary latex packages installed:
make shell
- Build the latex PDF:
make build
Clean all the files generated by make build
:
bash make clean
The direnv shell extension can automate the process of opening a nix shell inside any repository that contains a nix flake. This project is configured to use it.
In addition to the nix dependencies above, this requires two VS Code extensions:
direnv-vscode
(github link)LaTeX-Workshop
(github link)
Build steps:
- Open VS Code in the project root directory:
code .
- Select the main TeX file (
main.tex
) - Click the green play button (top right of file pane) to build the LaTex project (CTRL + ALT + B).
In addition to the nix dependencies above, this requires the VimTex. Install and configure the plugin according to the instructions in the link.
Build steps:
- Open a nix shell in the project root directory.
- Open the main TeX file with Neovim
nvim main.tex
. - Turn on the continuous build using VimTex's hotkey, by default
<LocalLeader>ll
. Now, it will also rebuild whenever you save changes to a.tex
file in the directory.
The Sioyek PDF viewer works particularly well with VimTex on Linux (tested on Wayland).