@pretextbook/pretext-html 0.16.0 → 0.17.0

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 (60) hide show
  1. package/README.md +77 -3
  2. package/assets/preview-html.xsl +56 -0
  3. package/assets/upstream.json +2 -2
  4. package/assets/xsl/entities.ent +14 -1
  5. package/assets/xsl/latex/pretext-latex-texstyle.xsl +5 -2
  6. package/assets/xsl/localizations/README.md +1 -1
  7. package/assets/xsl/localizations/af-ZA.xml +5 -6
  8. package/assets/xsl/localizations/bg-BG.xml +5 -6
  9. package/assets/xsl/localizations/ca-ES.xml +5 -6
  10. package/assets/xsl/localizations/cs-CZ.xml +5 -6
  11. package/assets/xsl/localizations/de-DE.xml +108 -108
  12. package/assets/xsl/localizations/en-US.xml +18 -17
  13. package/assets/xsl/localizations/es-ES.xml +5 -6
  14. package/assets/xsl/localizations/fi-FI.xml +5 -6
  15. package/assets/xsl/localizations/fr-CA.xml +5 -6
  16. package/assets/xsl/localizations/fr-FR.xml +5 -6
  17. package/assets/xsl/localizations/hu-HU.xml +5 -6
  18. package/assets/xsl/localizations/it-IT.xml +7 -7
  19. package/assets/xsl/localizations/ku-CKB.xml +5 -6
  20. package/assets/xsl/localizations/nl-NL.xml +5 -6
  21. package/assets/xsl/localizations/pt-BR.xml +4 -5
  22. package/assets/xsl/localizations/pt-PT.xml +4 -5
  23. package/assets/xsl/localizations/zh-HANS.xml +5 -6
  24. package/assets/xsl/pretext-assembly.xsl +154 -29
  25. package/assets/xsl/pretext-beamer.xsl +112 -10
  26. package/assets/xsl/pretext-braille-preprint.xsl +22 -3
  27. package/assets/xsl/pretext-common.xsl +117 -42
  28. package/assets/xsl/pretext-epub.xsl +74 -87
  29. package/assets/xsl/pretext-fo.xsl +115 -41
  30. package/assets/xsl/pretext-html.xsl +333 -102
  31. package/assets/xsl/pretext-latex-classic.xsl +48 -35
  32. package/assets/xsl/pretext-latex-common.xsl +160 -98
  33. package/assets/xsl/pretext-latex.xsl +12 -10
  34. package/assets/xsl/pretext-markdown.xsl +5 -3
  35. package/assets/xsl/pretext-numbers.xsl +28 -2
  36. package/assets/xsl/pretext-revealjs.xsl +44 -2
  37. package/assets/xsl/pretext-runestone-static.xsl +27 -4
  38. package/assets/xsl/pretext-runestone.xsl +112 -0
  39. package/assets/xsl/pretext-text.xsl +21 -14
  40. package/assets/xsl/publisher-variables.xsl +187 -47
  41. package/assets/xsl/support/extract-math.xsl +22 -2
  42. package/assets/xsl/support/package-math.xsl +9 -8
  43. package/assets/xsl/utilities/report-publisher-variables.xsl +4 -0
  44. package/assets/xsl-bundle.json +1 -1
  45. package/dist/cli-C0JwLhuv.js +1456 -0
  46. package/dist/cli.js +3 -3
  47. package/dist/html-static.d.ts +2 -2
  48. package/dist/index.browser.d.ts +9 -4
  49. package/dist/index.browser.js +1151 -841
  50. package/dist/index.d.ts +9 -3
  51. package/dist/index.js +50 -46
  52. package/dist/publication.d.ts +21 -0
  53. package/dist/renderer.d.ts +134 -13
  54. package/dist/skeleton.d.ts +68 -7
  55. package/dist/source-cache.d.ts +36 -0
  56. package/dist/sourcemap.d.ts +11 -1
  57. package/dist/subtree.d.ts +79 -0
  58. package/dist/xinclude.d.ts +40 -3
  59. package/package.json +1 -1
  60. package/dist/cli-ox-z2TCZ.js +0 -1145
@@ -24,10 +24,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
24
24
  <!-- it-IT, Italian (Italy) -->
25
25
  <!-- Valerio Monti, gedeonedepaperoni@gmail.com, 2020-07-27 -->
26
26
 
27
+ <!-- Quotation marks: the English style is a deliberate choice for -->
28
+ <!-- Italian, not a default (Valerio Monti, pretext-dev, 2026-09-02) -->
27
29
  <locale language="it-IT" direction="ltr"
28
30
  quote-primary="english-double" quote-secondary="english-single">
29
31
  <!-- THEOREM-LIKE blocks -->
30
- <!-- The english quotation style above is just a default, it needs adjustment -->
31
32
  <localization string-id='theorem'>Teorema</localization>
32
33
  <localization string-id='corollary'>Corollario</localization>
33
34
  <localization string-id='lemma'>Lemma</localization>
@@ -144,10 +145,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
144
145
  <localization string-id='fragment'>Porzione</localization>
145
146
  <!-- Parts of an exercise and its solution -->
146
147
  <!-- See the en-US file for a detailed explanation of the words for exercises -->
147
- <localization string-id='divisionalexercise'>Esercizio</localization>
148
- <localization string-id='inlineexercise'>Punto di controllo</localization>
149
- <localization string-id='worksheetexercise'>Esercizio in scheda didattica</localization>
150
- <localization string-id='readingquestion'>Domanda di comprensione del testo</localization>
148
+ <localization string-id='exercise-divisional'>Esercizio</localization>
149
+ <localization string-id='exercise-inline'>Punto di controllo</localization>
150
+ <localization string-id='exercise-worksheet'>Esercizio in scheda didattica</localization>
151
+ <localization string-id='exercise-reading'>Domanda di comprensione del testo</localization>
151
152
  <localization string-id='webwork'>WeBWorK</localization>
152
153
  <localization string-id='hint'>Suggerimento</localization>
153
154
  <localization string-id='answer'>Risposta</localization>
@@ -232,7 +233,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
232
233
  <localization string-id='permalink-tooltip'>Copia titolo e permalink per</localization>
233
234
  <localization string-id='calculator'>Calcolatrice</localization>
234
235
  <localization string-id='evaluate'>Calcola</localization>
235
- <localization string-id='code'>Codice</localization>
236
236
  <localization string-id='instructions'>Istruzioni</localization>
237
237
  <localization string-id='correct'>Giusto</localization>
238
238
  <localization string-id='incorrect'>Sbagliato</localization>
@@ -245,7 +245,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
245
245
  <localization string-id='reset'>Azzera</localization>
246
246
  <localization string-id='array'>tabella</localization>
247
247
  <localization string-id="papersize">Formato carta</localization>
248
- <localization string-id="printing-options">Opzioni di stampa addizionali</localization>
248
+ <localization string-id="printing-options">Opzioni di stampa</localization>
249
249
  <localization string-id="hide-hints">Nascondi suggerimenti</localization>
250
250
  <localization string-id="hide-answers">Nascondi risposte</localization>
251
251
  <localization string-id="hide-solutions">Nascondi soluzioni</localization>
@@ -143,10 +143,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
143
143
  <localization string-id='pre'>بلۆکی کۆد</localization>
144
144
  <localization string-id='fragment'>پارچە</localization>
145
145
  <!-- Parts of an exercise and its solution -->
146
- <localization string-id='divisionalexercise'>مەشق</localization>
147
- <localization string-id='inlineexercise'>خاڵی پشکنین</localization>
148
- <localization string-id='worksheetexercise'>پەڕەکاری ڕاهێنانەکان</localization>
149
- <localization string-id='readingquestion'>پرسیارەکانی خوێندنەوە</localization>
146
+ <localization string-id='exercise-divisional'>مەشق</localization>
147
+ <localization string-id='exercise-inline'>خاڵی پشکنین</localization>
148
+ <localization string-id='exercise-worksheet'>پەڕەکاری ڕاهێنانەکان</localization>
149
+ <localization string-id='exercise-reading'>پرسیارەکانی خوێندنەوە</localization>
150
150
  <localization string-id='webwork'>WeBWorK</localization>
151
151
  <localization string-id='hint'>یارمەتی</localization>
152
152
  <localization string-id='answer'>وەڵام</localization>
@@ -235,7 +235,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
235
235
  <localization string-id='permalink-tooltip'>Copy heading and permalink for</localization>
236
236
  <!-- <localization string-id='calculator'>Calculator</localization> -->
237
237
  <localization string-id='evaluate'>نرخ دۆزینەوە</localization>
238
- <!-- <localization string-id='code'>Code</localization> -->
239
238
  <localization string-id='instructions'>ڕێنماییەکان</localization>
240
239
  <localization string-id='correct'>ڕاست</localization>
241
240
  <localization string-id='incorrect'>ناڕاست</localization>
@@ -248,7 +247,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
248
247
  <localization string-id='reset'>ڕێکخستنەوە</localization>
249
248
  <localization string-id='array'>ڕیزکراو</localization>
250
249
  <!-- <localization string-id="papersize">Paper size</localization> -->
251
- <!-- <localization string-id="printing-options">Additional printing options</localization> -->
250
+ <!-- <localization string-id="printing-options">Printing options</localization> -->
252
251
  <!-- <localization string-id="hide-hints">Hide hints</localization> -->
253
252
  <!-- <localization string-id="hide-answers">Hide answers</localization> -->
254
253
  <!-- <localization string-id="hide-solutions">Hide solutions</localization> -->
@@ -143,10 +143,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
143
143
  <localization string-id='pre'>Codeblok</localization>
144
144
  <localization string-id='fragment'>Fragment</localization>
145
145
  <!-- Parts of an exercise and its solution -->
146
- <localization string-id='divisionalexercise'>Oefening</localization>
147
- <localization string-id='inlineexercise'>Controlepunt</localization>
148
- <localization string-id='worksheetexercise'>Werkblad-oefening</localization>
149
- <localization string-id='readingquestion'>Leesvraag</localization>
146
+ <localization string-id='exercise-divisional'>Oefening</localization>
147
+ <localization string-id='exercise-inline'>Controlepunt</localization>
148
+ <localization string-id='exercise-worksheet'>Werkblad-oefening</localization>
149
+ <localization string-id='exercise-reading'>Leesvraag</localization>
150
150
  <localization string-id='webwork'>WeBWorK</localization>
151
151
  <localization string-id='hint'>Tip</localization>
152
152
  <localization string-id='answer'>Antwoord</localization>
@@ -235,7 +235,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
235
235
  <localization string-id='permalink-tooltip'>Copy heading and permalink for</localization>
236
236
  <!-- <localization string-id='calculator'>Calculator</localization> -->
237
237
  <localization string-id='evaluate'>Evalueer</localization>
238
- <!-- <localization string-id='code'>Code</localization> -->
239
238
  <!-- <localization string-id='instructions'>Instructions</localization> -->
240
239
  <localization string-id='correct'>Correct</localization>
241
240
  <localization string-id='incorrect'>Niet correct</localization>
@@ -248,7 +247,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
248
247
  <localization string-id='reset'>Resetten</localization>
249
248
  <!-- <localization string-id='array'>array</localization> -->
250
249
  <!-- <localization string-id="papersize">Paper size</localization> -->
251
- <!-- <localization string-id="printing-options">Additional printing options</localization> -->
250
+ <!-- <localization string-id="printing-options">Printing options</localization> -->
252
251
  <!-- <localization string-id="hide-hints">Hide hints</localization> -->
253
252
  <!-- <localization string-id="hide-answers">Hide answers</localization> -->
254
253
  <!-- <localization string-id="hide-solutions">Hide solutions</localization> -->
@@ -151,12 +151,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
151
151
  <localization string-id='fragment'>Fragmento</localization>
152
152
  <!-- Parts of an exercise and its solution -->
153
153
  <!-- See the en-US file for a detailed explanation of the words for exercises -->
154
- <localization string-id='divisionalexercise'>Exercício</localization>
154
+ <localization string-id='exercise-divisional'>Exercício</localization>
155
155
  <!-- Translation needed for Brazilian Portugese -->
156
156
  <!-- See en-US file for distinctions here, do not repeat previous translation -->
157
- <localization string-id='inlineexercise'>Exercício de Verificação</localization>
158
- <localization string-id='worksheetexercise'>Exercício da Lista</localization>
159
- <localization string-id='readingquestion'>Exercício de Interpretação</localization>
157
+ <localization string-id='exercise-inline'>Exercício de Verificação</localization>
158
+ <localization string-id='exercise-worksheet'>Exercício da Lista</localization>
159
+ <localization string-id='exercise-reading'>Exercício de Interpretação</localization>
160
160
  <localization string-id='webwork'>WeBWorK</localization>
161
161
  <localization string-id='hint'>Dica</localization>
162
162
  <localization string-id='answer'>Resposta</localization>
@@ -248,7 +248,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
248
248
  <!-- This needs to be defined to *something* (English) -->
249
249
  <!-- Translate at first opportunity, please -->
250
250
  <localization string-id='evaluate'>Executar</localization>
251
- <!-- <localization string-id='code'>Code</localization> -->
252
251
  <localization string-id='instructions'>Instruções</localization>
253
252
  <localization string-id='correct'>Correto</localization>
254
253
  <localization string-id='incorrect'>Incorreto</localization>
@@ -149,12 +149,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
149
149
  <!-- <localization string-id='fragment'>Fragment</localization> -->
150
150
  <!-- Parts of an exercise and its solution -->
151
151
  <!-- See the en-US file for a detailed explanation of the words for exercises -->
152
- <localization string-id='divisionalexercise'>Exercício</localization>
152
+ <localization string-id='exercise-divisional'>Exercício</localization>
153
153
  <!-- Translation needed for Portugal Portugese -->
154
154
  <!-- See en-US file for distinctions here, do not repeat previous translation -->
155
- <!-- <localization string-id='inlineexercise'>Checkpoint</localization> -->
156
- <!-- <localization string-id='worksheetexercise'>Worksheet Exercise</localization> -->
157
- <!-- <localization string-id='readingquestion'>Reading Question</localization> -->
155
+ <!-- <localization string-id='exercise-inline'>Checkpoint</localization> -->
156
+ <!-- <localization string-id='exercise-worksheet'>Worksheet Exercise</localization> -->
157
+ <!-- <localization string-id='exercise-reading'>Reading Question</localization> -->
158
158
  <localization string-id='webwork'>WeBWorK</localization>
159
159
  <localization string-id='hint'>Dica</localization>
160
160
  <localization string-id='answer'>Resposta</localization>
@@ -252,7 +252,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
252
252
  <!-- This needs to be defined to *something* (English) -->
253
253
  <!-- Translate at first opportunity, please -->
254
254
  <localization string-id='evaluate'>Evaluate</localization>
255
- <!-- <localization string-id='code'>Code</localization> -->
256
255
  <!-- <localization string-id='instructions'>Instructions</localization> -->
257
256
  <!-- <localization string-id='correct'>Correct</localization> -->
258
257
  <!-- <localization string-id='incorrect'>Incorrect</localization> -->
@@ -141,10 +141,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
141
141
  <localization string-id='pre'>代码块</localization>
142
142
  <localization string-id='fragment'>代码片段</localization>
143
143
  <!-- Parts of an exercise and its solution -->
144
- <localization string-id='divisionalexercise'>练习</localization>
145
- <localization string-id='inlineexercise'>检查点</localization>
146
- <localization string-id='worksheetexercise'>工作单练习</localization>
147
- <localization string-id='readingquestion'>问题</localization>
144
+ <localization string-id='exercise-divisional'>练习</localization>
145
+ <localization string-id='exercise-inline'>检查点</localization>
146
+ <localization string-id='exercise-worksheet'>工作单练习</localization>
147
+ <localization string-id='exercise-reading'>问题</localization>
148
148
  <localization string-id='webwork'>WeBWorK</localization>
149
149
  <localization string-id='hint'>提示</localization>
150
150
  <localization string-id='answer'>答案</localization>
@@ -229,7 +229,6 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
229
229
  <!-- <localization string-id='permalink-tooltip'>Copy heading and permalink for</localization> -->
230
230
  <!-- <localization string-id='calculator'>Calculator</localization> -->
231
231
  <localization string-id='evaluate'>求解</localization>
232
- <!-- <localization string-id='code'>Code</localization> -->
233
232
  <localization string-id='instructions'>说明</localization>
234
233
  <localization string-id='correct'>正确</localization>
235
234
  <localization string-id='incorrect'>错误</localization>
@@ -242,7 +241,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
242
241
  <localization string-id='reset'>重置</localization>
243
242
  <localization string-id='array'>数组</localization>
244
243
  <!-- <localization string-id="papersize">Paper size</localization> -->
245
- <!-- <localization string-id="printing-options">Additional printing options</localization> -->
244
+ <!-- <localization string-id="printing-options">Printing options</localization> -->
246
245
  <!-- <localization string-id="hide-hints">Hide hints</localization> -->
247
246
  <!-- <localization string-id="hide-answers">Hide answers</localization> -->
248
247
  <!-- <localization string-id="hide-solutions">Hide solutions</localization> -->
@@ -431,8 +431,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
431
431
  <!-- stylesheet older than the script that wrote it, and the mismatch -->
432
432
  <!-- would surface as substitutions quietly coming out wrong instead of -->
433
433
  <!-- as a statement of what is actually the matter. -->
434
+ <!-- The file is read only if this tree holds something the lookups below -->
435
+ <!-- will substitute, the same elements that open the file there. A -->
436
+ <!-- "setup" alone (such as "var" with "condition") is enough to name the -->
437
+ <!-- file, but has nothing to substitute and so the file is never made. -->
434
438
  <xsl:template match="/" mode="dynamic-substitution">
435
- <xsl:if test="($exercise-style = 'static') and not($b-extracting) and not($dynamic-substitutions-file = '')">
439
+ <xsl:if test="($exercise-style = 'static') and not($b-extracting) and not($dynamic-substitutions-file = '') and (.//fillin[@ansobj] or .//eval[@obj])">
436
440
  <xsl:variable name="recorded" select="document($dynamic-substitutions-file,$original)/*/@version"/>
437
441
  <!-- A missing @version is an older file, and is silent: the -->
438
442
  <!-- representation template already falls back for those. Only a -->
@@ -1159,35 +1163,36 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1159
1163
  <!-- $b-using-csl-styles: a consequence of opting in via publisher file -->
1160
1164
  <!-- $b-extracting-biblio: set here and overridden in the extraction stylesheet -->
1161
1165
 
1166
+ <!-- The generated file is only consulted in a conversion (extraction -->
1167
+ <!-- is making the file, not using it), with CSL styles in use, of a -->
1168
+ <!-- document that has references to replace. A stylesheet with no -->
1169
+ <!-- use for the file (the publisher variable report) overrides this. -->
1170
+ <xsl:variable name="b-consulting-csl-file" select="$b-using-csl-styles and not($b-extracting-biblio) and boolean($original//backmatter/references[not(@source)])"/>
1171
+
1162
1172
  <!-- two error conditions -->
1163
- <!-- 2025-08-13: this variable is always false -->
1173
+ <!-- The generated file is made on request, so is often absent. The -->
1174
+ <!-- xsltproc executable reads a missing file as an empty node-set, -->
1175
+ <!-- while lxml would halt, so the Python xsltproc() (in common.py) -->
1176
+ <!-- supplies a stand-in document for it instead. Either way, no -->
1177
+ <!-- "pi:csl-references" element is found. -->
1164
1178
  <xsl:variable name="missing-csl-file">
1165
1179
  <xsl:choose>
1166
1180
  <!-- can't be missing if we don't need it, and we -->
1167
1181
  <!-- don't induce panic by looking for it, when it -->
1168
1182
  <!-- isn't called for, and getting ominous warnings -->
1169
- <xsl:when test="not($b-using-csl-styles)">
1183
+ <xsl:when test="not($b-consulting-csl-file)">
1170
1184
  <xsl:text>no</xsl:text>
1171
1185
  </xsl:when>
1172
- <xsl:otherwise>
1186
+ <!-- since we build the file, condition on the size of -->
1187
+ <!-- this node-set: one (good) or none (bad, missing) -->
1188
+ <xsl:when test="count(document($csl-file, $original)/pi:csl-references) = 1">
1173
1189
  <xsl:text>no</xsl:text>
1174
- <!-- this is only a test, variable is local and not retained -->
1175
- <!-- <xsl:variable name="the-references" -->
1176
- <!-- select="document($csl-file, $original)/pi:csl-references"/> -->
1177
- <!-- since we build the file, condiition on the size of -->
1178
- <!-- this node-set: one (good) or none (bad, missing) -->
1179
- <!-- <xsl:choose> -->
1180
- <!-- file looks good -->
1181
- <!-- <xsl:when test="count($the-references) = 1"> -->
1182
- <!-- <xsl:text>no</xsl:text> -->
1183
- <!-- </xsl:when> -->
1184
- <!-- nothing came of document() -->
1185
- <!-- <xsl:otherwise> -->
1186
- <!-- <xsl:text>yes</xsl:text> -->
1187
- <!-- and we take the opportunity to say so, just once, and early on -->
1188
- <!-- <xsl:message>PTX:ERROR: your publisher file indicates the use of a Citation Stylesheet Language (CSL) specification for references, but we have not located your file of generated references and citations at "<xsl:value-of select="$csl-file"/>". We will fall back to default processing in order to proceed.</xsl:message> -->
1189
- <!-- </xsl:otherwise> -->
1190
- <!-- </xsl:choose> -->
1190
+ </xsl:when>
1191
+ <!-- nothing came of document() -->
1192
+ <xsl:otherwise>
1193
+ <xsl:text>yes</xsl:text>
1194
+ <!-- and we take the opportunity to say so, just once, and early on -->
1195
+ <xsl:message>PTX:FALLBACK: your publisher file indicates the use of a Citation Style Language (CSL) style for references ("<xsl:value-of select="$csl-style-file"/>"), perhaps by way of a journal, but we have not located your file of generated references and citations at "<xsl:value-of select="$csl-file"/>". Generate the "references" assets to create it. We will fall back to default processing in order to proceed.</xsl:message>
1191
1196
  </xsl:otherwise>
1192
1197
  </xsl:choose>
1193
1198
  </xsl:variable>
@@ -1202,7 +1207,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1202
1207
  <xsl:choose>
1203
1208
  <!-- we do not warning at the end of this template, -->
1204
1209
  <!-- just because the file itself does not exist -->
1205
- <xsl:when test="not($b-using-csl-styles) or $missing-csl-file">
1210
+ <xsl:when test="not($b-consulting-csl-file) or $b-missing-csl-file">
1206
1211
  <xsl:text>no</xsl:text>
1207
1212
  </xsl:when>
1208
1213
  <!-- now we are using CSL styles and we do have a file to interrogate -->
@@ -1221,7 +1226,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1221
1226
  <xsl:otherwise>
1222
1227
  <xsl:text>yes</xsl:text>
1223
1228
  <!-- and we take the opportunity to say so, just once, and early on -->
1224
- <xsl:message>PTX:WARNING: your publisher file indicates the use of one Citation Stylesheet Language (CSL) specification for references ("<xsl:value-of select="$csl-style-file"/>"), but your file of generated references and citations at "<xsl:value-of select="$csl-file"/>" was built using a different CSL style file ("<xsl:value-of select="$csl-style-file-for-generated"/>"). We will fall back to default processing in order to proceed.</xsl:message>
1229
+ <xsl:message>PTX:WARNING: your publisher file indicates the use of one Citation Style Language (CSL) specification for references ("<xsl:value-of select="$csl-style-file"/>"), but your file of generated references and citations at "<xsl:value-of select="$csl-file"/>" was built using a different CSL style file ("<xsl:value-of select="$csl-style-file-for-generated"/>"). We will fall back to default processing in order to proceed.</xsl:message>
1225
1230
  </xsl:otherwise>
1226
1231
  </xsl:choose>
1227
1232
  </xsl:otherwise>
@@ -1238,8 +1243,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1238
1243
  <xsl:template match="backmatter/references[not(@source)]" mode="assembly">
1239
1244
  <xsl:choose>
1240
1245
  <!-- duplicate for biblio extraction process or if using -->
1241
- <!-- default (simplistic) PreTeXt bibliography support -->
1242
- <xsl:when test="$b-extracting-biblio or not($b-using-csl-styles)">
1246
+ <!-- default (simplistic) PreTeXt bibliography support, -->
1247
+ <!-- or any other pass not consulting the generated file -->
1248
+ <xsl:when test="not($b-consulting-csl-file)">
1243
1249
  <xsl:copy>
1244
1250
  <xsl:apply-templates select="node()|@*" mode="assembly"/>
1245
1251
  </xsl:copy>
@@ -1332,7 +1338,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1332
1338
  <!-- Note: not using CSL styles immediately determines that -->
1333
1339
  <!-- this "xrref" is not a "biblio target" and a copy is -->
1334
1340
  <!-- made here, immediately as well -->
1335
- <xsl:when test="not($b-is-biblio-target) or $b-extracting-biblio">
1341
+ <!-- A missing or mismatched generated file is met the same -->
1342
+ <!-- way here as with the "references" division above: keep -->
1343
+ <!-- the author's "xref", so citations and bibliography both -->
1344
+ <!-- fall back to default processing, together -->
1345
+ <xsl:when test="not($b-is-biblio-target) or not($b-consulting-csl-file) or $b-missing-csl-file or $b-style-file-mismatch">
1336
1346
  <xsl:copy>
1337
1347
  <xsl:apply-templates select="node()|@*" mode="assembly"/>
1338
1348
  </xsl:copy>
@@ -1342,7 +1352,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1342
1352
  <xsl:variable name="the-xref-id">
1343
1353
  <xsl:value-of select="@pi:original-id"/>
1344
1354
  </xsl:variable>
1345
- <xsl:variable name="matched-citation" select="document('gen/references/csl-bibliography.xml', $original)/pi:csl-references/pi:csl-citation[@xml:id = $the-xref-id]"/>
1355
+ <!-- $csl-file is defined in the publisher-variables stylesheet -->
1356
+ <xsl:variable name="matched-citation" select="document($csl-file, $original)/pi:csl-references/pi:csl-citation[@xml:id = $the-xref-id]"/>
1346
1357
  <xsl:copy-of select="$matched-citation"/>
1347
1358
  <!-- WARN ON UNMATCHED -->
1348
1359
  </xsl:otherwise>
@@ -1379,10 +1390,37 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
1379
1390
  <xsl:value-of select="parent::match/@order"/>
1380
1391
  </xsl:attribute>
1381
1392
  </xsl:if>
1382
- <xsl:apply-templates select="node()" mode="assembly"/>
1393
+ <xsl:apply-templates select="." mode="cardsort-card-assembly"/>
1394
+ </xsl:copy>
1395
+ </xsl:template>
1396
+
1397
+ <xsl:template match="cardsort/match/response" mode="assembly">
1398
+ <xsl:copy>
1399
+ <xsl:apply-templates select="@*" mode="assembly"/>
1400
+ <xsl:apply-templates select="." mode="cardsort-card-assembly"/>
1383
1401
  </xsl:copy>
1384
1402
  </xsl:template>
1385
1403
 
1404
+ <!-- Experimental, see "debug.advanced.feedback": a card may have a -->
1405
+ <!-- "statement" and a "feedback". Unless the experiment is on, -->
1406
+ <!-- the card is just the content of its "statement", and any -->
1407
+ <!-- "feedback" is dropped, so is never seen by any conversion. -->
1408
+ <xsl:template match="cardsort/match/premise|cardsort/match/response" mode="cardsort-card-assembly">
1409
+ <xsl:choose>
1410
+ <xsl:when test="not($b-debug-advanced-feedback) and statement">
1411
+ <xsl:apply-templates select="statement/node()" mode="assembly"/>
1412
+ </xsl:when>
1413
+ <xsl:otherwise>
1414
+ <xsl:apply-templates select="node()" mode="assembly"/>
1415
+ </xsl:otherwise>
1416
+ </xsl:choose>
1417
+ </xsl:template>
1418
+
1419
+ <!-- The deprecated "matches" form does not get this new feature -->
1420
+ <xsl:template match="matches/match/premise" mode="cardsort-card-assembly">
1421
+ <xsl:apply-templates select="node()" mode="assembly"/>
1422
+ </xsl:template>
1423
+
1386
1424
  <!-- WeBWorK @copy resolution -->
1387
1425
 
1388
1426
  <!-- A "webwork" with a @copy attribute is a lightweight reference -->
@@ -2726,6 +2764,57 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2726
2764
  </xsl:attribute>
2727
2765
  </xsl:template>
2728
2766
 
2767
+ <!-- 2026-09-22 A type of "exercise" is named as a publication file -->
2768
+ <!-- names it, as "exercise-inline" and so on, in a "rename" and in -->
2769
+ <!-- "list-of/@elements" alike. An older one-word name is upgraded -->
2770
+ <!-- here. "divisionexercise", which only "list-of" ever accepted, -->
2771
+ <!-- joins it, so that one type of "exercise" has one name. -->
2772
+ <xsl:template match="rename/@element" mode="repair">
2773
+ <xsl:attribute name="element">
2774
+ <xsl:call-template name="exercise-type-name">
2775
+ <xsl:with-param name="name" select="string(.)"/>
2776
+ </xsl:call-template>
2777
+ </xsl:attribute>
2778
+ </xsl:template>
2779
+
2780
+ <xsl:template match="list-of/@elements" mode="repair">
2781
+ <xsl:attribute name="elements">
2782
+ <xsl:for-each select="str:tokenize(., ', ')">
2783
+ <xsl:if test="position() != 1">
2784
+ <xsl:text> </xsl:text>
2785
+ </xsl:if>
2786
+ <xsl:call-template name="exercise-type-name">
2787
+ <xsl:with-param name="name" select="string(.)"/>
2788
+ </xsl:call-template>
2789
+ </xsl:for-each>
2790
+ </xsl:attribute>
2791
+ </xsl:template>
2792
+
2793
+ <!-- The current name of a type of "exercise", given whatever name an -->
2794
+ <!-- author wrote for it. Any other name, an ordinary element among -->
2795
+ <!-- them, passes through untouched. -->
2796
+ <xsl:template name="exercise-type-name">
2797
+ <xsl:param name="name"/>
2798
+
2799
+ <xsl:choose>
2800
+ <xsl:when test="$name = 'inlineexercise'">
2801
+ <xsl:text>exercise-inline</xsl:text>
2802
+ </xsl:when>
2803
+ <xsl:when test="($name = 'divisionalexercise') or ($name = 'divisionexercise')">
2804
+ <xsl:text>exercise-divisional</xsl:text>
2805
+ </xsl:when>
2806
+ <xsl:when test="$name = 'worksheetexercise'">
2807
+ <xsl:text>exercise-worksheet</xsl:text>
2808
+ </xsl:when>
2809
+ <xsl:when test="$name = 'readingquestion'">
2810
+ <xsl:text>exercise-reading</xsl:text>
2811
+ </xsl:when>
2812
+ <xsl:otherwise>
2813
+ <xsl:value-of select="$name"/>
2814
+ </xsl:otherwise>
2815
+ </xsl:choose>
2816
+ </xsl:template>
2817
+
2729
2818
  <!-- 2021-07-02 wrap notation/usage in "m" if not present -->
2730
2819
  <xsl:template match="notation/usage[not(m)]" mode="repair">
2731
2820
  <!-- duplicate "usage" w/ attributes, insert "m" as repair -->
@@ -4146,6 +4235,42 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
4146
4235
  </xsl:copy>
4147
4236
  </xsl:template>
4148
4237
 
4238
+ <!-- A "slide" is numbered as a division is: its @pi:struct is the -->
4239
+ <!-- structure number of its container and its @pi:serial counts -->
4240
+ <!-- slides. The numbering level of divisions decides the form. -->
4241
+ <!-- At level 0 slides are counted through the whole slideshow and -->
4242
+ <!-- there is no structure number. At level 1, only possible with -->
4243
+ <!-- sections, slides are counted within their "section", and its -->
4244
+ <!-- number is the structure number. A slide gets no -->
4245
+ <!-- @pi:block-struct, so blocks within it are numbered by the -->
4246
+ <!-- enclosing division alone. -->
4247
+ <xsl:template match="slide" mode="augment">
4248
+ <xsl:param name="parent-struct"/>
4249
+ <xsl:param name="level"/>
4250
+
4251
+ <xsl:copy>
4252
+ <xsl:attribute name="pi:struct">
4253
+ <xsl:if test="$numbering-maxlevel > 0">
4254
+ <xsl:value-of select="$parent-struct"/>
4255
+ </xsl:if>
4256
+ </xsl:attribute>
4257
+ <xsl:attribute name="pi:serial">
4258
+ <xsl:choose>
4259
+ <xsl:when test="$numbering-maxlevel > 0">
4260
+ <xsl:number count="slide"/>
4261
+ </xsl:when>
4262
+ <xsl:otherwise>
4263
+ <xsl:number count="slide" level="any" from="slideshow"/>
4264
+ </xsl:otherwise>
4265
+ </xsl:choose>
4266
+ </xsl:attribute>
4267
+ <xsl:apply-templates select="node()|@*" mode="augment">
4268
+ <xsl:with-param name="parent-struct" select="$parent-struct"/>
4269
+ <xsl:with-param name="level" select="$level"/>
4270
+ </xsl:apply-templates>
4271
+ </xsl:copy>
4272
+ </xsl:template>
4273
+
4149
4274
  <!-- The top-level division (book, article, ...) is the root of the -->
4150
4275
  <!-- division tree, at level 0, which the catch-all does not record. -->
4151
4276
  <!-- A level-0 numbering scheme counts continuously from the root. -->
@@ -4393,7 +4518,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
4393
4518
  <!-- ("-fn") are single counters; the block families share the "blocks" -->
4394
4519
  <!-- counter unless figure-likes, projects, inline exercises, or open -->
4395
4520
  <!-- problems are set "distinct", each then opening its own counter. -->
4396
- <xsl:template match="book|article|part|chapter|appendix|frontmatter|backmatter|preface|section|subsection|subsubsection|exercises|worksheet|handout|reading-questions|references|glossary|solutions" mode="serial-stamp">
4521
+ <xsl:template match="book|article|slideshow|part|chapter|appendix|frontmatter|backmatter|preface|section|subsection|subsubsection|exercises|worksheet|handout|reading-questions|references|glossary|solutions" mode="serial-stamp">
4397
4522
  <xsl:param name="eq-nodes"/>
4398
4523
  <xsl:param name="fn-nodes"/>
4399
4524
  <xsl:param name="blocks-nodes"/>