Skip to content

niccolozanotti/cmake-tex-template

Repository files navigation

cmake-tex-template

This project is meant to be a quick start template to write a LaTeX document whose compilation is handled by Cmake through UseLATEX module.

For more information check out the documentation of UseLATEX here.

Dependencies

This project has the following dependencies:

First, check if CMake is installed by running

cmake --version

If CMake is installed, you should see an output with the version number, such as:

cmake version 3.xx.x

If you get an error or CMake is not installed check the instructions below.

To check if LaTeX is installed and available in your system’s path, run the following command:

latex --version

If LaTeX is installed, you should see an output with the version number, such as:

pdfTeX 3.x.x

If you get an error or LaTeX is not installed, check the instructions below.

Build the files

One way to quickly compile the .tex files into the relative .pdf is by running

mkdir build
cd build
cmake ..
make target-name 

The target-name.pdf file will then be located in the build/ directory.

Installation instructions

Installing LaTeX

macOS (via Homebrew)

Open a terminal and run:

brew install --cask mactex  # or mactex-no-gui for the lighter version without the GUI

Linux (Debian/Ubuntu)

Open a terminal and run:

sudo apt-get update
sudo apt-get install texlive-full

On other distributions, use the equivalent package manager (e.g., dnf for Fedora, pacman for Arch).

Windows

Download the full MiKTeX installer from the MiKTeX website, and follow the installation instructions.

Alternatively, you can install it via Chocolatey by running:

choco install miktex

Installing CMake

macOS (via Homebrew)

Open a terminal and run:

brew install cmake

Linux (Debian/Ubuntu)

Open a terminal and run:

sudo apt-get update
sudo apt-get install cmake

On other distributions, use the equivalent package manager (e.g., dnf for Fedora, pacman for Arch).

Windows

Download the latest installer from the official CMake website, and follow the installation instructions.

Alternatively, you can install CMake through a package manager like Chocolatey by running:

choco install cmake

UseLatex module update

If any change in the upstream Cmake module UseLatex.cmake is detected (the Github Action runs monthly1) a new Pull Request will be opened to integrate the changes.

License

This project is licensed under the MIT LICENSE.


Footnotes

  1. You can also manually trigger an update with a manual dispatch if you need.

About

A LaTeX project template making use of UseLATEX.cmake module

Topics

Resources

License

Stars

Watchers

Forks