generator-latex-template 2026.10.30 → 2026.11.1

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.
@@ -34,7 +34,7 @@ the feature vanishes for some switch combination without any error.
34
34
  3. **`Texlivefile`** — add the TeX Live package name, guarded (usually
35
35
  `githubpublish || <condition>`; `githubpublish` deliberately bundles everything).
36
36
  4. **Shell-escape is derived, never hardcoded.** It is the boolean
37
- `requiresShellEscape` in `index.js` (`uml == "plantuml"`, and minted only up to TeX Live 2024:
37
+ `requiresShellEscape` in `index.js` (`uml == "plantuml"`/`"mermaid"`, `ustutt` for gitver, and minted only up to TeX Live 2024:
38
38
  minted 3 runs `latexminted`, which TeX Live permits in restricted shell escape).
39
39
  Extend that expression if the new package needs `\write18`; the `latexmkrc` and the
40
40
  `main.*.tex` editor hints read the flag.
@@ -187,13 +187,15 @@ export default class extends Generator {
187
187
  this.props.bibrunner =
188
188
  this.props.bibtextool === "biblatex" ? "biber" : "bibtex";
189
189
 
190
- // Only the PlantUML UML example needs shell-escape. minted 3 (TeX Live 2025 and later)
190
+ // The PlantUML/Mermaid UML examples need shell-escape, as does gitver (the version
191
+ // stamp in the header of the ustutt thesis). minted 3 (TeX Live 2025 and later)
191
192
  // runs latexminted, which TeX Live permits in restricted shell escape; minted 2
192
193
  // (TeX Live 2024) still needs shell-escape.
193
194
  this.props.requiresShellEscape =
194
195
  (this.props.listings == "minted" && this.props.texlive < 2025) ||
195
196
  this.props.uml == "plantuml" ||
196
- this.props.uml == "mermaid";
197
+ this.props.uml == "mermaid" ||
198
+ this.props.documentclass == "ustutt";
197
199
 
198
200
  // Two-column layouts (IEEE, and the ACM conference/journal formats) cannot use
199
201
  // `longtable` ("longtable not in 1-column mode"), so the longtable example must
@@ -424,9 +426,47 @@ export default class extends Generator {
424
426
  this.templatePath(`chapters.README.${language}.md`),
425
427
  this.destinationPath(`chapters-${language}/README.md`),
426
428
  );
429
+ // Each chapter compiles on its own (package subfiles): it names the main
430
+ // file whose preamble it loads. The template repositories rename the main
431
+ // file per variant (update-files.yml) and share the chapter files, so the
432
+ // chapters of a published template name the minted main file of their
433
+ // language and carry the other variants commented out.
434
+ const publishedMains = {
435
+ ustutt: {
436
+ en: ["thesis-example-en", "thesis-example-basic-listings-en"],
437
+ de: ["thesis-example", "thesis-example-basic-listings"],
438
+ },
439
+ "scientific-thesis": {
440
+ en: [
441
+ "main-english",
442
+ "main-basic-listings-english",
443
+ "main-english-thu",
444
+ "main-english-university-of-hamburg",
445
+ ],
446
+ de: [
447
+ "main-german",
448
+ "main-basic-listings-german",
449
+ "main-german-thu",
450
+ "main-german-university-of-hamburg",
451
+ ],
452
+ },
453
+ };
454
+ const mains = this.props.githubpublish
455
+ ? publishedMains[this.props.documentclass][language]
456
+ : [this.props.filenames.main];
457
+ const chapterName = (index, chapter) =>
458
+ `${(index + 1) * 10} - ${chapter.name}`;
459
+ // The chapter the README names and check.yml compiles on its own
460
+ this.props.firstChapter = chapterName(0, chapters[0]);
461
+ this.fs.copyTpl(
462
+ this.templatePath("chapters.dot.latexmkrc"),
463
+ this.destinationPath(`chapters-${language}/.latexmkrc`),
464
+ { example: this.props.firstChapter },
465
+ );
427
466
  const includes = chapters.flatMap((chapter, index) => {
428
467
  // Steps of 10 leave room to insert a chapter without renaming the others
429
- const base = `chapters-${language}/${(index + 1) * 10} - ${chapter.name}`;
468
+ const name = chapterName(index, chapter);
469
+ const base = `chapters-${language}/${name}`;
430
470
  if (chapter.markdown) {
431
471
  write(`${base}.md`, trim(chapter.lines));
432
472
  return markdownInput(`${base}.md`);
@@ -439,8 +479,10 @@ export default class extends Generator {
439
479
  if (match) {
440
480
  sourceCode = { listings: match[1], lines: [] };
441
481
  } else if (line === "%%LTG-SOURCECODE-END") {
442
- const file = (listings) => `${base} - ${listings}`;
443
- write(file(sourceCode.listings) + ".tex", trim(sourceCode.lines));
482
+ const file = (listings) => `${name} - ${listings}`;
483
+ write(`${base} - ${sourceCode.listings}.tex`, trim(sourceCode.lines));
484
+ // The path is relative to this directory: subfiles reads the chapter
485
+ // through its import path, and a chapter compiled on its own runs here
444
486
  chapterLines.push(
445
487
  "% The main file loads either the minted or the listings package",
446
488
  "\\ifdefined\\inputminted",
@@ -457,8 +499,17 @@ export default class extends Generator {
457
499
  chapterLines.push(line);
458
500
  }
459
501
  }
460
- write(`${base}.tex`, trim(chapterLines));
461
- return [`\\include{${base}}`];
502
+ write(`${base}.tex`, [
503
+ `% Compiles on its own: latexmk "${name}" (in this directory, see README.md).`,
504
+ "% The subfiles package loads the preamble of the main file named here.",
505
+ ...mains.map(
506
+ (main, i) => `${i ? "%" : ""}\\documentclass[../${main}]{subfiles}`,
507
+ ),
508
+ "\\begin{document}",
509
+ ...trim(chapterLines),
510
+ "\\end{document}",
511
+ ]);
512
+ return [`\\subfileinclude{${base}}`];
462
513
  });
463
514
 
464
515
  return [...lines.slice(0, start), ...includes, ...lines.slice(end + 1)];
@@ -640,7 +691,8 @@ export default class extends Generator {
640
691
  const contentIndex = lines.indexOf("\\begin{document}");
641
692
  const headingIndex = lines.findIndex(
642
693
  (line, index) =>
643
- index > contentIndex && /^\\(chapter|section|include)\{/.test(line),
694
+ index > contentIndex &&
695
+ /^\\(chapter|section|subfileinclude)\{/.test(line),
644
696
  );
645
697
  const heading = lines[headingIndex].replace(/\\label\{.*$/, "");
646
698
  this.fs.write(
@@ -23,7 +23,7 @@ jobs:
23
23
  submodules: recursive
24
24
  <% } -%>
25
25
  - name: Install TeX Live
26
- uses: zauguin/install-texlive@6671d0c62046c7e349fe154d5208fe746b07e037 # v4.4.0
26
+ uses: zauguin/install-texlive@c9f3ea3d51b2e04d092c4f9d208a19542d5dabcf # v4.5.0
27
27
  with:
28
28
  package_file: '${{ github.workspace }}/Texlivefile'
29
29
  texlive_version: <%= texlive %>
@@ -102,13 +102,40 @@ jobs:
102
102
  <%= filenames.main %>.pdf
103
103
  <%= filenames.main %>.log
104
104
  <%= filenames.main %>.fls
105
+ <% if (isThesis) { -%>
106
+ chapter:
107
+ # One chapter compiled on its own (package subfiles, see chapters-<%= language %>/README.md)
108
+ name: chapter (latexmk "<%= firstChapter %>")
109
+ runs-on: ubuntu-latest
110
+ steps:
111
+ - name: Set up Git repository
112
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
113
+ - name: Install TeX Live
114
+ uses: zauguin/install-texlive@c9f3ea3d51b2e04d092c4f9d208a19542d5dabcf # v4.5.0
115
+ with:
116
+ package_file: '${{ github.workspace }}/Texlivefile'
117
+ texlive_version: <%= texlive %>
118
+ - name: Prepare latexmk
119
+ run: |
120
+ updmap -sys
121
+ texhash
122
+ tlmgr generate language --rebuild-sys
123
+ - run: latexmk "<%= firstChapter %>"
124
+ working-directory: chapters-<%= language %>
125
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
126
+ with:
127
+ name: chapter
128
+ path: |
129
+ chapters-<%= language %>/<%= firstChapter.replace(/\s+/g, '') %>.pdf
130
+ chapters-<%= language %>/<%= firstChapter.replace(/\s+/g, '') %>.log
131
+ <% } -%>
105
132
  word-count:
106
133
  runs-on: ubuntu-latest
107
134
  steps:
108
135
  - name: Set up Git repository
109
136
  uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
110
137
  - name: Install TeX Live
111
- uses: zauguin/install-texlive@6671d0c62046c7e349fe154d5208fe746b07e037 # v4.4.0
138
+ uses: zauguin/install-texlive@c9f3ea3d51b2e04d092c4f9d208a19542d5dabcf # v4.5.0
112
139
  with:
113
140
  package_file: '${{ github.workspace }}/Texlivefile'
114
141
  texlive_version: <%= texlive %>
@@ -287,7 +314,7 @@ jobs:
287
314
  version: 1.0
288
315
  execute_install_scripts: true
289
316
  - name: Install latexindent
290
- uses: zauguin/install-texlive@6671d0c62046c7e349fe154d5208fe746b07e037 # v4.4.0
317
+ uses: zauguin/install-texlive@c9f3ea3d51b2e04d092c4f9d208a19542d5dabcf # v4.5.0
291
318
  with:
292
319
  packages: latexindent
293
320
  texlive_version: <%= texlive %>
@@ -230,6 +230,15 @@ Following features are enabled in this template:
230
230
  For the original output, use `\bibliographystyle{IEEEtranN}`.
231
231
  - Citation ranges are written out: `[1], [2], [3]` instead of `[1]–[3]`.
232
232
  For ranges, use the natbib option `sort&compress` instead of `sort`.
233
+ <% if (font == "default" || githubpublish) { -%>
234
+ - The fonts IEEEtran intends (Times, Helvetica, Courier) with both engines; with LuaLaTeX, fontspec would otherwise fall back to Latin Modern.
235
+
236
+ | Engine | Text | Sans | Code | Math |
237
+ | --- | --- | --- | --- | --- |
238
+ | pdfLaTeX | Nimbus Roman | Nimbus Sans | [newtxtt](https://tug.org/FontCatalogue/newtxtt/) | [Computer Modern](https://tug.org/FontCatalogue/computermodern/) |
239
+ | LuaLaTeX | [TeX Gyre Termes](https://tug.org/FontCatalogue/texgyretermes/) | [TeX Gyre Heros](https://tug.org/FontCatalogue/texgyreheros/) | [TeX Gyre Cursor](https://tug.org/FontCatalogue/texgyrecursor/) | [Latin Modern Math](https://tug.org/FontCatalogue/latinmodernroman/) |
240
+
241
+ <% } -%>
233
242
  <% } -%>
234
243
  <% if (documentclass == 'lncs') { -%>
235
244
  - Provides a skeletal [<%= filenames.main %>.tex](<%= filenames.main %>.tex) file
@@ -251,6 +260,8 @@ Following features are enabled in this template:
251
260
  `minted` provides better output than [listings], but requires [latexminted] to be installed.
252
261
  <% } -%>
253
262
  <% if (isThesis) { -%>
263
+ - Each chapter compiles on its own, which is much faster than the whole thesis while writing: `latexmk "10 - introduction"` in `chapters-<%= githubpublish ? 'en' : language %>/`.
264
+ This is enabled by the [subfiles](https://ctan.org/pkg/subfiles) package; see [chapters-<%= githubpublish ? 'en' : language %>/README.md](chapters-<%= githubpublish ? 'en' : language %>/README.md).
254
265
  - Numbered research questions: `\defRQ` prints "Research Question 1 (RQ1)", `\refRQ` references it as "RQ1".
255
266
  This is enabled by the [refenums](https://github.com/koppor/refenums) package; `refenums.sty` is part of this repository, because TeX Live contains an older version.
256
267
  <% } -%>
@@ -809,11 +820,25 @@ replace the term `thesis-example` by e.g., `thesis-topic-name` in the following
809
820
  | `.gitignore` | `thesis-example*.png` |
810
821
  | `Makefile` | `MASTER_TEX = thesis-example.tex` |
811
822
 
823
+ ### Q: The thesis is in English, but the title page and the Kurzfassung have to be in German. Which main file do I use?
824
+
825
+ `thesis-example-en.tex`: its title page is German anyway (the examination regulations prescribe it), the "Kurzfassung" is set in German with `\begin{otherlanguage}{ngerman}`, and everything else is English, including "Contents", "List of Figures", "Chapter", and "Figure".
826
+ To keep an existing German `thesis-example.tex` instead, put `\selectlanguage{english}` in front of `\tableofcontents`; all headings and captions from there on are English.
827
+
812
828
  ### Q: I get the error `Reload initiated (formats: otf,ttf,ttc); reason: Font "Inconsolatazi4" not found.`
813
829
 
814
830
  Install package `inconsolata`
815
831
  <% break; default: -%>
816
832
  <% break; } -%>
833
+ <% if (isThesis) { -%>
834
+
835
+ ### Q: How do I compile a single chapter?
836
+
837
+ In `chapters-<%= githubpublish ? 'en' : language %>/`, run `latexmk "10 - introduction"`; the result is `10-introduction.pdf`.
838
+ Each chapter file starts with `\documentclass[../<main file>]{subfiles}`, and the [subfiles](https://ctan.org/pkg/subfiles) package loads the preamble of that main file.
839
+ The `.latexmkrc` in the chapter directory takes the settings of the main directory and lets LaTeX find the packages, figures and the bibliography there.
840
+ References to other chapters show as `??` and the bibliography is not printed; the full document has them.
841
+ <% } -%>
817
842
  <% if (githubpublish) { -%>
818
843
 
819
844
  ### Q: How can I synchronize updates from the template to my repository?
@@ -125,6 +125,7 @@ glossaries-extra
125
125
  glossaries-german
126
126
  <% } -%>
127
127
  <% } -%>
128
+ gitver
128
129
  graphics
129
130
  graphicscache
130
131
  <% if (githubpublish || isThesis) { -%>
@@ -154,6 +155,9 @@ iftex
154
155
  <% if (githubpublish || (isPaper && reallatexcompiler.startsWith("lualatex"))) { -%>
155
156
  impnattypo
156
157
  <% } -%>
158
+ <% if (githubpublish || isThesis) { -%>
159
+ import<%# required by subfiles %>
160
+ <% } -%>
157
161
  inconsolata<%# required by ustutt, scientific-thesis, acm%>
158
162
  infwarerr
159
163
  intcalc
@@ -318,6 +322,9 @@ soulpos
318
322
  stringenc
319
323
  sttools<%# this includes stfloats (at least required by acmart, ieee, lncs, ustutt, scientific-thesis) and flushend (ieee: balances the columns on the last page) %>
320
324
  subfig
325
+ <% if (githubpublish || isThesis) { -%>
326
+ subfiles
327
+ <% } -%>
321
328
  svn-prov<%# at least required by acmart, ustutt, scientific-thesis%>
322
329
  <% if (githubpublish || isThesis) { -%>
323
330
  tabto-ltx
@@ -2,4 +2,11 @@
2
2
 
3
3
  Eine Datei pro Kapitel, eingebunden von der Hauptdatei in der Reihenfolge ihrer Nummern.
4
4
  Die Nummern steigen in Zehnerschritten, damit ein neues Kapitel dazwischen passt, z. B. `25 - mein kapitel.tex`.
5
- Es wird in der Hauptdatei mit `\include{chapters-de/25 - mein kapitel}` eingebunden.
5
+ Es wird in der Hauptdatei mit `\subfileinclude{chapters-de/25 - mein kapitel}` eingebunden.
6
+
7
+ ## Ein einzelnes Kapitel übersetzen
8
+
9
+ Jedes Kapitel lässt sich für sich übersetzen, was beim Schreiben deutlich schneller geht als die ganze Arbeit.
10
+ In diesem Verzeichnis: `latexmk "10 - einleitung"` (die `.latexmkrc` hier übernimmt die Einstellungen des Hauptverzeichnisses); das Ergebnis ist `10-einleitung.pdf`.
11
+ Die Kapiteldatei beginnt mit `\documentclass[../main-german]{subfiles}`: Das Paket [subfiles](https://ctan.org/pkg/subfiles) lädt die Präambel dieser Hauptdatei.
12
+ Verweise auf andere Kapitel erscheinen als `??`, und das Literaturverzeichnis fehlt; beides gibt es im Gesamtdokument.
@@ -2,4 +2,11 @@
2
2
 
3
3
  One file per chapter, included by the main file in the order of their numbers.
4
4
  The numbers go in steps of 10, so a new chapter fits in between, e.g., `25 - my chapter.tex`.
5
- Add it to the main file with `\include{chapters-en/25 - my chapter}`.
5
+ Add it to the main file with `\subfileinclude{chapters-en/25 - my chapter}`.
6
+
7
+ ## Compiling a single chapter
8
+
9
+ Each chapter compiles on its own, which is much faster than the whole thesis while writing it.
10
+ In this directory, run `latexmk "10 - introduction"` (the `.latexmkrc` here takes the settings of the main directory); the result is `10-introduction.pdf`.
11
+ The chapter file starts with `\documentclass[../main-english]{subfiles}`: the [subfiles](https://ctan.org/pkg/subfiles) package loads the preamble of that main file.
12
+ References to other chapters show as `??` and the bibliography is not printed; the full document has them.
@@ -0,0 +1,9 @@
1
+ # Compile one chapter on its own, in this directory: latexmk "<%= example %>"
2
+ # The chapter loads the preamble of the main file (package subfiles). Packages, figures and the
3
+ # bibliography are in the parent directory, which is added to the search paths.
4
+ do '../.latexmkrc';
5
+ $ENV{'TEXINPUTS'} = '..' . $search_path_separator . ($ENV{'TEXINPUTS'} // '');
6
+ $ENV{'BIBINPUTS'} = '..' . $search_path_separator . ($ENV{'BIBINPUTS'} // '');
7
+ # Spaces in the job name break the ifplatform package, so the PDF is named without them: <%= example.replace(/\s+/g, '') %>.pdf
8
+ my ($chapter) = grep { !/^-/ } @ARGV;
9
+ if (defined $chapter) { ($jobname = $chapter) =~ s/\.tex$//; $jobname =~ s/\s+//g; }
@@ -1,5 +1,7 @@
1
1
  <%= filenames.main %>.pdf
2
2
  <%= filenames.main %>-*.pdf
3
+ # single chapters compiled on their own (see chapters-*/README.md)
4
+ chapters-*/*.pdf
3
5
  figures/*.pdf_tex
4
6
 
5
7
  <% if (documentclass == 'ustutt') { -%>
@@ -110,7 +110,17 @@ lualatex
110
110
  <% break; default: -%>
111
111
  <%# "default" font configuration -%>
112
112
  <% switch (documentclass) { case "ieee": -%>
113
- <%# Default font configuration of the IEEE template is used -%>
113
+ <%# IEEEtran sets Times/Helvetica/Courier (Palatino for compsoc journals) as Type 1 fonts via \rmdefault etc.;
114
+ fontspec replaces them with Latin Modern, so the OpenType equivalents are set here -%>
115
+
116
+ <%= indent %>% IEEEtran's fonts (Times, Helvetica, Courier) as OpenType: fontspec would otherwise typeset the paper in Latin Modern
117
+ <%= indent %>\setmainfont{TeX Gyre Termes}
118
+ <%= indent %>\setsansfont{TeX Gyre Heros}
119
+ <%= indent %>\setmonofont{TeX Gyre Cursor}
120
+ <%= indent %>% compsoc journals use Palatino
121
+ <%= indent %>\makeatletter
122
+ <%= indent %>\@IEEEcompsocnotconfonly{\setmainfont{TeX Gyre Pagella}}
123
+ <%= indent %>\makeatother
114
124
  <% break; case "ustutt": -%>
115
125
  <%# see also https://github.com/programming-journal/programming/blob/main/programming.cls -%>
116
126
 
@@ -197,7 +207,7 @@ pdflatex
197
207
  <% break; default: -%>
198
208
  <%# "default" font configuration / Computer Modern and pdflatex -%>
199
209
  <% switch (documentclass) { case "ieee": -%>
200
- <%# The default font configuration (Palatino/Palladio) of the IEEE template is used.
210
+ <%# The default fonts of IEEEtran (Times, Helvetica, Courier; Palatino for compsoc journals) are used.
201
211
  In addition, we make the code appear more nice -%>
202
212
  <%= indent %>% use nicer font for code
203
213
  <%= indent %>\usepackage[zerostyle=b,scaled=.75]{newtxtt}
@@ -0,0 +1,12 @@
1
+ % Document version from git: \gitVer is the commit (with "-dirty" when there are uncommitted changes) and
2
+ % \versionBox a framed "Manuscript version: #<commit> - <build time>", e.g. for the footer or the title page.
3
+ % gitver needs git and --shell-escape (add it to $pdflatex in .latexmkrc), so it is loaded only when the
4
+ % document is compiled with --shell-escape; without, both commands are empty.
5
+ % Without a git repository (e.g. a downloaded zip), gitver reports an error and the version reads "unknown".
6
+ % Doc: https://ctan.org/pkg/gitver
7
+ <% const gitver = documentclass == 'ustutt' ? '' : '%'; -%>
8
+ <%= gitver %>\ExplSyntaxOn
9
+ <%= gitver %>\sys_if_shell_unrestricted:T { \RequirePackage [ noheader , nopdfinfo ] { gitver } }
10
+ <%= gitver %>\ExplSyntaxOff
11
+ <%= gitver %>\providecommand{\gitVer}{}
12
+ <%= gitver %>\providecommand{\versionBox}{}
@@ -117,7 +117,7 @@
117
117
  \documentclass[
118
118
  fontsize=10pt,
119
119
  numbers=noenddot,
120
- english, % English as main language; this parameter is passed to other packages (e.g., selnolig in the case of lualatex)
120
+ ngerman, % Neue deutsche Rechtschreibung; der Parameter wird an andere Pakete weiter gegeben (z.B. selnolig bei lualatex)
121
121
  paper=a5,
122
122
  twoside, % die Dissertation wird als Buch gedruckt: der innere Rand ist schmaler als der äußere, daher wechselt der Text zwischen linken und rechten Seiten
123
123
  DIV=calc,
@@ -301,6 +301,8 @@
301
301
  <% } -%>
302
302
  <%- include('hyperref.preamble.de.tex', this); -%>
303
303
 
304
+ <%- include('gitver.preamble.en.tex', this); -%>
305
+
304
306
  <%- include('floats.preamble.en.tex', this); -%>
305
307
  <%- include('progress.preamble.en.tex', this); -%>
306
308
  <%- include('subfig.preamble.en.tex', this); -%>
@@ -344,13 +346,14 @@
344
346
  % Über Spalten und Seiten umbrechen. Eine nicht umbrechbare Box ragt in die Gleitobjekte oder den unteren Rand, wenn die Gleitobjekte einer Seite den schmalen Spalten zu wenig Platz lassen
345
347
  breakable,
346
348
  <% } -%>
347
- listing file=\currfilepath,
349
+ % \currfilename statt \currfilepath: ein Kapitel wird über den Import-Pfad von subfiles gelesen, den minted sonst noch einmal voranstellt
350
+ listing file=\currfilename,
348
351
  colback=green!5!white,
349
352
  colframe=green!25,
350
353
  coltitle=black!90,
351
354
  coltext=black!90,
352
355
  left=8mm,
353
- title=Zugehöriger \LaTeX{}-Quelltext aus \texttt{\currfilepath},
356
+ title=Zugehöriger \LaTeX{}-Quelltext aus \texttt{\currfilename},
354
357
  <% if (listings == 'listings') { -%>
355
358
  listing options={
356
359
  frame=none,
@@ -494,6 +497,9 @@
494
497
 
495
498
  <% } -%>
496
499
  <%- include('linebreaker.preamble.en.tex', this); -%>
500
+ <% if (isThesis) { -%>
501
+ <%- include('subfiles.preamble.en.tex', this); -%>
502
+ <% } -%>
497
503
  \begin{document}
498
504
  <% if (documentclass === "ustutt") { -%>
499
505
  \setstretch{1.2}
@@ -781,7 +787,7 @@ Kurzfassung der Arbeit.
781
787
  <% } -%>
782
788
  <%= indent %>\lipsum[1]
783
789
  <% if (documentclass == "ustutt") { -%>
784
- \end{otherlanguage}{american}
790
+ \end{otherlanguage}
785
791
  <% } -%>
786
792
 
787
793
  <% } -%>
@@ -289,6 +289,8 @@
289
289
  <% } -%>
290
290
  <%- include('hyperref.preamble.en.tex', this); -%>
291
291
 
292
+ <%- include('gitver.preamble.en.tex', this); -%>
293
+
292
294
  <%- include('floats.preamble.en.tex', this); -%>
293
295
  <%- include('progress.preamble.en.tex', this); -%>
294
296
  <%- include('subfig.preamble.en.tex', this); -%>
@@ -332,13 +334,14 @@
332
334
  % Split across columns and pages. An unbreakable box overflows into the floats or the bottom margin when the floats of a page leave the narrow columns too little room
333
335
  breakable,
334
336
  <% } -%>
335
- listing file=\currfilepath,
337
+ % \currfilename, not \currfilepath: a chapter is read through the import path of subfiles, which minted would prepend once more
338
+ listing file=\currfilename,
336
339
  colback=green!5!white,
337
340
  colframe=green!25,
338
341
  coltitle=black!90,
339
342
  coltext=black!90,
340
343
  left=8mm,
341
- title=Corresponding \LaTeX{} code of \texttt{\currfilepath},
344
+ title=Corresponding \LaTeX{} code of \texttt{\currfilename},
342
345
  <% if (listings == 'listings') { -%>
343
346
  listing options={
344
347
  frame=none,
@@ -472,6 +475,9 @@
472
475
 
473
476
  <% } -%>
474
477
  <%- include('linebreaker.preamble.en.tex', this); -%>
478
+ <% if (isThesis) { -%>
479
+ <%- include('subfiles.preamble.en.tex', this); -%>
480
+ <% } -%>
475
481
  \begin{document}
476
482
  <% if (documentclass === "ustutt") { -%>
477
483
  \setstretch{1.2}
@@ -94,6 +94,12 @@
94
94
 
95
95
  <%- include('markdown-references.preamble.en.tex', this); -%>
96
96
 
97
+ % --- Dokumentversion aus git in der Fußzeile -----------------------------
98
+ % Den gitver-Block unten und die beiden Zeilen danach einkommentieren; mit --shell-escape übersetzen (siehe .latexmkrc).
99
+ <%- include('gitver.preamble.en.tex', this); -%>
100
+ %\usepackage{scrlayer-scrpage}
101
+ %\cfoot*{\versionBox}
102
+
97
103
  \title{Mein Buch}
98
104
  \author{Martha Mildenhall}
99
105
  \date{\today}
@@ -94,6 +94,12 @@
94
94
 
95
95
  <%- include('markdown-references.preamble.en.tex', this); -%>
96
96
 
97
+ % --- Document version from git in the footer -----------------------------
98
+ % Uncomment the gitver block below and the two lines after it; compile with --shell-escape (see .latexmkrc).
99
+ <%- include('gitver.preamble.en.tex', this); -%>
100
+ %\usepackage{scrlayer-scrpage}
101
+ %\cfoot*{\versionBox}
102
+
97
103
  \title{My Book}
98
104
  \author{Martha Mildenhall}
99
105
  \date{\today}
@@ -0,0 +1,6 @@
1
+ % Each chapter compiles on its own: its file starts with \documentclass[../<main file>]{subfiles}, and
2
+ % "latexmk" in chapters-<%= language %>/ builds it with this preamble (see chapters-<%= language %>/README.md).
3
+ % In the full document, \subfileinclude works like \include.
4
+ % subfiles is loaded as the last package.
5
+ % Doc: https://ctan.org/pkg/subfiles
6
+ \usepackage{subfiles}
@@ -6,7 +6,8 @@
6
6
  \ChTitleVar{\normalfont\Huge\scshape\color{black}\raggedleft}
7
7
  \renewcommand{\DOCH}{%
8
8
  \setlength{\fboxrule}{\RW}
9
- \makebox[12.34cm][r]{
9
+ % \textwidth, not a fixed width: a wider box overflows the line on every chapter page ("Overfull \hbox")
10
+ \makebox[\textwidth][r]{
10
11
  \rotatebox{90}{
11
12
  \makebox[2cm]{
12
13
  \resizebox{2.5cm}{!}{ %\fboxsep=6pt
@@ -4,27 +4,32 @@
4
4
  \pagestyle{scrheadings}
5
5
  \clearmainofpairofpagestyles
6
6
 
7
+ % KOMA convention: \markboth sets the chapter (left mark) and clears the section (right mark),
8
+ % so the start of a chapter never shows the previous chapter's last section or the table of contents.
9
+ % \markright sets the section only.
7
10
  \newcommand{\setchapterfooter}[1]{%
8
11
  \def\mydummy{#1}
9
12
  \renewcommand{\chaptermark}[1]{%
10
- \markright{\textbf{\thechapter}~|~\mydummy}{}}
13
+ \markboth{\textbf{\thechapter}~|~\mydummy}{}}
11
14
  }
12
15
 
13
16
  \newcommand{\resetchapterfooter}{%
14
17
  \renewcommand{\chaptermark}[1]{%
15
- \markright{\textbf{\thechapter}~|~##1}{}}
18
+ \markboth{\textbf{\thechapter}~|~##1}{}}
16
19
  }
17
20
 
18
21
  \renewcommand{\chaptermark}[1]{%
19
- \markright{\textbf{\thechapter}~|~#1}{}}
22
+ \markboth{\textbf{\thechapter}~|~#1}{}}
20
23
 
21
24
  \renewcommand{\sectionmark}[1]{%
22
- \markleft{\textbf{\thesection}~|~#1}{}}
25
+ \markright{\textbf{\thesection}~|~#1}}
23
26
 
24
27
  \ofoot[\pagemark]{\pagemark}
25
- \refoot{\rightmark}
26
- %\refoot{\chaptermark -- \thechapter}
27
- \lofoot{\leftmark}
28
+ % Document version in the (otherwise empty) header (see gitver below); empty when compiled without --shell-escape.
29
+ % The footer is taken by the chapter and section marks, which are too long to share the line with the version.
30
+ \chead*{\versionBox}
31
+ \refoot{\leftmark}
32
+ \lofoot{\rightmark}
28
33
 
29
34
  % daniel's style for abstract (summary / abstract)
30
35
  \deftriplepagestyle{justpagenums}{}{}{}{}{}{\textbf{\thepage}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-latex-template",
3
- "version": "2026.10.30",
3
+ "version": "2026.11.1",
4
4
  "description": "Generates a latex template to be used as start for writing scientific works (papers, articles, theses)",
5
5
  "homepage": "https://github.com/latextemplates/generator-latex-template",
6
6
  "author": {