A basic template for writing my documents in LaTeX
- Use cmake with
UseLATEX.cmake - Out-of-the-box multi-file LaTeX projects (with
subfiles) - Mathematical writing oriented (support of
asmmath,asmthm,mathtools...)
├── CMakeLists.txt
├── includes
│ └── UseLATEX.cmake
├── README.md
└── source
├── images
├── main.tex
├── packages
│ └── preamble.sty
└── partials
└── sample.tex
CMakeLists.txtfile contains a set of directives and instructions forcmakedescribing the project's source files.includes/directory contains all the scripts necessary for the project.source/directory contains all LaTeX related files.source/imagesdirectory contains all the images of the project.source/main.texfile is the main LaTeX file of your project.source/packagesdirectory contains all the packages provided by the user.source/packages/preamble.styfile is a LaTeX package that loads modules and basic configurations.source/partialsdirectory contains all the LaTeX subfiles.
UseLatex.cmake is a very powerful tool that allows to abstract the different commands to compile a latex file. Regarding features (enabling BibLaTeX...) or compatibility (especially for Windows users), please refer to the manual.
- A distribution for the TeX typesetting system (
TeX Livefor example) biber- a bibtex replacement for users of biblatex (if you have to use BibLaTeX)imagemagick- a free software suite for the creation, modification and display of bitmap imagescmake- cross-platform free and open-source software for build automationmake- GNU make utility to maintain groups of programs
First, you have to clone the repository on your computer
$ git clone https://github.com/HelloEdit/latex-template.gitAfter that you need to execute cmake in order to create the targets.
$ cmake -S . -B buildA new directory build will be created with all the required make files inside. To build the pdf, run the following commands
$ make -C build pdf --silentYou should see at the root of the project a new file main.pdf.