generator-latex-template 2026.11.3 → 2026.11.9

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.
@@ -120,3 +120,33 @@ formats) catch things a single local `yo` + compile does not. Two that have bitt
120
120
  `\gls` entries language-exclusive breaks the other language's variant with
121
121
  ``Glossary entry `…' has not been defined``. The same single-shared-file logic applies to
122
122
  other `this.fs.copy`'d siblings (`commands.tex`, …).
123
+
124
+ ## `IEEEtranN-doi.bst` is a versioned modification of IEEEtranN.bst
125
+
126
+ `IEEEtran-doi.bst` (+ `IEEEtran-doi.bst.patch`) is the same modification of the plain `IEEEtran.bst`, shipped for
127
+ documents without natbib; the template itself uses the natbib twin. Make every change in both files and keep their
128
+ `doi.bst.version` and `doi.bst.date` equal; the patch of the natbib twin applies to `IEEEtran.bst` except for the
129
+ hunks that name the file (header, banner, `bbl.*` strings, `begin.bib`), which are ported by hand.
130
+
131
+ `generators/app/templates/IEEEtranN-doi.bst` is TeX Live's `IEEEtranN.bst` (1.14, 2015/08/26) plus
132
+ `IEEEtranN-doi.bst.patch`; the patch is the record, the `.bst` is what the templates ship. The file
133
+ carries its **own** version (`doi.bst.version`/`doi.bst.date` next to Michael Shell's unchanged
134
+ `bst.file.version`), which the BibTeX terminal banner and the first `.bbl` line print, so a `.bbl`
135
+ never claims to come from an unmodified IEEEtranN.bst. When you change the `.bst`:
136
+
137
+ 1. Bump `doi.bst.version` and `doi.bst.date`, and add the change to the version list in the file header.
138
+ 2. Regenerate the patch from TeX Live's original (labels must stay `IEEEtranN.bst`/`IEEEtranN-doi.bst`):
139
+ `cp "$(kpsewhich IEEEtranN.bst)" /tmp && diff -u --label IEEEtranN.bst --label IEEEtranN-doi.bst /tmp/IEEEtranN.bst generators/app/templates/IEEEtranN-doi.bst > generators/app/templates/IEEEtranN-doi.bst.patch`
140
+ (in the TeX Live docker image when the host has no TeX Live); the same with `IEEEtran.bst`/`IEEEtran-doi.bst`.
141
+ 3. Check the result against the IEEE Reference Guide: in a generated IEEE template, build
142
+ `comparison/reference-guide-bibtex.tex` as the `reference-guide` job of `check.yml` does (pdflatex + bibtex,
143
+ jobname `comparison-reference-guide-bibtex`, from the template's root); it shows every guide example next to
144
+ the `.bst` output. The sources `comparison-reference-guide-{bibtex,biblatex}.ieee.{tex,bib}` are vendored
145
+ from the sibling `biblatex-ieee` checkout by `scripts/ieee-reference-guide.py` and never edited by hand
146
+ (the biblatex pair is the same comparison for biblatex-ieee as distributed by TeX Live).
147
+ `scripts/ieee-reference-guide-diff.py <dir> [bibtex|biblatex]` diffs the text of the built PDF example by
148
+ example and prints the counts (version 4: 101 of 145 identical; biblatex-ieee's own patched style: 82; the
149
+ rest are the guide's own inconsistencies or data the fields cannot carry). Do not let the count drop.
150
+ Flaws of the guide itself are reported to IEEE through the IEEE Reference Assistant, <https://refassist.ieee.org/>.
151
+ 4. Keep every `write$` line of `begin.bib` under 79 characters, or BibTeX wraps it and the rest of
152
+ the banner is typeset before the first reference (`req~ieee-bst-banner~1`).
@@ -605,9 +605,16 @@ export default class extends Generator {
605
605
 
606
606
  // The word lists of aspell (.aspell.<lang>.pws), LTeX+ (.vscode/ltex.dictionary.<language>.txt), and
607
607
  // TeXtidote (.textidote.dict) contain the same words. "make dictionaries" merges them in the generated
608
- // repository the same way (sorted like "LC_ALL=C sort -u"), so its first run changes nothing.
608
+ // repository the same way (sorted like "LC_ALL=C sort -u | LC_ALL=C sort -f": ASCII case folded, ties in
609
+ // byte order), so its first run changes nothing. A different order makes the "Update files" bot and the
610
+ // "Dictionaries" workflow rewrite the files in turns.
609
611
  // LTeX+ (VS Code extension, see .vscode/extensions.json) reads its file automatically; "Add to dictionary" writes there.
610
- const sortedUnique = (words) => [...new Set(words)].sort();
612
+ const fold = (word) => word.replace(/[a-z]/g, (c) => c.toUpperCase());
613
+ const byteOrder = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
614
+ const sortedUnique = (words) =>
615
+ [...new Set(words)].sort(
616
+ (a, b) => byteOrder(fold(a), fold(b)) || byteOrder(a, b),
617
+ );
611
618
  const aspellWords = (lang) =>
612
619
  this.fs
613
620
  .read(this.templatePath(`dot.aspell.${lang}.pws`))
@@ -664,6 +671,27 @@ export default class extends Generator {
664
671
  [`comparison-body.${this.props.documentclass}.tex`, "body.tex"],
665
672
  [`comparison-plain.${this.props.documentclass}.tex`, "plain.tex"],
666
673
  ["comparison-build.sh", "build.sh"],
674
+ // IEEE: every example of the IEEE Reference Guide next to the output of IEEEtranN-doi.bst
675
+ ...(this.props.documentclass === "ieee"
676
+ ? [
677
+ [
678
+ "comparison-reference-guide-bibtex.ieee.tex",
679
+ "reference-guide-bibtex.tex",
680
+ ],
681
+ [
682
+ "comparison-reference-guide-bibtex.ieee.bib",
683
+ "reference-guide-bibtex.bib",
684
+ ],
685
+ [
686
+ "comparison-reference-guide-biblatex.ieee.tex",
687
+ "reference-guide-biblatex.tex",
688
+ ],
689
+ [
690
+ "comparison-reference-guide-biblatex.ieee.bib",
691
+ "reference-guide-biblatex.bib",
692
+ ],
693
+ ]
694
+ : []),
667
695
  ]) {
668
696
  this.fs.copyTpl(
669
697
  this.templatePath(src),
@@ -686,6 +714,11 @@ export default class extends Generator {
686
714
  this.templatePath("IEEEtranN-doi.bst"),
687
715
  this.destinationPath("IEEEtranN-doi.bst"),
688
716
  );
717
+ // the same modification of IEEEtran.bst, for documents without natbib (other papers, not this template)
718
+ this.fs.copy(
719
+ this.templatePath("IEEEtran-doi.bst"),
720
+ this.destinationPath("IEEEtran-doi.bst"),
721
+ );
689
722
  }
690
723
 
691
724
  // Photo for the JPEG example in floats.example.*.tex (CC0, see README)
@@ -94,6 +94,22 @@ jobs:
94
94
  echo '```' >> $GITHUB_STEP_SUMMARY
95
95
  texlogsieve <%= filenames.main %>.log | tee -a "$GITHUB_STEP_SUMMARY" || true
96
96
  echo '```' >> $GITHUB_STEP_SUMMARY
97
+ <% if (examples) { -%>
98
+ - name: Install pdftotext
99
+ uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
100
+ with:
101
+ packages: poppler-utils
102
+ version: 1.1 # bumped after a cache saved during an apt mirror outage lacked pdftotext
103
+ <%# [impl->req~ligatures-copyable~1] -%>
104
+ - name: Check that words with ligatures can be copied from the PDF
105
+ # The example "Other features" typesets "workflow" and "dwarflike". A wrong font setup
106
+ # gives "work?ow" or the ligature characters U+FB00 to U+FB06 when the text is copied.
107
+ run: |
108
+ pdftotext <%= filenames.main %>.pdf <%= filenames.main %>.txt
109
+ grep -q workflow <%= filenames.main %>.txt
110
+ grep -q dwarflike <%= filenames.main %>.txt
111
+ ! LC_ALL=C grep -qP '\xef\xac[\x80-\x86]' <%= filenames.main %>.txt
112
+ <% } -%>
97
113
  <% } -%>
98
114
  <% if (githubpublish) { const templateRepo = { acmart: "acm-enhanced", ieee: "ieee-enhanced", lncs: "lncs-enhanced", "scientific-thesis": "scientific-thesis-template", ustutt: "uni-stuttgart-dissertation-template", mwe: "markdown-latex-quickstart" }[documentclass]; -%>
99
115
  - name: Install pdftoppm and ImageMagick
@@ -104,7 +120,7 @@ jobs:
104
120
  uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
105
121
  with:
106
122
  packages: poppler-utils imagemagick
107
- version: 1.0
123
+ version: 1.1 # bumped after a cache saved during an apt mirror outage lacked the packages
108
124
  execute_install_scripts: true # creates the "compare" alternative
109
125
  <%# [impl->req~pdf-diff-weekly~1] -%>
110
126
  - name: Compare with the published PDF
@@ -176,7 +192,7 @@ jobs:
176
192
  uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
177
193
  with:
178
194
  packages: poppler-utils imagemagick
179
- version: 1.0
195
+ version: 1.1 # bumped after a cache saved during an apt mirror outage lacked the packages
180
196
  execute_install_scripts: true # creates the "convert" alternative
181
197
  - run: ./comparison/build.sh
182
198
  - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
@@ -186,6 +202,34 @@ jobs:
186
202
  comparison-*.png
187
203
  comparison-*.pdf
188
204
  <% } -%>
205
+ <% if (githubpublish && (documentclass == "ieee")) { -%>
206
+ reference-guide:
207
+ # Every example of the IEEE Reference Guide next to the output of IEEEtranN-doi.bst and of biblatex-ieee (see the README)
208
+ name: reference-guide (comparison/reference-guide-*.tex)
209
+ if: github.repository == 'latextemplates/ieee-enhanced'
210
+ runs-on: ubuntu-latest
211
+ steps:
212
+ - name: Set up Git repository
213
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
214
+ - name: Install TeX Live
215
+ uses: zauguin/install-texlive@c9f3ea3d51b2e04d092c4f9d208a19542d5dabcf # v4.5.0
216
+ with:
217
+ package_file: '${{ github.workspace }}/Texlivefile'
218
+ texlive_version: <%= texlive %>
219
+ - name: Prepare latexmk
220
+ run: |
221
+ updmap -sys
222
+ texhash
223
+ tlmgr generate language --rebuild-sys
224
+ - name: Typeset with IEEEtranN-doi.bst (pdflatex + bibtex)
225
+ run: latexmk -pdf -pdflatex='pdflatex %O %S' -bibtex -interaction=nonstopmode -jobname=comparison-reference-guide-bibtex comparison/reference-guide-bibtex.tex
226
+ - name: Typeset with biblatex-ieee as distributed (lualatex + biber)
227
+ run: latexmk -lualatex -interaction=nonstopmode -jobname=comparison-reference-guide-biblatex comparison/reference-guide-biblatex.tex
228
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
229
+ with:
230
+ name: reference-guide
231
+ path: comparison-reference-guide-*.pdf
232
+ <% } -%>
189
233
  <% if (isThesis) { -%>
190
234
  <%# [impl->req~chapter-standalone~1] -%>
191
235
  chapter: