Generates latex templates (e.g., for thesis, workshops, conferences, IEEEtran, LNCS, ...) out of "micro-templates"
There are many latex templates out there.
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
and a generation into templates:
--shell-escape
and not.One has to install Node.js version 18 (or later) to get this generator running. For simple installation, just 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-template
Then, one can invoke the generator as follows:
yo latex-template
⚠️ The template generator overwrites main.tex
on each run. This will destroy your work. ⚠️
You can use the magic of git
to prevent that:
After repository initialization:
git commit
to save your workgit checkout -b template
- to create a branch with initial template (required for updating)git checkout main
switch back to your thesisWork on the main
branch
In case an update comes in, update the template
branch
git checkout template
- switch to the template
branchyo latex-template
- generate new templategit commit
- save the new templategit checkout main
- switch to your workgit merge template
- merge in the template changesIn the long run, the contents of the paper.tex
(and similar) files in repositories of the latextemplates organization should be generated automatically.
__tests__/app.js
npx jest
npx npm-update-all
. See FreeCodeCamp for more details.npx npm-check-updates -u
. [Source]package-lock.json
only: npm i --package-lock-only
Cannot find module 'yeoman-generator'
, please update the npm dependencies.
That error occurred when using version 4.13.0
and 5.4.2
was available.chmod g+rwx /root /root/.config /root/.config/configstore
act --rm --platform ubuntu-latest=fwilhe2/act-runner:latest -W .github/workflows/check-ieee-conference-a4-pdflatex-bibtex-2023-true.yml
npx
with --generatereitzig
(in a clean directory)pdflatex
{repository-root}/generate-texlivefile.sh
Texlivefile
to the root of the {repository-root}/generators/app/templates
Texlivefile
as requirednpx yo@v4.3.1 <path-to-git-repository>
npx yo@v4.3.1 c:\git-repositories\latextemplates\generator-latex-template
Parameters can be set using command line
npx yo@v4.3.1 /tmp/repo --documentclass=lncs --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2023 --docker=false --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true
Parameters can be set using command line
npx yo@v4.3.1 c:\git-repositories\latextemplates\generator-latex-template --documentclass=ieee --ieeevariant=conference --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2023 --docker=reitzig --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true
npx yo@v4.3.1 c:\git-repositories\latextemplates\generator-latex-template --documentclass=lncs ---papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2023 --docker=false --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true
npx yo@v4.3.1 c:\git-repositories\latextemplates\generator-latex-template --documentclass=scientific-thesis --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2023 --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true
latexmk
to build the PDF<% if (howtotext) { -%>
<% } else { -%>
<% } -%>
<% switch (documentclass) { case "lncs": -%>
<% break; case "ieee": -%>
<% break; default: -%>
<% break; } -%>
A launch.json
configured for Windows and Visual Studio Code is included.
Just press F5 and the generator should run in debug mode.
ejslint.cmd c:\git-repositories\latextemplates\generator-latex-template\generators\app\templates\main.en.tex
CHANGELOG.md
Update package.json
, publish to npmjs, create GitHub release.
Use release-it (do not create a release on GitHub) and github-release-from-changelog.
npx release-it
npx github-release-from-changelog
The code is licensed 0BSD, the snippets (both LaTeX and text) 0BSD, too. See benbalter/talks#15, for a reasoning, why CC0 cannot be used.
generators/app/templates/splncs04nat.bst
is taken from tpavlic/splncs04nat and is MIT-licensed.