Skip to content

Repository files navigation

LaTeX Template

A simple LaTeX Template, with nice structure, and commands for ease of use

Requirements / Dependencies


softwarewhat for ?installation link
latexmkcompile with complex options and watch for changesofficial doc
zsh [for now]shell targeted for the scripts "compile", "clear_aux" and "watch"oh-my-zsh tuto
latexseems obviousofficial doc
[linux] evincepdf viewer
[macos] skimpdf viewerofficial website
[windows] gsview32pdf viewer

why LuaTex ?

LuaTex supports utf-8 characters from the get go, which is nice when you want to use cyrillic letters as I do in my mathematics notations.

The integration of lua within latex allows for much more flexible documents, and sometimes coding in latex much faster, for instance if you want to input name-[number].tex files and then modify, add new files, remove some, ... It is much easier to just modify the range rather than deleting or adding complete lines on \input{...} :

\ifluatex% with luatex\begin{luacode*}
for i = 1, 7 do
local filename = "doc/maths/cmd_maths-" .. i .. ".tex"
tex.sprint("\\input{" .. filename .. "}")
end
\end{luacode*} \else% without luatex\input{doc/maths/cmd_maths-1.tex}
\input{doc/maths/cmd_maths-2.tex}
\input{doc/maths/cmd_maths-3.tex}
\input{doc/maths/cmd_maths-4.tex}
\input{doc/maths/cmd_maths-5.tex}
\input{doc/maths/cmd_maths-6.tex}
\input{doc/maths/cmd_maths-7.tex}
\fi

compiling and watching using latexmk :

➤ efficient way to compile and watch for changes in your LaTeX files

If you use zsh (which I do) : [or just copy paste what's inside into your terminal]

zsh compile.zsh
zsh watch.zsh

flags

# —— compile & watch flags ———
zsh compile.zsh -r # compiles report only
zsh compile.zsh -a # compiles article only
zsh compile.zsh -ra # compiles article combined with report
zsh compile.zsh -d # compiles documentation only
zsh compile.zsh -t # compiles tests only
zsh compile.zsh -h # flags help# —— Exclusive to compile ———
zsh compile.zsh # compile all files (doc/report/test)

The same applies to watch script

other shells

if you use another shell (bash/...) you might have to adapt the script [chatGPT if you are hurry] to the targeted shell.

project structure

📦LaTeX-Template
┣ 📂aux_files ‹◀ latex compiling aux files (cache)
┣ 📂doc ‹◀ github README
┣ 📂out ‹◀ compiled files
┃ ┣ 📜documentation.pdf
┃ ┣ 📜rapport.pdf
┃ ┣ 📜tests.pdf
┣ 📂src ‹◀ actual project source code
┣ 📜.latexmkrc ‹◀ compile settings
┣ 📜clear_aux.zsh
┣ 📜compile.zsh
┗ 📜watch.zsh

documentation

The documentation can be accessed easily in a pdf format at the location :

📦LaTeX-Template
┣ 📂out ‹◀ compiled files
┃ ┣ 📜documentation.pdf ← formatted custom commands and settings documentation
┃ ┣ 📜rapport.pdf
┃ ┣ 📜tests.pdf

(⚠️ incomplete, for now use the pdf) If the user prefers in a markdown format : it can be found here (📁 doc/doc.md)

testing

📦LaTeX-Template
┣ 📂out ‹◀ compiled files
┃ ┣ 📜documentation.pdf
┃ ┣ 📜rapport.pdf
┃ ┣ 📜tests.pdf ← testing commands and environments

Packages :

The project Latex-Template relies on the following latex packages to provide a better tex experience :

PackageUsed Forinclude/pacakges/
lualatexlatex engine (utf-8 : cyrillic characters in math mode)-
ifluateximport and define stuff depending on the engine used (lua/pdf)latexbase.tex
inputencutf-8 input for pdflatex engine (if used)base.tex
fontencfont encodingbase.tex
—*——*——*—
graphicxincluding imagesbase.tex
—*——*——*—
amsmathmathsbase.tex
amssymbmaths symbolsbase.tex
stmaryrdsymbols for computer sciencebase.tex
amsthmtheorem environmentstheorem_styles.tex
mathtoolsconvenient convergence arrowsbase.tex
—*——*——*—
hyperrefurl links with custom textbase.tex
urltypesetting URLsbase.tex
—*——*——*—
babelfrench names for envsbase.tex
—*——*——*—
multicoltypesetting documents with multiple columnsbase.tex
multirowtable cells spanning multiple rowsbase.tex
—*——*——*—
minitoctable of content of the chapterbase.tex
—*——*——*—
xcolorcustom colorsbase.tex
floatimproved interface for floating objectsbase.tex
—*——*——*—
tabletablesbase.tex
xcdrawdrawing tables with TikZbase.tex
arrayextending the array and tabular environmentsbase.tex
tabularxbeautiful tables with adjustable-width columnbase.tex
booktabspublication quality tablesbase.tex
—*——*——*—
algorithm2ealgorithm environmentsbase.tex
commentcommenting out large blocks of code with envbase.tex
—*——*——*—
tikz-cdcreating commutative diagramsbase.tex
tikzcreating graphics programmaticallybase.tex
pgfplotslatex curve graphsbase.tex
—*——*——*—
footmiscmake sure footnotes are bellowbase.tex
geometrypage margin dimensionsbase.tex
pdfpagesinclude PDF documentsbase.tex
dsfontdouble stroke : better than \mathbbfonts.tex
avantfont (used for pdflatex sans serif font)fonts.tex
fontawesome5icons [\info / \warn ...]fonts.tex
mfirstuccapitalizing the first letter of a wordfonts.tex
ulememphasis is now underlinefonts.tex
unicode-mathcyrillic letters in math modefonts.tex
framedframed or shaded regions that can break across pagesothers.tex
awesomeboxenv with bar at the left [\info / \warn ...]others.tex
changepagemargin adjustment and detection of odd/even pagesothers.tex
enumitemcreate custom enum environmentsothers.tex
pifontcheckmarks for checkmarks environmentothers.tex
datetimeadvanced time formatting and date commandsothers.tex
shellescpygmentize call must use console commandsminted.tex
mintedcode highlightminted.tex

Quick accesses to some settings

babel language :

  • original setting : english
code --goto src/include/packages/base.tex:14:19

margin dimensions

  • original settings :
    • top : 1.5cm
    • bottom : 1.5cm
    • margin : 2.5cm
code --goto src/include/packages/base.tex:40

Project & Render Settings

code --goto src/include/settings/project.tex
code --goto src/include/settings/render.tex

About

A simple fully-featured LaTeX Template, with nice structure, and commands for ease of use

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages