Custom LaTeX packages for applications below:
If you are using Windows, disconsider this section.
Pre-commits in a repository help enforce code quality and consistency by automatically running checks (like linters, formatters, or tests) before changes are committed.
This ensures that only code meeting certain standards is added to the project, reducing errors and improving maintainability.
In Linux open the repository main folder and run:
pre-commit -V
# pre-commit 2.17.8If a version is shown, pre-commit is already installed. If it is not the case, installed, run:
sudo apt install pre-commitThen in the repository main folder run:
pre-commit install
pre-commit --install-hooksWait until it is finished. Then run:
pre-commit run --all-filesAll necessary auxiliary files will be created:
- .clang-format
- .cmake-format.yaml
- .isort.cfg
- .pylintrc
Then run:
sudo apt install clang-formatFinally, pre-commit is installed.
If a pylint warning should be ignored add:
# pylint: disable=<flag-name>
...If all pylint warnings should be ignored add:
...
# pylint: skip-fileRequired for LaTeX interpretation and PDF generatation.
Run the following:
sudo apt-get install texlive-fullIf terminal stucks in an infinit loop try hitting enter as explained on StackOverFlow.
Run
tex --versionto check TeX Live installation.
Install MiKTeX.
Install VSCode LaTex Workshop.
Open VSCode settings with ctrl + , and:
- set
LaTeX Auto Build: Runtonever; - set
LaTeX Auto Clean: RuntoonBuilt; - set
LaTeX Clean Subfolder: Enabledtotrue; - set
LaTeX LaTeX Root File: Use Sub Filetotrue;
Recommeded enviroment setting:
- set VSCode
Editor: Render Whitespacetotrailing; - set VSCode
Files: Auto SavetoafterDelay; - set VSCode
Files: Auto Save Delayto100; - search
Editor: Rulers, open settings.json file and add:
"editor.rulers": [
80, 100
],Using subfiles in LaTeX allows you to break a large document into smaller, manageable sections. Each section can be edited and compiled independently, improving collaboration and workflow, especially in complex projects like theses or books. It also helps in organizing content efficiently without cluttering the main document.
Project structure example:
.
├── document
│ ├── main.tex
│ └── sections
│ ├── section_1.texmain.tex file:
% main.tex
\documentclass{article}
\usepackage{../../../../tpack/document/tpack}
...section_1.tex file:
% section_1.tex
\documentclass[../main.tex]{subfiles}
...With this structure is possible to build the main.tex from the section_1.tex file.
Add desired package with:
\usepackage{tpack/package_folder/package_name}Main commands:
ctrl + alt + b: generate PDF;ctrl + alt + v: open generated PDF;