The accompanying scripts in this directory provide two main functionalities:
- Automating the creation of
$\LaTeX$ new projects from a template that includes configuration files for editors, formatter, typesetting program, andGit
tools. - A non-interactive and cross-platform installation of a
$\TeX$ distribution along withlatexmk
and$\TeX$ packages needed for certain CI/CD workflows. Also, depending on the installation path, this can be completed without privileged access.
A latexmk
. The
accompanying scripts started from a need to use latexmk
in a
minimal CI/CD environment and aim to address the following issues encountered
in the process:
-
Availability: Depending on the system,
latexmk
is not always available through the system's package manager. -
Bandwidth and disk usage: When available, installing a full mainstream
$\TeX$ distribution using the system's package manager seems to function as expected. However, it is too large (>5GB) to be used in a CI/CD workflow. Also, several, often many,$\TeX$ packages are generally bundled in a single system package. Hence, relying only on the system's package manager may lead to excessive disk usage, even to build a simple document like the provided template. -
Conflicting versions: Mainstream
$\TeX$ distributions have their own package managers, e.g.tlmgr
for TeX Live andmpm
for MiKTeX. So, in theory, one should be able to install a minimal$\TeX$ distribution using the system's package manager and then install the remaining$\TeX$ packages using the$\TeX$ distribution package manager. However, in some cases, the installed version of the$\TeX$ distribution package manager is outdated and fails to function, as is the case fortlmgr
on Ubuntu 20.04 - 24.04, where you may greeted with error messages that require some extra steps to be resolved.
Supported
To install a latexmk
, you could run
the following command using either Bash
or PowerShell
:
kickstart latex -install
This defaults to the TeX Live
distribution. The installer's
settings could be specified in the configuration files and
overridden using command-line options. For instance, the following command
installs a minimal Tex Live distribution (only infrastructure), along with a
specified set of
kickstart latex \
-install \
-distribution texlive \
-tl-scheme infraonly \
-tl-pkgs "amscls,amsfonts,amsmath,etoolbox,hyperref,latex-bin,latexmk" \
-download-dir "$HOME/Downloads" \
-tex-dir "$HOME/texlive" \
-tex-user-dir "$HOME/.texlive"
For available options, run:
kickstart latex -help
Afterwards, additional tlmgr
for TeX
Live
:
tlmgr install <package1> <package2> ...
To initialise a new Bash
or
PowerShell
:
kickstart latex -new <project_name>
The default configuration could be overridden using command-line options.
For example, the following command creates a new
kickstart latex -new <project_name> -author <author> -email <email>
For available options, run:
kickstart latex -new <project_name> -help
- To build the
$\LaTeX$ document:
latexmk
- To build and preview the document:
latexmk -pv
- To continuously build and preview the document on save:
latexmk -pvc
- To clean all generated files except the DVI, PostScript, and PDF files:
latexmk -c
- To clean all generated files:
latexmk -C
See latexmk
documentation for more
options.