generator-latex-template 2026.9.23 → 2026.10.8

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 (30) hide show
  1. package/README.md +4 -2
  2. package/generators/app/CLAUDE.md +113 -0
  3. package/generators/app/index.js +8 -0
  4. package/generators/app/templates/README.en.md +25 -0
  5. package/generators/app/templates/Texlivefile +6 -3
  6. package/generators/app/templates/cleveref.example.en.tex +1 -1
  7. package/generators/app/templates/diagbox.example.en.tex +4 -3
  8. package/generators/app/templates/dot.aspell.conf +1 -0
  9. package/generators/app/templates/dot.aspell.en.pws +7 -1
  10. package/generators/app/templates/dot.textlintrc.json +1 -1
  11. package/generators/app/templates/figures/ulm-minster.jpg +0 -0
  12. package/generators/app/templates/floats.example.de.tex +11 -0
  13. package/generators/app/templates/floats.example.en.tex +11 -0
  14. package/generators/app/templates/hyphenation.example.en.tex +3 -4
  15. package/generators/app/templates/latexmkrc +29 -6
  16. package/generators/app/templates/listings.example.de.tex +6 -2
  17. package/generators/app/templates/listings.example.en.tex +4 -0
  18. package/generators/app/templates/listings.long.example.en.tex +75 -0
  19. package/generators/app/templates/longtable.example.en.tex +1 -1
  20. package/generators/app/templates/main.de.tex +84 -26
  21. package/generators/app/templates/main.en.tex +84 -26
  22. package/generators/app/templates/minted.example.en.tex +4 -0
  23. package/generators/app/templates/minted.long.example.en.tex +75 -0
  24. package/generators/app/templates/otherfeatures.example.en.tex +1 -1
  25. package/generators/app/templates/paragraphs.example.de.tex +2 -2
  26. package/generators/app/templates/paragraphs.example.en.tex +2 -2
  27. package/generators/app/templates/subfig.example.en.tex +3 -2
  28. package/generators/app/templates/tables.example.en.tex +1 -1
  29. package/generators/app/templates/zref-clever.example.en.tex +1 -1
  30. package/package.json +1 -1
package/README.md CHANGED
@@ -132,7 +132,8 @@ In the long run, the contents of the `paper.tex` (and similar) files in reposito
132
132
  - Cancel workflows:
133
133
  - `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" -R latextemplates/generator-latex-template || true; done`
134
134
  - `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" -R latextemplates/generator-latex-template || true; done`
135
- - Update submodule of "derived" templates (LNCS, ...): `scripts/spread-updates.sh`
135
+ - Update submodule of "derived" templates (LNCS, ...): `scripts/spread-updates.sh`. It also links the generator's `refine-ltg` PR in the description of each template's "Update LTG" PR.
136
+ - Keep the `refine-ltg` PR description current: it links every issue the cycle fixes (the same `[repo#N]` links as the CHANGELOG).
136
137
  - Sort `dot.aspell.en.pws`: `cat dot.aspell.en.pws | (sed -u 1q; sort) | sponge dot.aspell.en.pws` <!-- hint by https://stackoverflow.com/a/56151840/873282 -->
137
138
 
138
139
  ### Testing
@@ -231,7 +232,7 @@ ejslint.cmd c:\git-repositories\latextemplates\generator-latex-template\generato
231
232
  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).
232
233
 
233
234
  - `npx release-it`
234
- - `npx github-release-from-changelog`
235
+ - `GITHUB_TOKEN=$(gh auth token) npx github-release-from-changelog` (Git Bash; it needs a GitHub token, which the logged-in `gh` CLI provides)
235
236
  5. On `main`, run `scripts/end-new-cycle.sh`, then **squash-merge** each template's "Update LTG" PR once it is green.
236
237
 
237
238
  ## License
@@ -241,6 +242,7 @@ See [benbalter/talks#15](https://github.com/benbalter/talks/issues/15#issuecomme
241
242
 
242
243
  - `generators/app/templates/splncs04nat.bst` is taken from [tpavlic/splncs04nat](https://github.com/tpavlic/splncs04nat) and is MIT-licensed.
243
244
  - `generators/app/templates/logos/`: This directory contains logos, which have special licenses.
245
+ - `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/).
244
246
 
245
247
  [hyperref]: https://ctan.org/pkg/hyperref
246
248
  [listings]: https://ctan.org/pkg/listings
@@ -0,0 +1,113 @@
1
+ <!-- Loaded automatically when Claude works on files under generators/app/. Moved from the repository root CLAUDE.md. -->
2
+
3
+ ## Adding a package or example (wire every place, or a variant silently drops it)
4
+
5
+ The generated document is assembled from micro-templates; a new LaTeX package or
6
+ example section has to be wired in **lockstep** across several files. Miss one and
7
+ the feature vanishes for some switch combination without any error.
8
+
9
+ 1. **Content** — add/extend `generators/app/templates/<name>.example.<lang>.tex`
10
+ (the demo body) and/or `<name>.preamble.<lang>.tex` (the `\usepackage`). Example
11
+ bodies use the `<%- bexample %> … <%- eexample %>` convention (=
12
+ `\begin{ltgexample}…\end{ltgexample}`), which **runs the body in place and echoes
13
+ its own source lines** — it is *not* the old `latexdemo`/`\PrintDemo`. Most examples
14
+ are a single shared `.en` file included from both mains. Give each feature its **own**
15
+ `<feature>.preamble.<lang>.tex` (one concern per file — e.g. `tikz.preamble`,
16
+ `longtable.preamble`, `uml.plantuml.preamble`), **not** a catch-all "examples" preamble.
17
+ **Config vs. demo:** a package a feature needs to *work* belongs in that feature's
18
+ config preamble and is loaded wherever the feature is on; a package that only *renders
19
+ a demo* is the example's own concern. So `\mathbb` (a real feature) is provided by
20
+ `math.preamble.en.tex` — `\@ifundefined{mathbb}{\usepackage{amssymb}}{}`, guarded
21
+ because `amssymb` clashes with `mathdesign`/`newtxmath`/`unicode-math` — and the math
22
+ *example* is then gated to where `math.preamble` is included (`isThesis ||
23
+ feature.abbreviations`), so LNCS etc. don't reference an undefined `\mathbb`.
24
+ 2. **Wire the includes into `main.en.tex` AND `main.de.tex`.** Example includes go in
25
+ the `LaTeX Hints` chapter (the whole chapter is already guarded by
26
+ `<% if (examples) %>`); package loads go in the preamble area. Guard each with the
27
+ right condition (`isThesis`, a switch value, …) — and gate an example to where the
28
+ config that makes it compile is present.
29
+ 3. **`Texlivefile`** — add the TeX Live package name, guarded (usually
30
+ `githubpublish || <condition>`; `githubpublish` deliberately bundles everything).
31
+ 4. **Shell-escape is derived, never hardcoded.** It is the boolean
32
+ `requiresShellEscape` in `index.js` (`listings == "minted" || uml == "plantuml"`).
33
+ Extend that expression if the new package needs `\write18`; the `latexmkrc` and the
34
+ `main.*.tex` editor hints read the flag.
35
+ 5. **New user switch?** Decide **prompt vs. plain flag** first:
36
+ - A **prompt** in `options.js` (scope with `when()`, give a `default`) is interactive
37
+ and nice for discovery — but **every** template's `update-files.yml` that satisfies
38
+ its `when()` must pass the flag (like `--todo`), or the non-interactive `yo` run in CI
39
+ blocks on the prompt and fails. So a thesis-only prompt (e.g. `uml`) means
40
+ `scientific-thesis-template` *and* `uni-stuttgart-dissertation-template` need
41
+ `--uml=…` added to their (template-managed) `update-files.yml`.
42
+ - A **plain CLI flag** read from `this.options` in `index.js` with a default (e.g.
43
+ `longtable`) never prompts, so it never breaks CI and needs no `update-files.yml`
44
+ change — at the cost of interactive discovery.
45
+ Either way default it in `index.js` (prompt: `if (!this.props.x) this.props.x = "none";`
46
+ / flag: read `this.options.x` with a fallback), and if it's a prompt add the axis to
47
+ `__tests__/matrix.js` **and** the list in `.github/generate-workflows.py` (kept in
48
+ sync). Model on the `todo` / `uml` (prompt) and `longtable` (flag) options.
49
+ 6. **Not in TeX Live** (e.g. `tikz-uml`) — guard usage with
50
+ `\IfFileExists{<pkg>.sty}{…}{…}` so a plain `npx`/submodule-less generation still
51
+ compiles (it just skips the demo). Provide the package via a git submodule +
52
+ `TEXINPUTS` (in `latexmkrc`) and a recursive checkout in the generated `check.yml`,
53
+ and document the setup in `README.en.md`. External-tool packages (PlantUML needs
54
+ Java) also need the tool installed in `check.yml` and `--shell-escape`.
55
+
56
+ **Verify (LaTeX-free first, then compile):** `npx ejs-lint <file>` on every changed
57
+ EJS template; run **`npm test`**, not `node --test` directly — `npm test`'s `pretest`
58
+ runs `eslint .` (incl. `prettier`), which `node --test` skips, so a prettier-only nit
59
+ in `index.js`/`options.js` passes locally but fails CI (run `npx eslint --fix .` to
60
+ match the formatter). `npm test` is the pairwise suite; `npm run test:all` is the full
61
+ matrix. Then generate locally with the **exact** `update-files.yml` flags (a missing
62
+ required option such as `acmformat` or `todo` drops you into an interactive prompt,
63
+ which reads as a hang) and grep the output. Sanity-compile new `.tex` in a *minimal
64
+ standalone* document (the full thesis pulls in packages a local TeX Live may lack);
65
+ `perl -c` the generated `latexmkrc`; validate the generated `check.yml` as YAML. The
66
+ `check-make.yml` build also runs `make format` (latexindent) + `git diff --exit-code`,
67
+ so generated output must already be latexindent-clean — column-aligned tables in
68
+ particular (see `lookForAlignDelims` in `localSettings.yaml`).
69
+
70
+ ### EJS whitespace: `-%>` eats the trailing newline
71
+
72
+ Almost every control tag ends with `-%>` (the EJS "newline slurp"): `<% if (…) { -%>`,
73
+ `<% } -%>`, `<% switch/case/break … -%>`, and `<%- include('…', this); -%>`. That slurp
74
+ is deliberate — it keeps the control flow (and the include statements themselves) from
75
+ emitting stray blank lines into the generated `.tex`. A plain `<% } %>` (no dash) leaves
76
+ its newline and can inject an unwanted blank line, so the convention is the dashed form;
77
+ only use plain `%>` when you actually want that newline.
78
+
79
+ The consequence (and a real footgun): **the blank-line layout of the output is not the
80
+ layout of the source.** Because `-%>` eats one trailing newline, two adjacent
81
+ `-%>`-terminated blocks/includes render with **no** blank line between them. To get a
82
+ blank line between blocks you need one of:
83
+ - the first block's file to **end with a trailing blank line** (how most
84
+ `*.preamble.*.tex` separate themselves — e.g. `font.preamble` ends with a blank line
85
+ then `<% } -%>`), **or**
86
+ - an **explicit blank line in the source** between the two `-%>` tags (the `-%>` eats one
87
+ newline, the remaining one + the content's own trailing newline = a blank line).
88
+
89
+ This is exactly the `nowidow` bug: it followed `microtype.preamble`, which does *not* end
90
+ with a trailing blank, and the include `-%>` ate the source newline — so the block butted
91
+ against microtype until an explicit blank line was added between the two includes. When a
92
+ generated block is missing/extra a blank line, this slurp interaction is the first thing
93
+ to check.
94
+
95
+ ### Compile gotchas the single-variant local test misses
96
+
97
+ `npm test` only checks that the generator *generates*; the **multi-variant template
98
+ builds** (each `update-ltg` PR compiles every `main*.tex` for both languages and several
99
+ formats) catch things a single local `yo` + compile does not. Two that have bitten:
100
+
101
+ - **Two-column layouts can't use `longtable`** ("longtable not in 1-column mode"). IEEE and
102
+ the ACM `sigconf`/`sigplan`/`acmtog` formats are two-column, so any `longtable` (or other
103
+ one-column-only) example must be gated on `!twocolumn` (a derived prop in `index.js`:
104
+ `documentclass == "ieee" || (acmart && acmformat ∈ {acmtog,sigconf,sigplan})`). Single-column
105
+ figures (`figure`, not `figure*`) are fine in two columns.
106
+ - **A template repo ships ONE shared `abbreviations.tex`** — the `update-files.yml` "Prepare
107
+ files" step keeps only one variant's copy (e.g. the `en`+minted one), and **every** main
108
+ file (English *and* German) does `\input{abbreviations}`. So a glossary entry used by any
109
+ language's example must be defined in **both** `abbreviations.en.tex` and
110
+ `abbreviations.de.tex` (the unused one just never appears in that document's list). Making
111
+ `\gls` entries language-exclusive breaks the other language's variant with
112
+ "Glossary entry `…' has not been defined". The same single-shared-file logic applies to
113
+ other `this.fs.copy`'d siblings (`commands.tex`, …).
@@ -348,6 +348,14 @@ export default class extends Generator {
348
348
  );
349
349
  }
350
350
 
351
+ // Photo for the JPEG example in floats.example.*.tex (CC0, see README)
352
+ if (this.props.examples) {
353
+ this.fs.copy(
354
+ this.templatePath("figures/ulm-minster.jpg"),
355
+ this.destinationPath("figures/ulm-minster.jpg"),
356
+ );
357
+ }
358
+
351
359
  if (this.props.language === "de" && !this.props.githubpublish) {
352
360
  this.fs.copyTpl(
353
361
  this.templatePath("README.de.md"),
@@ -372,6 +372,24 @@ In case you think, a package needs to be altered or added, feel free to open an
372
372
  - Edit [paper.tex](paper.tex).
373
373
  - `latexmk paper`.
374
374
 
375
+ ## Using the template for a THU term paper
376
+
377
+ Technische Hochschule Ulm (THU) bases its term paper template on the IEEE conference template.
378
+ To follow the THU requirements (as of the THU template v1.0 of 2023-09-23 by Markus Goldstein):
379
+
380
+ - Enable page numbers: uncomment `\pagestyle{plain}` after `\maketitle`.
381
+ - Use the THU affiliation in the author block:
382
+
383
+ ```latex
384
+ \author{\IEEEauthorblockN{Given Name Surname}
385
+ \IEEEauthorblockA{\textit{Department of Computer Science} \\
386
+ \textit{Ulm University of Applied Sciences (THU)}\\
387
+ Ulm, Germany \\
388
+ youremail@thu.de}}
389
+ ```
390
+
391
+ Everything else (A4 paper, numeric citations with `natbib` and `IEEEtranN`, `\citet`, links without colored boxes) is already set up.
392
+
375
393
  ## Attention regarding `compsocconf`
376
394
 
377
395
  Some conferences distribute a `IEEEtran.cls` V1.7a dated 2007 and a parameter `compsocconf`.
@@ -652,6 +670,13 @@ The author of the class offers a large FAQ at <http://www.michaelshell.org/tex/i
652
670
  Please read on there.
653
671
  The other possibility is to execute `texdoc ieeetran` and read in the documentation.
654
672
  For example, there is an explanation of how to typeset the affiliation information with four or more authors properly.
673
+
674
+ ### Q: How are the two columns of the last page balanced?
675
+
676
+ The [flushend](https://ctan.org/pkg/flushend) package balances them automatically; no command in the text is needed.
677
+ An `\AtEndDocument` hook in the preamble (right after `\usepackage{flushend}`) activates flushend for the last page and, when the text ends in the first column, ends that column, so that flushend distributes the text over both columns.
678
+ If you do not want balanced columns, remove `\usepackage{flushend}` together with that hook.
679
+ If flushend produces odd spacing on the last page (IEEEtran's author warns about that for references), balance by hand instead: remove flushend and enable `\IEEEtriggeratref{N}` in front of `\bibliographystyle`, which starts a new column before reference `N`.
655
680
  <% break; case "ustutt": -%>
656
681
 
657
682
  ### Q: How to rename `thesis-example.tex`?
@@ -235,6 +235,9 @@ nowidow
235
235
  ntheorem
236
236
  <% } -%>
237
237
  paralist
238
+ <% if (githubpublish || twocolumn) { -%>
239
+ pdfcol<%# required by the tcolorbox library "breakable" (example boxes in two-column documents) %>
240
+ <% } -%>
238
241
  pdfcomment
239
242
  pdfescape
240
243
  <% if (githubpublish || isThesis) { -%>
@@ -253,8 +256,8 @@ placeins
253
256
  <% if (githubpublish || (uml == "plantuml")) { -%>
254
257
  plantuml<%# plantuml.sty for the PlantUML UML example; the diagram also needs an external PlantUML install %>
255
258
  <% } -%>
256
- <% if ((documentclass == 'acmart') || (documentclass == 'ieee')) { -%>
257
- preprint<%# this includes balance%>
259
+ <% if (documentclass == 'acmart') { -%>
260
+ preprint<%# this includes balance, used by the acmart option "balance"%>
258
261
  <% } -%>
259
262
  <% if (githubpublish || isThesis) { -%>
260
263
  psnfss<%# provides pifont%>
@@ -290,7 +293,7 @@ soulpos
290
293
  spelling
291
294
  <% } -%>
292
295
  stringenc
293
- sttools<%# this includes stfloats; at least required by acmart, ieee, lncs, ustutt, scientific-thesis %>
296
+ sttools<%# this includes stfloats (at least required by acmart, ieee, lncs, ustutt, scientific-thesis) and flushend (ieee: balances the columns on the last page) %>
294
297
  subfig
295
298
  svn-prov<%# at least required by acmart, ustutt, scientific-thesis%>
296
299
  <% if (githubpublish || isThesis) { -%>
@@ -17,7 +17,7 @@ Cleveref demonstration: Cref at beginning of sentence, cref in all other cases.
17
17
  Heading1 & Heading2 \\
18
18
  \midrule
19
19
  One & Two \\
20
- Thee & Four \\
20
+ Three & Four \\
21
21
  \bottomrule
22
22
  \end{tabular}
23
23
  \caption{Example table for cref demo}
@@ -1,14 +1,15 @@
1
+ <%# Keep the first cell of the table short: latexindent pads the first cell of every row to its width, and the echoed code has to fit a narrow column (IEEE, ACM). -%>
1
2
  <%- bexample %>
2
- % Source: https://tex.stackexchange.com/a/468994/9075
3
+ % Adapted from https://tex.stackexchange.com/a/468994/9075
3
4
  \begin{<% if (documentclass == 'ieee') { %>figure<% } else { %>table<% } %>}
4
5
  \caption{Table with diagonal line}
5
6
  \label{tab:diag}
6
7
  \begin{center}
7
8
  \begin{tabular}{|l|c|c|}
8
9
  \hline
9
- \diagbox[width=10em]{Diag \\Column Head I}{Diag Column\\Head II} & Second & Third \\
10
+ \diagbox{Row}{Column} & A & B \\
10
11
  \hline
11
- & foo & bar \\
12
+ 1 & x & y \\
12
13
  \hline
13
14
  \end{tabular}
14
15
  \end{center}
@@ -1,5 +1,6 @@
1
1
  add-tex-command "minted options" ppppppppppppppppppppppp
2
2
  add-tex-command @ifundefined pppppp
3
+ add-tex-command AtEndDocument p
3
4
  add-tex-command Cref p
4
5
  add-tex-command DeclareFontFamily ppp
5
6
  add-tex-command DeclareFontShape pppppp
@@ -1,4 +1,4 @@
1
- personal_ws-1.1 en 132 utf-8
1
+ personal_ws-1.1 en 138 utf-8
2
2
  ACM
3
3
  Atlantic
4
4
  BPEL
@@ -26,13 +26,17 @@ OMG
26
26
  ORCID
27
27
  OldStyle
28
28
  Organization
29
+ PNG
29
30
  Practitioner
30
31
  RDBMS
31
32
  RGB
33
+ ScienceOS
32
34
  TODOs
33
35
  Textfarbe
34
36
  Treaty
35
37
  UML
38
+ Ulm
39
+ Wikimedia
36
40
  Worten
37
41
  Zcref
38
42
  abbreviationdot
@@ -47,6 +51,7 @@ basewidth
47
51
  basicstyle
48
52
  bei
49
53
  belowskip
54
+ breakatwhitespace
50
55
  breaklines
51
56
  category
52
57
  cls
@@ -125,6 +130,7 @@ tion
125
130
  tt
126
131
  werden
127
132
  wird
133
+ wkrauth
128
134
  wurde
129
135
  xleftmargin
130
136
  zcref
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "filters": {
6
6
  "allowlist": {
7
- "allow": ["/\\bonly\\b/i"]
7
+ "allow": ["/\\bonly\\b/i", "/\\bFinally,/"]
8
8
  }
9
9
  },
10
10
  "rules": {
@@ -10,6 +10,17 @@
10
10
  \label{fig:label}
11
11
  \end{figure}
12
12
  <%- eexample %>
13
+
14
+ Fotos im JPEG- oder PNG-Format werden genauso eingebunden, wie <%- cref %>{fig:jpg} zeigt.
15
+
16
+ <%- bexample %>
17
+ \begin{figure}
18
+ \centering
19
+ \includegraphics[width=.5\linewidth]{figures/ulm-minster.jpg}
20
+ \caption{Ulmer Münster. Foto: wkrauth, CC0, via Wikimedia Commons.}
21
+ \label{fig:jpg}
22
+ \end{figure}
23
+ <%- eexample %>
13
24
  <%- include('floatflt.example.en.tex', this); -%>
14
25
  <% if (documentclass == 'ieee') { -%>
15
26
 
@@ -13,6 +13,17 @@
13
13
  \label{fig:label}
14
14
  \end{figure}
15
15
  <%- eexample %>
16
+
17
+ Photos in JPEG or PNG format are included the same way, as shown in <%- cref %>{fig:jpg}.
18
+
19
+ <%- bexample %>
20
+ \begin{figure}
21
+ \centering
22
+ \includegraphics[width=.5\linewidth]{figures/ulm-minster.jpg}
23
+ \caption{Ulm Minster. Photo: wkrauth, CC0, via Wikimedia Commons.}
24
+ \label{fig:jpg}
25
+ \end{figure}
26
+ <%- eexample %>
16
27
  <%- include('floatflt.example.en.tex', this); -%>
17
28
  <% if (documentclass == 'ieee') { -%>
18
29
 
@@ -7,16 +7,15 @@ Here are some hints:
7
7
 
8
8
  <%- bexample %>
9
9
  In case you write <%- bquote %>application-specific<%- equote %>, then the word will only be hyphenated at the dash.
10
- You can also write \verb1applica\allowbreak{}tion-specific1 (result: applica\allowbreak{}tion-specific), but this is much more effort.
10
+ You can also insert \verb1\allowbreak{}1 into the word, as in applica\allowbreak{}tion-specific, but this is much more effort.
11
11
 
12
12
  <% if (tweakouterquote == "outerquote") { -%>
13
13
  In the net, you will read about that one can use a normal quote sign followed by an equal sign (\verb1"=1) to specify that hyphenation is allowed at other places in the word.
14
14
  Since we use the quote sign for automatic quotation, this is not possible anymore.
15
- Please use the command \verb1\hydash1 for the same purpose.
16
- Example: \verb1application\hydash specific1 (result: application\hydash specific).
15
+ Please use the command \verb1\hydash1 for the same purpose, as in application\hydash specific.
17
16
  <% } else { -%>
18
17
  You can now write words containing hyphens which are hyphenated at other places in the word.
19
- For instance, \verb1application"=specific1 gets application"=specific.
18
+ For that, write \verb1"=1 instead of \verb1-1, as in application"=specific.
20
19
  This is enabled by an additional configuration of the babel package.
21
20
  <% } -%>
22
21
  <%- eexample %>
@@ -7,14 +7,34 @@ $pdflatex = '<%= reallatexcompiler %> <% if (requiresShellEscape) { %>--shell-es
7
7
  $ENV{'TEXINPUTS'} = './tikz-uml//:' . ($ENV{'TEXINPUTS'} // '');
8
8
  <% } -%>
9
9
 
10
- #Use SumatraPDF instead of the default PDF viewer
11
- $pdf_previewer = 'start "C:\Program Files\SumatraPDF\SumatraPDF.exe"';
10
+ #------------------------------------------------------------------------------#
11
+ # compilation
12
12
 
13
- #SumatraPDF updates automatically
13
+ # automatically call lualatex/pdflatex (instead of latex)
14
+ $pdf_mode = 1;
15
+
16
+ # replaces main.pdf by jobname.pdf
17
+ # Note: -pvc may then not find the PDF.
18
+ #$jobname = 'thesis';
19
+
20
+ #------------------------------------------------------------------------------#
21
+ # preview
22
+ # You may put these settings in ~/.latexmkrc instead.
23
+
24
+ # >0 <-> equivalent to -pv
14
25
  $preview_mode = 0;
26
+ # >0 <-> equivalent to -pvc
27
+ #$preview_continuous_mode = 1;
15
28
 
16
- #automatically call lualatex/pdflatex (instead of latex)
17
- $pdf_mode = 1;
29
+ if ($^O eq 'MSWin32') {
30
+ # Use SumatraPDF instead of the default PDF viewer; it reloads the PDF automatically
31
+ $pdf_previewer = 'start "C:\Program Files\SumatraPDF\SumatraPDF.exe"';
32
+ }
33
+ # 'evince' is 'Document Viewer' (GNOME's default)
34
+ #$pdf_previewer = 'evince';
35
+
36
+ #------------------------------------------------------------------------------#
37
+ # bibliography and glossaries
18
38
 
19
39
  # enable deletion of *.bbl when calling "latexmk -c"
20
40
  $bibtex_use = 2;
@@ -33,6 +53,9 @@ sub run_makeglossaries {
33
53
  };
34
54
  }
35
55
 
36
- #remove more files than in the default configuration
56
+ #------------------------------------------------------------------------------#
57
+ # cleanup
58
+
59
+ # remove more files than in the default configuration
37
60
  @generated_exts = qw(acn acr alg aux code fls glg glo glo-abr gls glsdefs idx ind ist lof lol lot out run.xml synctex thm toc tpt upa upb wrt);
38
61
  $clean_ext .= ' %R.ist %R.xdy';
@@ -15,8 +15,8 @@
15
15
  \end{lstlisting}
16
16
  <%- eexample %>
17
17
 
18
- Der zusätzliche Paramter \verb+float+ führt dazu, dass das Listing auch floated.
19
- <%- Cref %>{lst:flXML} zeigt das gleitendede Listing.
18
+ Der zusätzliche Parameter \verb+float+ führt dazu, dass das Listing auch floated.
19
+ <%- Cref %>{lst:flXML} zeigt das gleitende Listing.
20
20
 
21
21
  <%- bexample %>
22
22
  \begin{lstlisting}[
@@ -62,3 +62,7 @@ public class Hello {
62
62
  }
63
63
  \end{lstlisting}
64
64
  <%- eexample %>
65
+ <% if (isThesis) { -%>
66
+
67
+ <%- include('listings.long.example.en.tex', this); -%>
68
+ <% } -%>
@@ -62,3 +62,7 @@ public class Hello {
62
62
  }
63
63
  \end{lstlisting}
64
64
  <%- eexample %>
65
+ <% if (isThesis) { -%>
66
+
67
+ <%- include('listings.long.example.en.tex', this); -%>
68
+ <% } -%>
@@ -0,0 +1,75 @@
1
+ Listings longer than the remaining space continue on the next page if they are \emph{not} floating.
2
+ A floating listing is always placed on a single page.
3
+ <%- Cref %>{lst:long} spans multiple pages.
4
+
5
+ \begin{lstlisting}[
6
+ language=Java,
7
+ caption={Long Java listing spanning multiple pages},
8
+ label={lst:long}]
9
+ public class Squares {
10
+
11
+ /** Returns the square of 1. */
12
+ public int square1() {
13
+ return 1 * 1;
14
+ }
15
+
16
+ /** Returns the square of 2. */
17
+ public int square2() {
18
+ return 2 * 2;
19
+ }
20
+
21
+ /** Returns the square of 3. */
22
+ public int square3() {
23
+ return 3 * 3;
24
+ }
25
+
26
+ /** Returns the square of 4. */
27
+ public int square4() {
28
+ return 4 * 4;
29
+ }
30
+
31
+ /** Returns the square of 5. */
32
+ public int square5() {
33
+ return 5 * 5;
34
+ }
35
+
36
+ /** Returns the square of 6. */
37
+ public int square6() {
38
+ return 6 * 6;
39
+ }
40
+
41
+ /** Returns the square of 7. */
42
+ public int square7() {
43
+ return 7 * 7;
44
+ }
45
+
46
+ /** Returns the square of 8. */
47
+ public int square8() {
48
+ return 8 * 8;
49
+ }
50
+
51
+ /** Returns the square of 9. */
52
+ public int square9() {
53
+ return 9 * 9;
54
+ }
55
+
56
+ /** Returns the square of 10. */
57
+ public int square10() {
58
+ return 10 * 10;
59
+ }
60
+
61
+ /** Returns the square of 11. */
62
+ public int square11() {
63
+ return 11 * 11;
64
+ }
65
+
66
+ /** Returns the square of 12. */
67
+ public int square12() {
68
+ return 12 * 12;
69
+ }
70
+
71
+ public static void main(String[] args) {
72
+ System.out.println(new Squares().square12());
73
+ }
74
+ }
75
+ \end{lstlisting}
@@ -1,7 +1,7 @@
1
1
  <%= heading2 %>{Tables spanning multiple pages}
2
2
 
3
3
  The \href{https://ctan.org/pkg/longtable}{longtable} package typesets tables that automatically break across page boundaries.
4
- The header (\verb+\endhead+) and footer (\verb+\endfoot+) rows are repeated on every page; once enough rows are added, the table spans several pages on its own.
4
+ The header (\verb+\endhead+) and footer (\verb+\endfoot+) rows are repeated on every page; once enough rows are added, the table spans more than one page on its own.
5
5
 
6
6
  <%- bexample %>
7
7
  \begin{longtable}{|l|l|l|}