generator-latex-template 0.8.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.
Files changed (61) hide show
  1. package/README.md +63 -20
  2. package/generators/app/index.js +96 -51
  3. package/generators/app/options.js +50 -29
  4. package/generators/app/templates/.github/workflows/check.yml +18 -30
  5. package/generators/app/templates/Dockerfile.iot +2 -10
  6. package/generators/app/templates/Dockerfile.reitzig +12 -20
  7. package/generators/app/templates/README.de.md +4 -0
  8. package/generators/app/templates/README.en.md +76 -23
  9. package/generators/app/templates/Texlivefile +180 -39
  10. package/generators/app/templates/{acronyms.de.tex → abbreviations.de.tex} +4 -0
  11. package/generators/app/templates/{acronyms.en.tex → abbreviations.en.tex} +6 -0
  12. package/generators/app/templates/{acronyms.example.de.tex → abbreviations.example.de.tex} +1 -1
  13. package/generators/app/templates/{acronyms.example.en.tex → abbreviations.example.en.tex} +2 -0
  14. package/generators/app/templates/abbreviations.preamble.de.tex +4 -0
  15. package/generators/app/templates/{acronyms.preamble.en.tex → abbreviations.preamble.en.tex} +4 -2
  16. package/generators/app/templates/algorithms.preamble.en.tex +12 -0
  17. package/generators/app/templates/babel.preamble.de.tex +5 -20
  18. package/generators/app/templates/babel.preamble.en.tex +0 -22
  19. package/generators/app/templates/biblatex.preamble.de.tex +1 -1
  20. package/generators/app/templates/biblatex.preamble.en.tex +7 -2
  21. package/generators/app/templates/booktabs.preamble.de.tex +5 -0
  22. package/generators/app/templates/csquotes.preamble.en.tex +5 -0
  23. package/generators/app/templates/dot.dockerignore +5 -3
  24. package/generators/app/templates/dot.gitignore +512 -427
  25. package/generators/app/templates/floatflt.example.en.tex +1 -1
  26. package/generators/app/templates/floatflt.preamble.en.tex +17 -0
  27. package/generators/app/templates/{figure.example.de.tex → floats.example.de.tex} +1 -1
  28. package/generators/app/templates/{figure.example.en.tex → floats.example.en.tex} +1 -1
  29. package/generators/app/templates/floats.preamble.en.tex +71 -0
  30. package/generators/app/templates/font.preamble.en.tex +187 -25
  31. package/generators/app/templates/footnotes.preamble.en.tex +52 -0
  32. package/generators/app/templates/hyperref.preamble.de.tex +1 -14
  33. package/generators/app/templates/hyperref.preamble.en.tex +39 -3
  34. package/generators/app/templates/latexmkrc +1 -1
  35. package/generators/app/templates/listings.preamble.de.tex +38 -3
  36. package/generators/app/templates/listings.preamble.en.tex +33 -2
  37. package/generators/app/templates/logos/README.md +11 -0
  38. package/generators/app/templates/logos/ustutt-logo.pdf +0 -0
  39. package/generators/app/templates/main.de.tex +313 -63
  40. package/generators/app/templates/main.en.tex +301 -70
  41. package/generators/app/templates/math.preamble.en.tex +55 -0
  42. package/generators/app/templates/minted.preamble.en.tex +8 -2
  43. package/generators/app/templates/natbib.preamble.en.tex +2 -2
  44. package/generators/app/templates/{subfloat.example.en.tex → subfig.example.en.tex} +1 -0
  45. package/generators/app/templates/subfig.preamble.en.tex +8 -0
  46. package/generators/app/templates/tables.preamble.de.tex +31 -0
  47. package/generators/app/templates/thesis-additions.en.tex +136 -0
  48. package/generators/app/templates/thesis-additions.examples.en.tex +132 -0
  49. package/generators/app/templates/todos.example.en.tex +35 -0
  50. package/generators/app/templates/todos.preamble.en.tex +63 -0
  51. package/generators/app/templates/ustutt-chapterstyle.preamble.en.tex +28 -0
  52. package/generators/app/templates/ustutt-pagestyle.preamble.en.tex +30 -0
  53. package/generators/app/templates/ustutt-titlepage.sty +97 -0
  54. package/generators/app/templates/ustutt-todo.tex +24 -0
  55. package/generators/app/templates/varioref.example.en.tex +12 -0
  56. package/generators/app/templates/varioref.preamble.de.tex +3 -0
  57. package/generators/app/templates/varioref.preamble.en.tex +3 -0
  58. package/generators/app/templates/xcolor.preamble.de.tex +12 -0
  59. package/package.json +12 -11
  60. package/generators/app/templates/pdfcomment.preamble.en.tex +0 -11
  61. package/generators/app/templates/plainlatextodo.preamble.en.tex +0 -8
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
- See the **[talk about the generator](https://github.com/dante-ev/Vortraege_Tagungen/blob/master/2019-Herbst/Oliver%20Kopp%20-%20The%20LaTeX%20Template%20Generator%20-%20dante2019-herbst.pdf)** for an overview on the aims and the general concept.
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,11 +26,6 @@ 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
- ## Talks
27
-
28
- - [Oliver Kopp - The LaTeX Template Generator - TUG 2023](https://tug.org/tug2023/program.html) - first international presentation of the generator
29
- - [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
30
-
31
29
  ### Precondition for the generator
32
30
 
33
31
  One has to install [Node.js](https://nodejs.org/en/) version 18 (or later) to get this generator running.
@@ -103,17 +101,7 @@ In the long run, the contents of the `paper.tex` (and similar) files in reposito
103
101
  - Add a new question
104
102
  - Also adapt `__tests__/app.js`
105
103
  - Execute tests with `npx jest`
106
- - Test locally
107
- - Create empty directory ("target directory")
108
- - Change to the target directory
109
- - Run `npx yo <path-to-git-repository>`
110
- - Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template`
111
- - Parameters can be set using command line
112
- - Linux: `npx yo /tmp/repo --documentclass=lncs --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2022 --docker=false --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true`
113
- - Windows: `npx yo c:\git-repositories\latextemplates\generator-latex-template --documentclass=scientific-thesis --papersize=a4 --latexcompiler=pdflatex --bibtextool=bibtex --overleaf=false --texlive=2022 --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true`
114
- - 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 --lang=en --font=default --listings=listings --enquotes=csquotes --tweakouterquote=babel --todo=pdfcomment --examples=true --howtotext=true`
115
- - Run `latexmk` to build the PDF
116
- - Update npm dependencies
104
+ - Update NPM dependencies
117
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.
118
106
  - `npx npm-check-updates -u`. [[Source](https://www.carlrippon.com/upgrading-npm-dependencies/)]
119
107
  - See <https://github.com/yeoman/generator/releases> for changes in the generator.
@@ -124,12 +112,66 @@ In the long run, the contents of the `paper.tex` (and similar) files in reposito
124
112
  - Check GitHub actions
125
113
  - Use [actionlint](https://github.com/rhysd/actionlint#readme)
126
114
  - Use [vs.code GitHub actions plugin](https://marketplace.visualstudio.com/items?itemName=cschleiden.vscode-github-actions)
127
- - When adding a new package:
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:
128
117
  1. execute `npx` with `--generatereitzig` (in a clean directory)
129
118
  2. run `pdflatex`
130
119
  3. run `{repository-root}/generate-texlivefile.sh`
131
120
  4. copy `Texlivefile` to the root of the `{repository-root}/generators/app/templates`
132
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`
133
175
 
134
176
  ### Useful snippets
135
177
 
@@ -157,7 +199,7 @@ ejslint.cmd c:\git-repositories\latextemplates\generator-latex-template\generato
157
199
 
158
200
  ### Releasing a new version
159
201
 
160
- 1. Update `CHANGELOG.md`
202
+ 1. Update `CHANGELOG.md` (change `h2` heading etc.)
161
203
  2. Update `package.json`, publish to [npmjs](https://www.npmjs.com/package/generator-latex-template), create GitHub release.
162
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).
163
205
 
@@ -169,7 +211,8 @@ ejslint.cmd c:\git-repositories\latextemplates\generator-latex-template\generato
169
211
  The code is licensed [0BSD](https://choosealicense.com/licenses/0bsd/#), the snippets (both LaTeX and text) 0BSD, too.
170
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.
171
213
 
172
- `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.
173
216
 
174
217
  [hyperref]: https://ctan.org/pkg/hyperref
175
218
  [listings]: https://ctan.org/pkg/listings
@@ -43,6 +43,16 @@ export default class extends Generator {
43
43
  this.props.font = "default";
44
44
  }
45
45
 
46
+ if (this.props.documentclass === "scientific-thesis") {
47
+ this.props.bibtextool = "biblatex";
48
+ this.props.font = "times";
49
+ }
50
+
51
+ if (this.props.documentclass === "ustutt") {
52
+ this.props.bibtextool = "biblatex";
53
+ this.props.font = "default";
54
+ }
55
+
46
56
  // --language does not work properly, therefore, we used "lang" above. The templates still use "language"
47
57
  this.props.language = this.props.lang;
48
58
 
@@ -51,11 +61,15 @@ export default class extends Generator {
51
61
  this.props.ieeecompsoc = false;
52
62
 
53
63
  // As of 2021-12-24 the IEEE setup does not work on TeXLive 2021 and lualatex
54
- if (this.props.documentclass === "ieee") {
55
- this.props.latexcompiler = "pdflatex";
56
- }
64
+ //if (this.props.documentclass === "ieee") {
65
+ //this.props.latexcompiler = "pdflatex";
66
+ //}
67
+
68
+ this.props.reallatexcompiler = (this.options.latexcompiler == "both") ? "lualatex" : this.options.latexcompiler;
57
69
 
58
70
  // Convert "String" Boolean command line options
71
+ this.props.acmreview =
72
+ this.props.acmreview === true || this.props.acmreview === "true";
59
73
  this.props.examples =
60
74
  this.props.examples === true || this.props.examples === "true";
61
75
  this.props.howtotext =
@@ -87,16 +101,21 @@ export default class extends Generator {
87
101
  this.props.equote = "\"'";
88
102
  }
89
103
 
90
- this.props.requiresShellEscape = this.props.listings === "minted";
104
+ this.props.requiresShellEscape = this.props.isThesis || this.props.listings == "minted";
105
+
106
+ if (this.props.docker == "no") {
107
+ // converts command-line "no" to the boolean equivalent
108
+ this.props.docker = false;
109
+ }
91
110
 
92
- createFeatures(props);
93
111
  isPaperHandling(props);
112
+ createFeatures(props);
94
113
  createHeadingCommands(props);
95
114
  createAvailable(props);
96
115
 
97
116
  function createFeatures(props) {
98
117
  props.feature = {};
99
- props.feature.acronyms = props.documentclass === "scientific-thesis";
118
+ props.feature.abbreviations = props.isThesis;
100
119
  }
101
120
 
102
121
  function isPaperHandling(props) {
@@ -104,24 +123,33 @@ export default class extends Generator {
104
123
  props.documentclass === "acmart" ||
105
124
  props.documentclass === "ieee" ||
106
125
  props.documentclass === "lncs";
126
+ // else it is a thesis (ustutt or scientific-thesis) (see below)
127
+
107
128
  if (props.isPaper) {
108
129
  // This sets filenames.main and filenames.bib
109
130
  props.filenames = {
110
131
  main: "paper",
111
132
  bib: "paper",
112
133
  };
134
+ } else if (props.documentclass == "ustutt") {
135
+ props.filenames = {
136
+ "main": "thesis-example",
137
+ "bib": "bibliography"
138
+ }
113
139
  } else {
114
140
  props.filenames = {
115
141
  main: "main",
116
142
  bib: "bibliography",
117
143
  };
118
144
  }
145
+ props.isThesis = !props.isPaper;
119
146
  }
120
147
 
121
148
  function createHeadingCommands(props) {
122
- if (props.documentclass === "scientific-thesis") {
149
+ if (props.isThesis) {
123
150
  props.heading1 = "\\chapter";
124
151
  props.heading2 = "\\section";
152
+ props.heading3 = "\\subsection";
125
153
  } else {
126
154
  props.heading1 = "\\section";
127
155
  props.heading2 = "\\subsection";
@@ -148,11 +176,12 @@ export default class extends Generator {
148
176
 
149
177
  writing() {
150
178
  this.props.config = this.props;
151
- this.fs.copy(
179
+ this.fs.copyTpl(
152
180
  // .gitignore is not uploaded by npm publish
153
181
  // Thus, we prefix it with `dot`.
154
182
  this.templatePath("dot.gitignore"),
155
- this.destinationPath(".gitignore")
183
+ this.destinationPath(".gitignore"),
184
+ this.props
156
185
  );
157
186
  this.fs.copyTpl(
158
187
  this.templatePath("dot.editorconfig"),
@@ -191,53 +220,69 @@ export default class extends Generator {
191
220
  );
192
221
  }
193
222
 
194
- if (this.props.language === "de") {
223
+ if ((this.props.language === "de") && (!this.props.githubpublish)) {
195
224
  this.fs.copyTpl(
196
- this.templatePath("main.de.tex"),
197
- this.destinationPath(this.props.filenames.main + ".tex"),
225
+ this.templatePath("README.de.md"),
226
+ this.destinationPath("README.md"),
198
227
  this.props
199
228
  );
200
- if (this.props.documentclass === "scientific-thesis") {
201
- this.fs.copy(
202
- this.templatePath("acronyms.de.tex"),
203
- this.destinationPath("acronyms.tex")
204
- );
205
- }
206
-
207
- if (!this.props.githubpublish) {
208
- // We keep the English README.md in case of GitHub publish
209
- this.fs.copyTpl(
210
- this.templatePath("README.de.md"),
211
- this.destinationPath("README.md"),
212
- this.props
213
- );
214
- }
215
229
  } else {
230
+ // We keep the English README.md in case of GitHub publish
216
231
  this.fs.copyTpl(
217
- this.templatePath("main.en.tex"),
218
- this.destinationPath(this.props.filenames.main + ".tex"),
232
+ this.templatePath("README.en.md"),
233
+ this.destinationPath("README.md"),
219
234
  this.props
220
235
  );
221
- if (this.props.documentclass === "scientific-thesis") {
222
- this.fs.copy(
223
- this.templatePath("acronyms.en.tex"),
224
- this.destinationPath("acronyms.tex")
225
- );
226
- }
236
+ }
237
+
238
+ this.fs.copyTpl(
239
+ this.templatePath('main.' + this.props.language + '.tex'),
240
+ this.destinationPath(this.props.filenames.main + ".tex"),
241
+ this.props
242
+ );
227
243
 
244
+ if (this.props.feature.abbreviations) {
245
+ this.fs.copy(
246
+ this.templatePath("abbreviations." + this.props.language + ".tex"),
247
+ this.destinationPath("abbreviations.tex"),
248
+ );
249
+ }
250
+
251
+ if (this.props.documentclass == "ustutt") {
252
+ /*
253
+ this.props.documentclass = "ustutt-include";
228
254
  this.fs.copyTpl(
229
- this.templatePath("README.en.md"),
230
- this.destinationPath("README.md"),
231
- this.props
255
+ this.templatePath("main." + this.props.language + ".tex"),
256
+ this.destinationPath("shared/template.tex"),
257
+ this.props,
258
+ );
259
+ */
260
+ this.fs.copy(
261
+ this.templatePath("ustutt-titlepage.sty"),
262
+ this.destinationPath("ustutt-titlepage.sty"),
263
+ this.props,
264
+ );
265
+ this.fs.copy(
266
+ this.templatePath("logos/ustutt-logo.pdf"),
267
+ this.destinationPath("ustutt-logo.pdf"),
268
+ this.props,
232
269
  );
233
270
  }
234
271
 
235
272
  // eslint-disable-next-line default-case
236
273
  switch (this.props.docker) {
274
+ case false:
275
+ this.fs.copyTpl(
276
+ this.templatePath("Texlivefile"),
277
+ this.destinationPath("Texlivefile"),
278
+ this.props
279
+ );
280
+ break;
237
281
  case "iot":
238
- this.fs.copy(
282
+ this.fs.copyTpl(
239
283
  this.templatePath("dot.dockerignore"),
240
- this.destinationPath(".dockerignore")
284
+ this.destinationPath(".dockerignore"),
285
+ this.props
241
286
  );
242
287
  this.fs.copyTpl(
243
288
  this.templatePath("Dockerfile.iot"),
@@ -251,9 +296,10 @@ export default class extends Generator {
251
296
  );
252
297
  break;
253
298
  case "reitzig":
254
- this.fs.copy(
299
+ this.fs.copyTpl(
255
300
  this.templatePath("dot.dockerignore"),
256
- this.destinationPath(".dockerignore")
301
+ this.destinationPath(".dockerignore"),
302
+ this.props
257
303
  );
258
304
  this.fs.copyTpl(
259
305
  this.templatePath("Dockerfile.reitzig"),
@@ -267,9 +313,10 @@ export default class extends Generator {
267
313
  );
268
314
  break;
269
315
  case "dante":
270
- this.fs.copy(
316
+ this.fs.copyTpl(
271
317
  this.templatePath("dot.dockerignore"),
272
- this.destinationPath(".dockerignore")
318
+ this.destinationPath(".dockerignore"),
319
+ this.props
273
320
  );
274
321
  this.fs.copyTpl(
275
322
  this.templatePath("Dockerfile.dante"),
@@ -279,13 +326,11 @@ export default class extends Generator {
279
326
  break;
280
327
  }
281
328
 
282
- if (this.props.docker) {
283
- this.fs.copyTpl(
284
- this.templatePath(".github/workflows/check.yml"),
285
- this.destinationPath(".github/workflows/check.yml"),
286
- this.props
287
- );
288
- }
329
+ this.fs.copyTpl(
330
+ this.templatePath(".github/workflows/check.yml"),
331
+ this.destinationPath(".github/workflows/check.yml"),
332
+ this.props
333
+ );
289
334
  }
290
335
 
291
336
  install() {}
@@ -4,10 +4,6 @@ export const options = [
4
4
  name: "documentclass",
5
5
  message: "Which template should be generated?",
6
6
  choices: [
7
- {
8
- name: "Scientic Thesis",
9
- value: "scientific-thesis",
10
- },
11
7
  {
12
8
  name: "Association for Computing Machinery (ACM)",
13
9
  value: "acmart",
@@ -20,8 +16,16 @@ export const options = [
20
16
  name: "Springer's Lecture Notes in Computer Science (LNCS)",
21
17
  value: "lncs",
22
18
  },
19
+ {
20
+ name: "Scientic Thesis",
21
+ value: "scientific-thesis",
22
+ },
23
+ {
24
+ name: "PhD Thesis Template (University of Stuttgart)",
25
+ value: "ustutt",
26
+ },
23
27
  ],
24
- default: "scientific-thesis",
28
+ default: "acmart",
25
29
  },
26
30
  {
27
31
  type: "list",
@@ -105,6 +109,9 @@ export const options = [
105
109
  },
106
110
  ],
107
111
  default: "a4",
112
+ when(response) {
113
+ return (response.documentclass != "ustutt" && response.documentclass != "scientific-thesis");
114
+ },
108
115
  },
109
116
  {
110
117
  type: "list",
@@ -126,39 +133,49 @@ export const options = [
126
133
  type: "list",
127
134
  name: "texlive",
128
135
  message: "Which TeXLive compatibility?",
129
- choices: function (state) {
130
- let res = [
131
- {
132
- name: "TeXLive 2021",
133
- value: 2021,
134
- },
136
+ choices(state) {
137
+ const res = [
135
138
  {
136
- name: "TeXLive 2022",
137
- value: 2022,
139
+ name: "TeXLive 2024",
140
+ value: 2024,
138
141
  },
139
142
  ];
140
- if (!state.overleaf) {
143
+ /* if (!state.overleaf) {
141
144
  res.push({
142
145
  name: "TeXLive 2023",
143
146
  value: 2023,
144
147
  });
145
148
  }
149
+ */
146
150
  return res;
147
151
  },
148
152
  default(state) {
149
153
  if (state.overleaf) {
150
- return 2022;
151
- } else {
152
- return 2023;
154
+ return 2024;
153
155
  }
156
+
157
+ return 2024;
154
158
  },
155
159
  },
156
160
  {
157
161
  type: "list",
158
162
  name: "latexcompiler",
159
163
  message: "Which latex compiler should be used?",
160
- choices: ["pdflatex", "lualatex"],
161
- default: "pdflatex",
164
+ choices: [
165
+ {
166
+ name: "pdflatex",
167
+ value: "pdflatex",
168
+ },
169
+ {
170
+ name: "lualatex",
171
+ value: "lualatex",
172
+ },
173
+ {
174
+ name: "lualatex and pdflatex (if switches in .tex files; default lualatex)",
175
+ value: "both",
176
+ },
177
+ ],
178
+ default: "both",
162
179
  when(response) {
163
180
  return !(response.documentclass === "ieee");
164
181
  },
@@ -166,7 +183,7 @@ export const options = [
166
183
  {
167
184
  when(response) {
168
185
  return (
169
- response.documentclass !== "acmart" && response.documentclass !== "ieee"
186
+ response.documentclass !== "acmart" && response.documentclass !== "ieee" && response.documentclass !== "ustutt"
170
187
  );
171
188
  },
172
189
  type: "list",
@@ -220,7 +237,7 @@ export const options = [
220
237
  {
221
238
  type: "list",
222
239
  name: "lang",
223
- message: "Which language should the document be?",
240
+ message: "Which language to use in the document?",
224
241
  choices: [
225
242
  {
226
243
  name: "English",
@@ -237,7 +254,7 @@ export const options = [
237
254
  type: "list",
238
255
  name: "font",
239
256
  message: "Which font should be used?",
240
- choices: (state) => {
257
+ choices(state) {
241
258
  const res = [];
242
259
  if (state.documentclass === "acmart") {
243
260
  res.push({
@@ -271,7 +288,7 @@ export const options = [
271
288
  },
272
289
  default: "default",
273
290
  when(response) {
274
- return response.documentclass !== "ieee";
291
+ return (response.documentclass !== "ieee") && (response.documentclass !== "ustutt");
275
292
  },
276
293
  },
277
294
  {
@@ -294,20 +311,20 @@ export const options = [
294
311
  type: "list",
295
312
  name: "enquotes",
296
313
  message: 'Which package to use to "enquote" text?',
297
- choices: (state) => {
314
+ choices(state) {
298
315
  const res = [];
299
316
  res.push({
300
317
  name: "csquotes (\\enquote{...} command)",
301
318
  value: "csquotes",
302
319
  });
303
- if (state.language === "en") {
320
+ if (state.lang === "en") {
304
321
  res.push({
305
322
  name: "textcmds (\\qq{...} command)",
306
323
  value: "textcmds",
307
324
  });
308
325
  }
309
326
 
310
- if (state.language === "de") {
327
+ if (state.lang === "de") {
311
328
  res.push({
312
329
  name: "Plain LaTeX (\\glqq{}text\\grqq{} - not recommended)",
313
330
  value: "plainlatex",
@@ -348,11 +365,15 @@ export const options = [
348
365
  {
349
366
  name: "pdfcomment",
350
367
  value: "pdfcomment",
351
- } /*
368
+ },
352
369
  {
353
- name: "Plain LaTeX (simple \\commentontext and \\commentatside are defined)",
370
+ name: "todonotes",
371
+ value: "todonotes",
372
+ },
373
+ {
374
+ name: "Plain LaTeX (simple \\todo command is defined)",
354
375
  value: "plainlatex"
355
- }, */,
376
+ },
356
377
  {
357
378
  name: "None (no support)",
358
379
  value: "none",
@@ -1,43 +1,31 @@
1
+ name: latexmk <%= filenames.main %>
1
2
  on:
2
3
  push:
3
4
  workflow_dispatch:
4
5
  concurrency:
5
- group: check
6
+ group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}"
6
7
  cancel-in-progress: true
7
8
  jobs:
8
9
  check:
9
10
  runs-on: ubuntu-latest
10
- services:
11
- registry:
12
- image: registry:2
13
- ports:
14
- - 5000:5000
15
11
  steps:
16
- - name: Set up QEMU
17
- uses: docker/setup-qemu-action@v2
18
- - name: Set up Docker Buildx
19
- uses: docker/setup-buildx-action@v2
20
- with:
21
- driver-opts: network=host
22
- - name: Cache Docker layers
23
- uses: actions/cache@v2
24
- with:
25
- path: /tmp/.buildx-cache
26
- key: ${{ runner.os }}-buildx
27
- - name: Build Docker image
28
- uses: docker/build-push-action@v3
29
- with:
30
- push: true
31
- tags: localhost:5000/name/app:latest
32
12
  - name: Set up Git repository
33
- uses: actions/checkout@v3
34
- - run: |
35
- mkdir /tmp/out
36
- mkdir /tmp/res
37
- - run: docker run -v $(pwd):/work/src -v /tmp/out:/work/out localhost:5000/name/app:latest work "latexmk -pdf -pdflatex='<% if ((latexcompiler == "pdflatex") || githubpublish) { %>pdflatex<% } else { %>lualatex<% } %> --interaction=nonstopmode' <%= filenames.main %>"
38
- - run: mv /tmp/out/*.pdf /tmp/res
39
- - uses: actions/upload-artifact@v2
13
+ uses: actions/checkout@v4
14
+ - name: Install TeX Live
15
+ uses: zauguin/install-texlive@v3
16
+ with:
17
+ package_file: '${{ github.workspace }}/Texlivefile'
18
+ - name: Prepare latexmk
19
+ run: |
20
+ updmap -sys
21
+ texhash
22
+ tlmgr generate language --rebuild-sys
23
+ if [ ! -f "latexmkrc" ]; then
24
+ cp "_latexmkrc" "latexmkrc"
25
+ fi
26
+ - run: latexmk <%= filenames.main %>
27
+ - uses: actions/upload-artifact@v4
40
28
  with:
41
29
  name: test-result
42
30
  path: |
43
- /tmp/res/*.pdf
31
+ <%= filenames.main %>.pdf
@@ -1,14 +1,6 @@
1
1
  FROM registry.gitlab.com/islandoftex/images/texlive:<% switch (texlive) {
2
- case 2023: %>latest-basic<% break;
3
- case 2022: %>TL2022-historic<% break;
2
+ case 2024: %>latest-latest<% break;
3
+ case 2023: %>TL2023-historic<% break;
4
4
  } -%>
5
5
 
6
6
  WORKDIR /workdir
7
-
8
- COPY Texlivefile /workdir/
9
- <% if (texlive == 2023) { -%>
10
-
11
- RUN xargs tlmgr install --repository https://mirror.mwt.me/ctan/systems/texlive/tlnet < /workdir/Texlivefile
12
-
13
- RUN tlmgr path add
14
- <% } -%>