generator-latex-template 0.7.0 → 2025.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -31
- package/generators/app/index.js +273 -574
- package/generators/app/options.js +396 -0
- package/generators/app/templates/.github/workflows/check.yml +18 -30
- package/generators/app/templates/Dockerfile.dante +3 -1
- package/generators/app/templates/Dockerfile.iot +6 -0
- package/generators/app/templates/Dockerfile.reitzig +17 -24
- package/generators/app/templates/README.de.md +4 -0
- package/generators/app/templates/README.en.md +80 -33
- package/generators/app/templates/Texlivefile +198 -32
- package/generators/app/templates/{acronyms.de.tex → abbreviations.de.tex} +4 -0
- package/generators/app/templates/{acronyms.en.tex → abbreviations.en.tex} +6 -0
- package/generators/app/templates/{acronyms.example.de.tex → abbreviations.example.de.tex} +1 -1
- package/generators/app/templates/{acronyms.example.en.tex → abbreviations.example.en.tex} +2 -0
- package/generators/app/templates/abbreviations.preamble.de.tex +4 -0
- package/generators/app/templates/{acronyms.preamble.en.tex → abbreviations.preamble.en.tex} +4 -2
- package/generators/app/templates/algorithms.preamble.en.tex +12 -0
- package/generators/app/templates/babel.preamble.de.tex +8 -21
- package/generators/app/templates/babel.preamble.en.tex +1 -23
- package/generators/app/templates/biblatex.preamble.de.tex +1 -1
- package/generators/app/templates/biblatex.preamble.en.tex +7 -2
- package/generators/app/templates/booktabs.preamble.de.tex +5 -0
- package/generators/app/templates/csquotes.example.de.tex +1 -1
- package/generators/app/templates/csquotes.example.en.tex +1 -1
- package/generators/app/templates/csquotes.preamble.en.tex +6 -1
- package/generators/app/templates/dot.dockerignore +5 -3
- package/generators/app/templates/dot.gitignore +512 -427
- package/generators/app/templates/floatflt.example.en.tex +1 -1
- package/generators/app/templates/floatflt.preamble.en.tex +17 -0
- package/generators/app/templates/floats.example.de.tex +31 -0
- package/generators/app/templates/{figure.example.en.tex → floats.example.en.tex} +1 -1
- package/generators/app/templates/floats.preamble.en.tex +71 -0
- package/generators/app/templates/font.preamble.en.tex +187 -25
- package/generators/app/templates/footnotes.preamble.en.tex +52 -0
- package/generators/app/templates/hyperref.preamble.de.tex +1 -14
- package/generators/app/templates/hyperref.preamble.en.tex +39 -3
- package/generators/app/templates/hyphenation.example.en.tex +1 -1
- package/generators/app/templates/latexmkrc +1 -3
- package/generators/app/templates/listings.preamble.de.tex +38 -3
- package/generators/app/templates/listings.preamble.en.tex +33 -2
- package/generators/app/templates/logos/README.md +11 -0
- package/generators/app/templates/logos/ustutt-logo.pdf +0 -0
- package/generators/app/templates/main.de.tex +860 -168
- package/generators/app/templates/main.en.tex +310 -85
- package/generators/app/templates/math.preamble.en.tex +55 -0
- package/generators/app/templates/microtype.preamble.de.tex +5 -0
- package/generators/app/templates/minted.preamble.en.tex +8 -2
- package/generators/app/templates/natbib.preamble.en.tex +3 -3
- package/generators/app/templates/siunitx.example.en.tex +1 -1
- package/generators/app/templates/siunitx.preamble.de.tex +2 -0
- package/generators/app/templates/siunitx.preamble.en.tex +0 -1
- package/generators/app/templates/{subfloat.example.en.tex → subfig.example.en.tex} +1 -0
- package/generators/app/templates/subfig.preamble.en.tex +9 -1
- package/generators/app/templates/tables.preamble.de.tex +31 -0
- package/generators/app/templates/thesis-additions.en.tex +136 -0
- package/generators/app/templates/thesis-additions.examples.en.tex +132 -0
- package/generators/app/templates/todos.example.en.tex +35 -0
- package/generators/app/templates/todos.preamble.en.tex +63 -0
- package/generators/app/templates/url.preamble.de.tex +2 -0
- package/generators/app/templates/ustutt-chapterstyle.preamble.en.tex +28 -0
- package/generators/app/templates/ustutt-pagestyle.preamble.en.tex +30 -0
- package/generators/app/templates/ustutt-titlepage.sty +97 -0
- package/generators/app/templates/ustutt-todo.tex +24 -0
- package/generators/app/templates/varioref.example.en.tex +12 -0
- package/generators/app/templates/varioref.preamble.de.tex +3 -0
- package/generators/app/templates/varioref.preamble.en.tex +3 -0
- package/generators/app/templates/xcolor.preamble.de.tex +12 -0
- package/package.json +17 -17
- package/generators/app/templates/figure.example.de.tex +0 -13
- package/generators/app/templates/pdfcomment.preamble.en.tex +0 -11
- package/generators/app/templates/plainlatextodo.preamble.en.tex +0 -8
- package/generators/app/templates/refcheck.example.en.tex +0 -36
- package/generators/app/templates/refcheck.preamble.en.tex +0 -4
package/README.md
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
> Generates latex templates (e.g., for thesis, workshops, conferences, IEEEtran, LNCS, ...) out of "micro-templates"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Talks and papers
|
|
6
|
+
|
|
7
|
+
- Paper: [Oliver Kopp - The LaTeX template generator: How micro-templates reduce template maintenance effort](https://tug.org/TUGboat/tb44-2/tb137kopp-microtemplates.html)
|
|
8
|
+
- Talk: [Oliver Kopp - The LaTeX Template Generator - DANTE Herbsttagung 2019](https://github.com/dante-ev/Vortraege_Tagungen/blob/master/2019-Herbst/Oliver%20Kopp%20-%20The%20LaTeX%20Template%20Generator%20-%20dante2019-herbst.pdf) - a talk on the motivation, user experience, and the contribution
|
|
6
9
|
|
|
7
10
|
## Background information
|
|
8
11
|
|
|
@@ -23,32 +26,28 @@ and a generation into templates:
|
|
|
23
26
|
2. Support for separate documents which require `--shell-escape` and not.
|
|
24
27
|
3. Support for integrated pdflatex and lualatex documents
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- [Oliver Kopp - The LaTeX Template Generator](https://github.com/dante-ev/Vortraege_Tagungen/blob/master/2019-Herbst/Oliver%20Kopp%20-%20The%20LaTeX%20Template%20Generator%20-%20dante2019-herbst.pdf) - a talk on the motivation, user experience, and the contribution
|
|
29
|
+
### Precondition for the generator
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
One has to install [Node.js](https://nodejs.org/en/) version 18 (or later) to get this generator running.
|
|
32
|
+
For simple installation, just head to <https://nodejs.org/> and follow the installation instructions.
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
On Windows, one can just run `choco install nodejs-lts` to get the right version of Node.js.
|
|
34
|
+
### Using the generator
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
One can start using the generator directly using the node execution wrapper [npx](https://www.npmjs.com/package/npx):
|
|
36
37
|
|
|
37
38
|
```bash
|
|
38
39
|
npx -p yo -p generator-latex-template -c 'yo latex-template'
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
###
|
|
42
|
+
### Permanent installation (and simpler command line usage)
|
|
42
43
|
|
|
43
|
-
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:
|
|
44
|
+
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:
|
|
44
45
|
|
|
45
46
|
```bash
|
|
46
47
|
npm install -g generator-latex-template
|
|
47
48
|
```
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
One can run the generator by invoking this command on a command prompt:
|
|
50
|
+
Then, one can invoke the generator as follows:
|
|
52
51
|
|
|
53
52
|
```bash
|
|
54
53
|
yo latex-template
|
|
@@ -98,36 +97,81 @@ In the long run, the contents of the `paper.tex` (and similar) files in reposito
|
|
|
98
97
|
- Templating language: <https://ejs.co/>
|
|
99
98
|
- Conditional questions: <https://stackoverflow.com/a/18706640/873282>.
|
|
100
99
|
- Types of prompts: <https://github.com/SBoudrias/Inquirer.js#prompt-types>
|
|
101
|
-
- E.g
|
|
100
|
+
- E.g., [Question](https://github.com/SBoudrias/Inquirer.js#question)
|
|
102
101
|
- Add a new question
|
|
103
102
|
- Also adapt `__tests__/app.js`
|
|
104
103
|
- Execute tests with `npx jest`
|
|
105
|
-
-
|
|
106
|
-
- Create empty directory ("target directory")
|
|
107
|
-
- Change to the target directory
|
|
108
|
-
- Run `npx yo <path-to-git-repository>`
|
|
109
|
-
- Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template`
|
|
110
|
-
- Parameters can be set using command line
|
|
111
|
-
- Linux: `npx yo /tmp/repo --documentclass=lncs --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2022 --docker=false --language=en --font=default --listings=listings --enquotes=csquotes --tweak_outerquote=babel --todo=pdfcomment --examples=true --howtotext=true`
|
|
112
|
-
- Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template --documentclass=scientific-thesis --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2022 --language=en --font=default --listings=listings --enquotes=csquotes --tweak_outerquote=babel --todo=pdfcomment --examples=true --howtotext=true`
|
|
113
|
-
- Windows automatic generation of a LNCS template (with pdflatex and bibtex): `npx yo c:\git-repositories\latextemplates\generator-latex-template --documentclass=lncs ---papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2022 --docker=false --language=en --font=default --listings=listings --enquotes=csquotes --tweak_outerquote=babel --todo=pdfcomment --examples=true --howtotext=true`
|
|
114
|
-
- Run `latexmk` to build the PDF
|
|
115
|
-
- Update npm dependencies
|
|
104
|
+
- Update NPM dependencies
|
|
116
105
|
- `npx npm-update-all`. See [FreeCodeCamp](https://www.freecodecamp.org/news/10-npm-tricks-that-will-make-you-a-pro-a945982afb25/) for more details.
|
|
117
106
|
- `npx npm-check-updates -u`. [[Source](https://www.carlrippon.com/upgrading-npm-dependencies/)]
|
|
118
107
|
- See <https://github.com/yeoman/generator/releases> for changes in the generator.
|
|
108
|
+
- Generate `package-lock.json` only: `npm i --package-lock-only`
|
|
119
109
|
- When one encounters `Cannot find module 'yeoman-generator'`, please update the npm dependencies.
|
|
120
110
|
That error occurred when using version `4.13.0` and `5.4.2` was available.
|
|
121
111
|
- In case of the error "Error: EACCES, permission denied '/root/.config/configstore/insight-yo.json'", one needs to execute `chmod g+rwx /root /root/.config /root/.config/configstore`
|
|
122
112
|
- Check GitHub actions
|
|
123
113
|
- Use [actionlint](https://github.com/rhysd/actionlint#readme)
|
|
124
114
|
- Use [vs.code GitHub actions plugin](https://marketplace.visualstudio.com/items?itemName=cschleiden.vscode-github-actions)
|
|
125
|
-
-
|
|
126
|
-
|
|
115
|
+
- Use [act](https://github.com/nektos/act) for checking: `act --rm --platform ubuntu-latest=fwilhe2/act-runner:latest -W .github/workflows/check-ieee-conference-a4-pdflatex-bibtex-2023-true.yml`
|
|
116
|
+
- When adding a new package use `DEPP` (see above) or execute following steps:
|
|
117
|
+
1. execute `npx` with `--generatereitzig` (in a clean directory)
|
|
127
118
|
2. run `pdflatex`
|
|
128
|
-
3. run
|
|
129
|
-
4. copy `Texlivefile` to the root of the
|
|
119
|
+
3. run `{repository-root}/generate-texlivefile.sh`
|
|
120
|
+
4. copy `Texlivefile` to the root of the `{repository-root}/generators/app/templates`
|
|
130
121
|
5. adapt `Texlivefile` as required
|
|
122
|
+
- When issues with the template occur: `npx ejs-lint main.en.tex`
|
|
123
|
+
- Cancel workflows:
|
|
124
|
+
- `gh run list -L 100 --json databaseId -s queued -R latextemplates/generator-latex-template | jq -r '.[] | .databaseId' | awk '{gsub(/\\r\\n/,RS)} 1' | while read -r run_id; do gh run cancel "$run_id" || true; done`
|
|
125
|
+
- `gh run list -L 100 --json databaseId -s in_progress -R latextemplates/generator-latex-template | jq -r '.[] | .databaseId' | awk '{gsub(/\\r\\n/,RS)} 1' | while read -r run_id; do gh run cancel "$run_id" || true; done`
|
|
126
|
+
- Update submodule of "derived" templates (LNCS, ...): `[ -z "$(git status --porcelain)" ] && cd generator-latex-template/ && git pull && cd .. && git add . && git commit -m"Update LTG" && git pull --rebase && git push`
|
|
127
|
+
|
|
128
|
+
### Test locally
|
|
129
|
+
|
|
130
|
+
- Create empty directory ("target directory")
|
|
131
|
+
- Change to the target directory
|
|
132
|
+
- Run `npx yo <path-to-git-repository>/generators/app/index.js`. Background: Starting from 5.0.0 on, [one needs to specify the full path to index.js](https://github.com/yeoman/yo/issues/797#issuecomment-2541794625).
|
|
133
|
+
- Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template\generators\app\index.js`
|
|
134
|
+
|
|
135
|
+
#### Linux
|
|
136
|
+
|
|
137
|
+
Parameters can be set using command line
|
|
138
|
+
|
|
139
|
+
- lncs: `npx yo /tmp/repo/generators/app/index.js --documentclass=lncs --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --texlive=2024 --docker=false --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true`
|
|
140
|
+
|
|
141
|
+
#### Windows
|
|
142
|
+
|
|
143
|
+
Parameters can be set using command line
|
|
144
|
+
|
|
145
|
+
- IEEE template (with pdflatex and bibtex): `npx yo c:\git-repositories\latextemplates\generator-latex-template\generators\app\index.js --overleaf=false --documentclass=ieee --ieeevariant=conference --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --texlive=2024 --docker=reitzig --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true`
|
|
146
|
+
- LNCS template (with pdflatex and bibtex): `npx yo c:\git-repositories\latextemplates\generator-latex-template\generators\app\index.js --overleaf=false --documentclass=lncs ---papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --texlive=2024 --docker=false --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true`
|
|
147
|
+
- Scientific Thesis template: `npx yo c:\git-repositories\latextemplates\generator-latex-template\generators\app\index.js --overleaf=false --documentclass=scientific-thesis --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --texlive=2024 --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true`
|
|
148
|
+
- USTUTT template: `npx yo c:\git-repositories\latextemplates\generator-latex-template\generators\app\index.js --overleaf=false --documentclass=ustutt --papersize=a5 --latexcompiler=lualatex --bibtextool=biblatex --texlive=2024 --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=todonotes --examples=true --howtotext=true` -- `todonotes` is the preferred TODO package here.
|
|
149
|
+
|
|
150
|
+
<!-- markdownlint-disable-next-line MD004 -->
|
|
151
|
+
* Run `latexmk` to build the PDF
|
|
152
|
+
|
|
153
|
+
##### Using DEPP
|
|
154
|
+
|
|
155
|
+
To fire up a TeX Live installation and use the [Dependency Printer for TeX Live](https://gitlab.com/islandoftex/texmf/depp) to refine `Texlivefile`, execute following steps:
|
|
156
|
+
|
|
157
|
+
```cmd
|
|
158
|
+
docker run -it --rm -v c:\temp\ltg:/ltg registry.gitlab.com/islandoftex/images/texlive:latest
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
cd /tmp
|
|
163
|
+
git clone https://gitlab.com/islandoftex/texmf/depp.git
|
|
164
|
+
cd depp
|
|
165
|
+
l3build install
|
|
166
|
+
cd /ltg
|
|
167
|
+
# edit paper.tex and add `\RequirePackage[dependency-file=Texlivefile]{depp}`
|
|
168
|
+
lualatex/pdflatex paper
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
##### Running reitzig
|
|
172
|
+
|
|
173
|
+
1. `docker build --progress=plain -t reitzig -f Dockerfile .`
|
|
174
|
+
2. `docker run -it --rm -v c:\temp\ltg:/work/src -v c:\temp\ltg-out:/work/out reitzig work latexmk`
|
|
131
175
|
|
|
132
176
|
### Useful snippets
|
|
133
177
|
|
|
@@ -155,7 +199,7 @@ ejslint.cmd c:\git-repositories\latextemplates\generator-latex-template\generato
|
|
|
155
199
|
|
|
156
200
|
### Releasing a new version
|
|
157
201
|
|
|
158
|
-
1. Update `CHANGELOG.md`
|
|
202
|
+
1. Update `CHANGELOG.md` (change `h2` heading etc.)
|
|
159
203
|
2. Update `package.json`, publish to [npmjs](https://www.npmjs.com/package/generator-latex-template), create GitHub release.
|
|
160
204
|
Use [release-it](https://www.npmjs.com/package/release-it) (do not create a release on GitHub) and [github-release-from-changelog](https://www.npmjs.com/package/github-release-from-changelog).
|
|
161
205
|
|
|
@@ -167,7 +211,8 @@ ejslint.cmd c:\git-repositories\latextemplates\generator-latex-template\generato
|
|
|
167
211
|
The code is licensed [0BSD](https://choosealicense.com/licenses/0bsd/#), the snippets (both LaTeX and text) 0BSD, too.
|
|
168
212
|
See [benbalter/talks#15](https://github.com/benbalter/talks/issues/15#issuecomment-599704662), for a reasoning, why [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/) cannot be used.
|
|
169
213
|
|
|
170
|
-
`generators/app/templates/splncs04nat.bst` is taken from [tpavlic/splncs04nat](https://github.com/tpavlic/splncs04nat) and is MIT-licensed.
|
|
214
|
+
- `generators/app/templates/splncs04nat.bst` is taken from [tpavlic/splncs04nat](https://github.com/tpavlic/splncs04nat) and is MIT-licensed.
|
|
215
|
+
- `generators/app/templates/logos/`: This directory contains logos, which have special licenses.
|
|
171
216
|
|
|
172
217
|
[hyperref]: https://ctan.org/pkg/hyperref
|
|
173
218
|
[listings]: https://ctan.org/pkg/listings
|