Generates latex templates (e.g., for thesis, workshops, conferences, IEEEtran, LNCS, ...) out of "micro-templates"
LaTeX templates abound.
All of them make use of certain packages such as hyperref, listings, or minted.
The packages have to be a) included in the .tex file somehow and b) configured.
Moreover, some packages offer interfaces (such as new commands or new environments) to users.
Minimal examples help to understand how a package works.
The aim of the repository is to provide for each common LaTeX package
- Configuration
- Usage example
and a generation into templates:
- Support for ACM, IEEE, LNCS, KOMA-Script
- Support for separate documents which require
--shell-escapeand not. - Support for integrated pdflatex and lualatex documents
Besides the paper and thesis document classes, the generator offers a minimal Markdown quick start, selectable as the mwe document class — for people who want a fast start with writing rather than a full thesis with all the tricks.
- You write the content in Markdown inside a
\begin{markdown} … \end{markdown}block inmain.tex(via themarkdownpackage):#becomes a chapter,##a section; citations ([@key]), footnotes, task lists, pipe tables, and images work out of the box. - It compiles with LuaLaTeX + biber (the
markdownpackage needs Lua; the bibliography uses biblatex). zref-cleverturns the Markdown{#id}identifiers into smart\zcrefcross-references that print the type name (e.g. "Figure 1.1" / "Abbildung 1.1").- It generates a single minimal
main.tex— no thesis scaffolding, abbreviations, orcommands.tex— hides the paper/thesis-only prompts, and ships a trimmed, quick-start README.
Generate it non-interactively with:
yo latex-template --documentclass=mwe --lang=enOne has to install Node.js version 18 (or later) to get this generator running. For a simple installation, head to https://nodejs.org/ and follow the installation instructions.
One can start using the generator directly using the node execution wrapper npx:
npx -p yo -p generator-latex-template -c 'yo latex-template'In case one wants to have the generator installed permanently (or npx does work as expected), one can install generator-latex-template using following command:
npm install -g generator-latex-templateThen, one can invoke the generator as follows:
yo latex-templatemain.tex on each run. This will destroy your work.
You can use the magic of git to prevent that:
-
After repository initialization:
git committo save your workgit checkout -b template- to create a branch with initial template (required for updating)git checkout mainswitch back to your thesis
-
Work on the
mainbranch -
In case an update comes in, update the
templatebranchgit checkout template- switch to thetemplatebranchyo latex-template- generate new templategit commit- save the new templategit checkout main- switch to your workgit merge template- merge in the template changes- resolve conflicts ^^ (Hint: IntelliJ Community Edition has a great conflict resolving tool)
- Paper: Oliver Kopp - The LaTeX template generator: How micro-templates reduce template maintenance effort
- Talk: Oliver Kopp - The LaTeX Template Generator - DANTE Herbsttagung 2019 - a talk on the motivation, user experience, and the contribution
- IEEE - example: paper-conference-minted.tex
- LNCS - example: paper.tex
- scientific-thesis-template - example: latexhints-english.tex
- alpenwasser/TeX
See CONTRIBUTING.md for how to contribute and for development hints, including testing and releasing.
The code has the license 0BSD, the snippets (both LaTeX and text) 0BSD, too. See benbalter/talks#15, for the reasoning why we cannot use CC0.
generators/app/templates/IEEEtranN-doi.bstisIEEEtranN.bstfrom the IEEEtran package, modified to output DOIs (IEEEtranN-doi.bst.patch), and is LPPL-licensed.generators/app/templates/splncs04nat.bstcomes from tpavlic/splncs04nat and is MIT-licensed.generators/app/templates/logos/: This directory contains logos, which have special licenses (seelogos/README.md).generators/app/templates/figures/ulm-minster.jpgis Landappbw 79389 1820 Ulmer Münster Ulm.jpg by wkrauth, dedicated to the public domain under CC0 1.0.