generator-latex-template 2026.10.13 → 2026.10.15
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 +1 -1
- package/generators/app/CLAUDE.md +2 -1
- package/generators/app/index.js +29 -5
- package/generators/app/options.js +4 -0
- package/generators/app/templates/.github/dependabot.yml +3 -0
- package/generators/app/templates/.github/workflows/check.yml +15 -18
- package/generators/app/templates/.vscode/extensions.json +1 -1
- package/generators/app/templates/Makefile +33 -10
- package/generators/app/templates/README.en.md +306 -323
- package/generators/app/templates/Texlivefile +4 -1
- package/generators/app/templates/authorarchive.preamble.en.tex +15 -0
- package/generators/app/templates/dot.aspell.de.pws +3 -1
- package/generators/app/templates/dot.aspell.en.pws +3 -1
- package/generators/app/templates/dot.dockerignore +1 -1
- package/generators/app/templates/dot.gitignore +3 -0
- package/generators/app/templates/dot.textlintrc.json +10 -2
- package/generators/app/templates/embedfile.preamble.en.tex +3 -4
- package/generators/app/templates/font.preamble.en.tex +12 -8
- package/generators/app/templates/latexmkrc +4 -2
- package/generators/app/templates/logos/README.md +10 -0
- package/generators/app/templates/logos/thu-logo.png +0 -0
- package/generators/app/templates/logos/uhh-logo.pdf +0 -0
- package/generators/app/templates/main.de.tex +91 -52
- package/generators/app/templates/main.en.tex +90 -51
- package/generators/app/templates/mwe-main.de.tex +3 -2
- package/generators/app/templates/mwe-main.en.tex +3 -2
- package/generators/app/templates/scientific-thesis-cover.preamble.de.tex +3 -3
- package/generators/app/templates/scientific-thesis-cover.preamble.en.tex +3 -3
- package/generators/app/templates/tables.example.en.tex +19 -0
- package/generators/app/templates/vscode.settings.json +20 -11
- package/generators/app/templates/xcolor.preamble.de.tex +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -243,7 +243,7 @@ The code is licensed [0BSD](https://choosealicense.com/licenses/0bsd/#), the sni
|
|
|
243
243
|
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.
|
|
244
244
|
|
|
245
245
|
- `generators/app/templates/splncs04nat.bst` is taken from [tpavlic/splncs04nat](https://github.com/tpavlic/splncs04nat) and is MIT-licensed.
|
|
246
|
-
- `generators/app/templates/logos/`: This directory contains logos, which have special licenses.
|
|
246
|
+
- `generators/app/templates/logos/`: This directory contains logos, which have special licenses (see [`logos/README.md`](generators/app/templates/logos/README.md)).
|
|
247
247
|
- `generators/app/templates/figures/ulm-minster.jpg` is [Landappbw 79389 1820 Ulmer Münster Ulm.jpg](https://commons.wikimedia.org/w/index.php?curid=131463041) by wkrauth, dedicated to the public domain under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/).
|
|
248
248
|
|
|
249
249
|
[hyperref]: https://ctan.org/pkg/hyperref
|
package/generators/app/CLAUDE.md
CHANGED
|
@@ -29,7 +29,8 @@ the feature vanishes for some switch combination without any error.
|
|
|
29
29
|
3. **`Texlivefile`** — add the TeX Live package name, guarded (usually
|
|
30
30
|
`githubpublish || <condition>`; `githubpublish` deliberately bundles everything).
|
|
31
31
|
4. **Shell-escape is derived, never hardcoded.** It is the boolean
|
|
32
|
-
`requiresShellEscape` in `index.js` (`
|
|
32
|
+
`requiresShellEscape` in `index.js` (`uml == "plantuml"`, and minted only up to TeX Live 2024:
|
|
33
|
+
minted 3 runs `latexminted`, which TeX Live permits in restricted shell escape).
|
|
33
34
|
Extend that expression if the new package needs `\write18`; the `latexmkrc` and the
|
|
34
35
|
`main.*.tex` editor hints read the flag.
|
|
35
36
|
5. **New user switch?** Decide **prompt vs. plain flag** first:
|
package/generators/app/index.js
CHANGED
|
@@ -12,7 +12,11 @@ export default class extends Generator {
|
|
|
12
12
|
this.log(yosay(`Welcome to the ${chalk.red("latex-template")} generator!`));
|
|
13
13
|
|
|
14
14
|
// See "Development hints" in README.md for help on Inquirer.js
|
|
15
|
-
|
|
15
|
+
// yeoman-option-or-prompt mutates the prompts (deletes `when`, replaces `choices`/`default`
|
|
16
|
+
// functions by their result); pass copies so that runs in one process (the tests) stay independent.
|
|
17
|
+
const props = await this._optionOrPrompt(
|
|
18
|
+
options.map((prompt) => ({ ...prompt })),
|
|
19
|
+
);
|
|
16
20
|
|
|
17
21
|
// To access props later use this.props.someAnswer;
|
|
18
22
|
this.props = props;
|
|
@@ -179,10 +183,16 @@ export default class extends Generator {
|
|
|
179
183
|
this.props.Vref = "\\zvref[S]";
|
|
180
184
|
}
|
|
181
185
|
|
|
182
|
-
//
|
|
183
|
-
|
|
186
|
+
// The program that processes the bibliography: biber for biblatex, bibtex otherwise.
|
|
187
|
+
this.props.bibrunner =
|
|
188
|
+
this.props.bibtextool === "biblatex" ? "biber" : "bibtex";
|
|
189
|
+
|
|
190
|
+
// Only the PlantUML UML example needs shell-escape. minted 3 (TeX Live 2025 and later)
|
|
191
|
+
// runs latexminted, which TeX Live permits in restricted shell escape; minted 2
|
|
192
|
+
// (TeX Live 2024) still needs shell-escape.
|
|
184
193
|
this.props.requiresShellEscape =
|
|
185
|
-
this.props.listings == "minted"
|
|
194
|
+
(this.props.listings == "minted" && this.props.texlive < 2025) ||
|
|
195
|
+
this.props.uml == "plantuml";
|
|
186
196
|
|
|
187
197
|
// Two-column layouts (IEEE, and the ACM conference/journal formats) cannot use
|
|
188
198
|
// `longtable` ("longtable not in 1-column mode"), so the longtable example must
|
|
@@ -310,7 +320,7 @@ export default class extends Generator {
|
|
|
310
320
|
);
|
|
311
321
|
this.fs.copyTpl(
|
|
312
322
|
this.templatePath("latexmkrc"),
|
|
313
|
-
this.destinationPath(
|
|
323
|
+
this.destinationPath(".latexmkrc"),
|
|
314
324
|
this.props,
|
|
315
325
|
);
|
|
316
326
|
this.fs.copyTpl(
|
|
@@ -442,6 +452,20 @@ export default class extends Generator {
|
|
|
442
452
|
);
|
|
443
453
|
}
|
|
444
454
|
|
|
455
|
+
if (this.props.documentclass == "scientific-thesis") {
|
|
456
|
+
const logos = {
|
|
457
|
+
"university-of-hamburg": "uhh-logo.pdf",
|
|
458
|
+
thu: "thu-logo.png",
|
|
459
|
+
};
|
|
460
|
+
const logo = logos[this.props.thesisvariant];
|
|
461
|
+
if (logo) {
|
|
462
|
+
this.fs.copy(
|
|
463
|
+
this.templatePath("logos/" + logo),
|
|
464
|
+
this.destinationPath("figures/" + logo),
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
445
469
|
if (this.props.documentclass == "ustutt") {
|
|
446
470
|
/*
|
|
447
471
|
this.props.documentclass = "ustutt-include";
|
|
@@ -16,14 +16,14 @@ jobs:
|
|
|
16
16
|
runs-on: ubuntu-latest
|
|
17
17
|
steps:
|
|
18
18
|
- name: Set up Git repository
|
|
19
|
-
uses: actions/checkout@v7
|
|
19
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
20
|
<% if (uml == "tikz-uml") { -%>
|
|
21
21
|
with:
|
|
22
22
|
# Recursive checkout brings in the tikz-uml submodule used by the UML example.
|
|
23
23
|
submodules: recursive
|
|
24
24
|
<% } -%>
|
|
25
25
|
- name: Install TeX Live
|
|
26
|
-
uses: zauguin/install-texlive@v4
|
|
26
|
+
uses: zauguin/install-texlive@6671d0c62046c7e349fe154d5208fe746b07e037 # v4.4.0
|
|
27
27
|
with:
|
|
28
28
|
package_file: '${{ github.workspace }}/Texlivefile'
|
|
29
29
|
texlive_version: <%= texlive %>
|
|
@@ -37,14 +37,11 @@ jobs:
|
|
|
37
37
|
updmap -sys
|
|
38
38
|
texhash
|
|
39
39
|
tlmgr generate language --rebuild-sys
|
|
40
|
-
if [ ! -f "latexmkrc" ]; then
|
|
41
|
-
cp "_latexmkrc" "latexmkrc"
|
|
42
|
-
fi
|
|
43
40
|
- run: latexmk <%= filenames.main %>
|
|
44
41
|
<% if (githubpublish || (lang == "en") && (reallatexcompiler.startsWith("lualatex"))) { -%>
|
|
45
42
|
|
|
46
43
|
# Highlight mis-spelled words in the PDF
|
|
47
|
-
- uses: awalsh128/cache-apt-pkgs-action@
|
|
44
|
+
- uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
|
|
48
45
|
with:
|
|
49
46
|
packages: aspell aspell-en<% if (githubpublish || (language == 'de')) { %> aspell-de<% } %>
|
|
50
47
|
version: 1.0
|
|
@@ -82,7 +79,7 @@ jobs:
|
|
|
82
79
|
texlogsieve <%= filenames.main %>.log | tee -a "$GITHUB_STEP_SUMMARY" || true
|
|
83
80
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
|
84
81
|
<% } -%>
|
|
85
|
-
- uses: actions/upload-artifact@v7
|
|
82
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
86
83
|
with:
|
|
87
84
|
name: test-result
|
|
88
85
|
path: |
|
|
@@ -93,9 +90,9 @@ jobs:
|
|
|
93
90
|
runs-on: ubuntu-latest
|
|
94
91
|
steps:
|
|
95
92
|
- name: Set up Git repository
|
|
96
|
-
uses: actions/checkout@v7
|
|
93
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
97
94
|
- name: Install TeX Live
|
|
98
|
-
uses: zauguin/install-texlive@v4
|
|
95
|
+
uses: zauguin/install-texlive@6671d0c62046c7e349fe154d5208fe746b07e037 # v4.4.0
|
|
99
96
|
with:
|
|
100
97
|
package_file: '${{ github.workspace }}/Texlivefile'
|
|
101
98
|
texlive_version: <%= texlive %>
|
|
@@ -116,7 +113,7 @@ jobs:
|
|
|
116
113
|
# echo "## TeXcount LaTeX interpretation" >> $GITHUB_STEP_SUMMARY
|
|
117
114
|
# echo "" >> $GITHUB_STEP_SUMMARY
|
|
118
115
|
# cat "texcount.html-body" >> $GITHUB_STEP_SUMMARY
|
|
119
|
-
- uses: actions/upload-artifact@v7
|
|
116
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
120
117
|
with:
|
|
121
118
|
name: word-count
|
|
122
119
|
path: |
|
|
@@ -134,11 +131,11 @@ jobs:
|
|
|
134
131
|
runs-on: ubuntu-latest
|
|
135
132
|
steps:
|
|
136
133
|
- name: Set up Git repository
|
|
137
|
-
uses: actions/checkout@v7
|
|
134
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
138
135
|
|
|
139
136
|
# Original action does not work well - see https://github.com/awalsh128/cache-apt-pkgs-action/pull/136
|
|
140
137
|
# The action is not updated - and thus the dictionaries are not updated
|
|
141
|
-
- uses: awalsh128/cache-apt-pkgs-action@
|
|
138
|
+
- uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
|
|
142
139
|
with:
|
|
143
140
|
packages: aspell aspell-en<% if (githubpublish || (language == 'de')) { %> aspell-de<% } %>
|
|
144
141
|
version: 1.0
|
|
@@ -186,8 +183,8 @@ jobs:
|
|
|
186
183
|
runs-on: ubuntu-latest
|
|
187
184
|
steps:
|
|
188
185
|
- name: Set up Git repository
|
|
189
|
-
uses: actions/checkout@v7
|
|
190
|
-
- uses: actions/setup-node@v7
|
|
186
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
187
|
+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
191
188
|
with:
|
|
192
189
|
node-version: '22'
|
|
193
190
|
- name: Lint English prose with textlint
|
|
@@ -215,17 +212,17 @@ jobs:
|
|
|
215
212
|
runs-on: ubuntu-latest
|
|
216
213
|
steps:
|
|
217
214
|
- name: Set up Git repository
|
|
218
|
-
uses: actions/checkout@v7
|
|
219
|
-
- uses: awalsh128/cache-apt-pkgs-action@
|
|
215
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
216
|
+
- uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
|
|
220
217
|
with:
|
|
221
218
|
packages: libyaml-tiny-perl libfile-homedir-perl
|
|
222
219
|
version: 1.0
|
|
223
220
|
execute_install_scripts: true
|
|
224
221
|
- name: Install latexindent
|
|
225
|
-
uses: zauguin/install-texlive@v4
|
|
222
|
+
uses: zauguin/install-texlive@6671d0c62046c7e349fe154d5208fe746b07e037 # v4.4.0
|
|
226
223
|
with:
|
|
227
224
|
packages: latexindent
|
|
228
225
|
texlive_version: <%= texlive %>
|
|
229
|
-
- run: make format
|
|
226
|
+
- run: make format LOCAL=1
|
|
230
227
|
- name: No changes made by latexindent
|
|
231
228
|
run: git diff --exit-code
|
|
@@ -3,8 +3,25 @@
|
|
|
3
3
|
## Required for thumbpdf as latexmk does not support thumbpdf by itself
|
|
4
4
|
latexcompiler = <%= reallatexcompiler %>
|
|
5
5
|
|
|
6
|
-
##
|
|
7
|
-
|
|
6
|
+
## PDF viewer: Sumatra PDF on Windows (reloads the PDF automatically), the default viewer otherwise
|
|
7
|
+
ifeq ($(OS),Windows_NT)
|
|
8
|
+
viewer = 'C:/Program Files/SumatraPDF/SumatraPDF.exe'
|
|
9
|
+
else ifeq ($(shell uname -s),Darwin)
|
|
10
|
+
viewer = open
|
|
11
|
+
else
|
|
12
|
+
viewer = xdg-open
|
|
13
|
+
endif
|
|
14
|
+
<% if (docker == "iot") { -%>
|
|
15
|
+
|
|
16
|
+
## The LaTeX tools run in the TeX Live Docker image (see README.md); "make LOCAL=1" uses the local LaTeX distribution
|
|
17
|
+
ifeq ($(LOCAL),)
|
|
18
|
+
ifeq ($(OS),Windows_NT)
|
|
19
|
+
RUN = docker run --rm -v "$(CURDIR):/workdir" -w /workdir <%= iotImage %>
|
|
20
|
+
else
|
|
21
|
+
RUN = docker run --rm -u $(shell id -u):$(shell id -g) -e HOME=/tmp -v "$(CURDIR):/workdir" -w /workdir <%= iotImage %>
|
|
22
|
+
endif
|
|
23
|
+
endif
|
|
24
|
+
<% } -%>
|
|
8
25
|
|
|
9
26
|
## Editor
|
|
10
27
|
editor = gedit
|
|
@@ -18,6 +35,8 @@ LITERATURE = <%= filenames.bib %>.bib
|
|
|
18
35
|
## Derived file names
|
|
19
36
|
SRC = $(shell basename $(MASTER_TEX) .tex)
|
|
20
37
|
TEX_FILES = $(wildcard *.tex content/*.tex)
|
|
38
|
+
## All main files, including variants of MASTER_TEX (e.g., other languages): "make format" indents each of them
|
|
39
|
+
MAIN_TEX_FILES = $(wildcard <%= isPaper ? "paper" : ((documentclass == "ustutt") ? "thesis-example" : "main") %>*.tex)
|
|
21
40
|
GFX_FILES = $(wildcard figures/*)
|
|
22
41
|
|
|
23
42
|
PDF = $(SRC).pdf
|
|
@@ -38,16 +57,16 @@ all: $(PDF)
|
|
|
38
57
|
compile: $(PDF)
|
|
39
58
|
|
|
40
59
|
$(PDF): $(MASTER_TEX) $(LITERATURE) $(TEX_FILES) $(GFX_FILES)
|
|
41
|
-
latexmk $(MASTER_TEX)
|
|
60
|
+
$(RUN) latexmk $(MASTER_TEX)
|
|
42
61
|
|
|
43
62
|
clean:
|
|
44
|
-
latexmk -C
|
|
63
|
+
$(RUN) latexmk -C
|
|
45
64
|
|
|
46
65
|
## Endversion - mit eingebauter Seitenvorschau
|
|
47
66
|
## Mehrere Durchlaeufe, da bei longtable einige runs mehr vonnoeten sind...
|
|
48
67
|
final: $(PDF)
|
|
49
|
-
thumbpdf $(PDF)
|
|
50
|
-
$(latexcompiler) $(MASTER_TEX)
|
|
68
|
+
$(RUN) thumbpdf $(PDF)
|
|
69
|
+
$(RUN) $(latexcompiler) $(MASTER_TEX)
|
|
51
70
|
|
|
52
71
|
mrproper: clean
|
|
53
72
|
rm -f *~
|
|
@@ -62,7 +81,7 @@ stand: $(PDF)
|
|
|
62
81
|
|
|
63
82
|
html: clean pdf
|
|
64
83
|
rm $(AUX)
|
|
65
|
-
htlatex $(SRC) "html,word,charset=utf8" " -utf8"
|
|
84
|
+
$(RUN) htlatex $(SRC) "html,word,charset=utf8" " -utf8"
|
|
66
85
|
|
|
67
86
|
|
|
68
87
|
# Tools
|
|
@@ -92,6 +111,10 @@ aspell:
|
|
|
92
111
|
aspell --mode=tex <% if (language == 'de') { %>-l de_DE --run-together<% } else { %>-l en_US<% } %> --encoding=utf-8 --conf=./.aspell.conf -p ./.aspell.en.pws -c $$tex;
|
|
93
112
|
done
|
|
94
113
|
|
|
114
|
+
## Show only the relevant messages of the last LaTeX run
|
|
115
|
+
log:
|
|
116
|
+
$(RUN) texlogsieve --no-heartbeat $(SRC).log
|
|
117
|
+
|
|
95
118
|
showundef:
|
|
96
119
|
grep undefined $(LOG)
|
|
97
120
|
|
|
@@ -99,10 +122,10 @@ showundef:
|
|
|
99
122
|
## Reformatierung
|
|
100
123
|
|
|
101
124
|
format:
|
|
102
|
-
latexindent -l -s -sl -w
|
|
125
|
+
for f in $(MAIN_TEX_FILES); do $(RUN) latexindent -l -s -sl -w "$$f" || exit 1; done
|
|
103
126
|
|
|
104
127
|
indent:
|
|
105
|
-
latexindent -y="indentPreamble:1,defaultIndent:' '" -m -w $(SRC)
|
|
128
|
+
$(RUN) latexindent -y="indentPreamble:1,defaultIndent:' '" -m -w $(SRC)
|
|
106
129
|
|
|
107
130
|
split-sentences:
|
|
108
|
-
latexindent -m -l -s -sl -w $(SRC)
|
|
131
|
+
$(RUN) latexindent -m -l -s -sl -w $(SRC)
|