The repo contains 4 primary latex directories:
│
├── .github -- Workflow files
│
├── scripts -- Typescript files - only used in workflows
│
├── config -- LaTeX class and style files
│
├── book -- LaTeX root files - longer
├── handout -- LaTeX root files - shorter
│
├── exercise -- LaTeX standalone files - single exercises
└── graphics -- LaTeX standalone files - single graphics
Config files are in the config folder. These files are used in the document
preambles. In order to use these files, they have to be copied or linked to a
location known to texlive. Running the following script takes care of this:
./link.sh
Using the same config files in all of our tex source files helps us using
consistent notations throughout our documents. They also make life easier when
it comes to changing the styling of a specific element, because this way the
change only has to be made in one location.
For each filetype, we have custom class files. You should begin the documents
like this:
% Files in the book directory
\documentclass{math-book}
% Files in the handout directory
\documentclass{math-handout}
% Files in the exercise directory
\documentclass[exercise]{math-standalone}
% Files in the graphics directory
\documentclass[graphics]{math-standalone}We also have custom style files. These files are already included in the
class files, so you do not need to worry about importing them. They provide
some useful environments or command, like these:
% Used for regular vectors
\rvec{u}
% Used for unit vectors
\uvec{v}
% Used for dot product
\dprod{u}{v}Besides config files, we have 4 different tex source file types
- Standalone files
graphicsfiles contain a single figure.exercisefiles each contain one exercise.
- Root files
handoutfiles contain approximately 45 minutes worth of information.bookfiles contain more information
Each folder containing root or standalone files most contain the following
files:
config.yml
root_files:
- input: main # Required
- output: # Undefined by default
- lang: # Undefined by default
out_file: true # Can be true or false (true - infer, false - fallback)
lang: true # Can be boolean or string (true - infer, false - off, string - force value)
external_deps: # Undefined by default
program_name:
- dep1
- dep2- Language specific files must use either
.hu.texor.en.texextensions. - Other files, that do not contain any language specific text (like graphics)
can use the
.texextension, butlang = falsemust also be specified in the correspondingconfig.ymlfile.
If you have the github cli gh installed, clone the repo by the following
command:
gh repo clone tibi1220/math-docs
If you do not, use the default git command. It is already installed on MacOS:
git clone git@github.com:tibi1220/math-docs.git
Install MacTeX.
After installation, you will need to get latexindent working.
- You can either install
latexindentwithbrewby running the following script:
brew install latexindent
- Or you can manually install the
perlmodules by using thecpanmpackage manager:
cpanm YAML::Tiny
cpanm File::HomeDir
You can check out my neovim configuration here.
Some of the most important plugins when working with latex:
nvim-lspconfig- lsp configmason- installationvimtex- latex compilationnull-ls- formatting
These settings and extensions are already included in the repo, so if you are using VS Code, there is no need to change anything in your config.