Latest version: Download
Older versions can be found under Releases.
To make your own thesis repo, create one by clicking "Use this template" -> "Create a new repository" above, and give it a fitting name. Clone it to your machine, and continue to set up LaTeX and a local writing environment in VS Code with the instructions below.
To make the GitHub actions build system work, you need to give write access to your repo. Do this by going to "Settings" -> "Actions" -> "General", and enable "Read and write permissions" under "Workflow permissions". After pushing changes or manually running the action, you should see a pre-release show up under "Releases".
Installing LaTeX locally isn't the most straight forward thing in the world, but this will hopefully guide you trough most of it. This is the recipie for macOS only, so you will probably need to adjust a bit if you're on another OS.
We'll look at setting up TeX Live, a bunch of packages, latexindent and finally some configuration of VS Code.
Using TeX Live/tlmgr (TeX Live package manager) and ctan.org to install packages.
Installing tlmgr
with a basic set of default packages (~300MB):
- Download installer from https://tug.org/texlive/acquire-netinstall.html
- Run
install-tl
- Enter command
S
- set installation scheme d
- basic schemeR
- return to main menuI
- start installation to hard disk
After installation, look at the installation output, and add the mentioned paths to your PATH
, MANPATH
and INFOPATH
environment variables. E.g. using zsh, add this to ~/.zshrc
:
export PATH="/usr/local/texlive/2022/bin/universal-darwin:$PATH"
export MANPATH="/usr/local/texlive/2022/texmf-dist/doc/man:$MANPATH"
export INFOPATH="/usr/local/texlive/2022/texmf-dist/doc/info:$INFOPATH"
After a restart of your terminal, the tlmgr
command should be available.
Finally, set the package repository, and check for updates to packages (may need sudo):
tlmgr option repository ctan
tlmgr option repository https://mirror.ctan.org/systems/texlive/tlnet
tlmgr update --all
tlmgr install acmart iftex xstring environ totpages trimspaces \
ncctools comment preprint quoting libertine newtx inconsolata \
todonotes chktex latexindent breakcites biblatex enumitem pdfpages \
microtype setspace booktabs upquote pdflscape
Setting up latexindent
To enable automatic indentation trough latexindent work, you may need to install the "File::HomeDir"
perl package.
sudo perl -MCPAN -e 'install "File::HomeDir"'
My Visual Studio Code configuration for LaTeX and BibTeX is included in .vscode/settings.json. Some prerequisites are:
- LaTeX Workshop (VS Code extension with lots of LaTeX features)
- ChkTeX (LaTeX linter)
- latexindent.pl (Automatic indentation)
The rest of my VS Code configurations are available at rosvik/dotfiles -> vscode/settings.json
A PDF is generated automatically on every save in VS Code, as well as on every push through the build-latex.yml
GitHub Action. If you want to generate a PDF manually, run:
bibtex main.aux && pdflatex -synctex=1 -interaction=nonstopmode \
-file-line-error -recorder -output-directory=. main.tex