@pretextbook/pretext-html 0.6.0 → 0.8.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 (98) hide show
  1. package/README.md +31 -2
  2. package/assets/upstream.json +1 -1
  3. package/assets/xsl/LICENSE-pretext +1 -1
  4. package/assets/xsl/README.md +19 -0
  5. package/assets/xsl/entities.ent +15 -4
  6. package/assets/xsl/extract-asymptote.xsl +5 -5
  7. package/assets/xsl/extract-biblio-csl.xsl +1 -1
  8. package/assets/xsl/extract-datafile.xsl +1 -1
  9. package/assets/xsl/extract-dynamic.xsl +1 -1
  10. package/assets/xsl/extract-identity.xsl +5 -5
  11. package/assets/xsl/extract-interactive.xsl +1 -1
  12. package/assets/xsl/extract-latex-image.xsl +5 -5
  13. package/assets/xsl/extract-mermaid.xsl +1 -1
  14. package/assets/xsl/extract-mom.xsl +5 -5
  15. package/assets/xsl/extract-pg.xsl +1 -1
  16. package/assets/xsl/extract-prefigure.xsl +5 -5
  17. package/assets/xsl/extract-qrcode.xsl +1 -1
  18. package/assets/xsl/extract-runestone-page-template.xsl +1 -1
  19. package/assets/xsl/extract-sageplot.xsl +5 -5
  20. package/assets/xsl/extract-stack.xsl +1 -1
  21. package/assets/xsl/extract-trace.xsl +1 -1
  22. package/assets/xsl/extract-youtube.xsl +5 -5
  23. package/assets/xsl/latex/pretext-latex-AIM.xsl +1 -1
  24. package/assets/xsl/latex/pretext-latex-chaos.xsl +1 -1
  25. package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +1 -1
  26. package/assets/xsl/latex/pretext-latex-guide.xsl +1 -1
  27. package/assets/xsl/localizations/README.md +1 -1
  28. package/assets/xsl/localizations/af-ZA.xml +1 -1
  29. package/assets/xsl/localizations/bg-BG.xml +1 -1
  30. package/assets/xsl/localizations/ca-ES.xml +1 -1
  31. package/assets/xsl/localizations/cs-CZ.xml +1 -1
  32. package/assets/xsl/localizations/de-DE.xml +1 -1
  33. package/assets/xsl/localizations/en-US.xml +1 -1
  34. package/assets/xsl/localizations/es-ES.xml +1 -1
  35. package/assets/xsl/localizations/fi-FI.xml +1 -1
  36. package/assets/xsl/localizations/fr-CA.xml +1 -1
  37. package/assets/xsl/localizations/fr-FR.xml +1 -1
  38. package/assets/xsl/localizations/hu-HU.xml +1 -1
  39. package/assets/xsl/localizations/it-IT.xml +1 -1
  40. package/assets/xsl/localizations/ku-CKB.xml +1 -1
  41. package/assets/xsl/localizations/localizations.xml +1 -1
  42. package/assets/xsl/localizations/nl-NL.xml +1 -1
  43. package/assets/xsl/localizations/pt-BR.xml +1 -1
  44. package/assets/xsl/localizations/pt-PT.xml +1 -1
  45. package/assets/xsl/localizations/zh-HANS.xml +1 -1
  46. package/assets/xsl/pretext-assembly.xsl +66 -7
  47. package/assets/xsl/pretext-basic-html.xsl +5 -5
  48. package/assets/xsl/pretext-braille-preprint.xsl +5 -5
  49. package/assets/xsl/pretext-common.xsl +123 -32
  50. package/assets/xsl/pretext-dynamic.xsl +1 -1
  51. package/assets/xsl/pretext-epub.xsl +94 -85
  52. package/assets/xsl/pretext-fo.xsl +18 -20
  53. package/assets/xsl/pretext-html.xsl +260 -74
  54. package/assets/xsl/pretext-json-manifest.xsl +1 -1
  55. package/assets/xsl/pretext-jupyter.xsl +5 -5
  56. package/assets/xsl/pretext-latex-classic.xsl +1 -1
  57. package/assets/xsl/pretext-latex-common.xsl +35 -22
  58. package/assets/xsl/pretext-latex.xsl +3 -3
  59. package/assets/xsl/pretext-litprog.xsl +9 -2
  60. package/assets/xsl/pretext-markdown.xsl +1 -1
  61. package/assets/xsl/pretext-numbers.xsl +1 -1
  62. package/assets/xsl/pretext-revealjs.xsl +1 -3
  63. package/assets/xsl/pretext-runestone-fitb.xsl +18 -0
  64. package/assets/xsl/pretext-runestone-static.xsl +13 -1
  65. package/assets/xsl/pretext-runestone.xsl +39 -27
  66. package/assets/xsl/pretext-sage-doctest.xsl +18 -0
  67. package/assets/xsl/pretext-solution-manual-latex.xsl +4 -4
  68. package/assets/xsl/pretext-text-utilities.xsl +1 -1
  69. package/assets/xsl/pretext-text.xsl +5 -5
  70. package/assets/xsl/pretext-units.xsl +5 -5
  71. package/assets/xsl/pretext-view-source.xsl +1 -1
  72. package/assets/xsl/pretext-ww-problem-sets.xsl +15 -12
  73. package/assets/xsl/publisher-variables.xsl +160 -133
  74. package/assets/xsl/support/README.md +19 -0
  75. package/assets/xsl/support/extract-math.xsl +1 -1
  76. package/assets/xsl/support/package-math.xsl +1 -1
  77. package/assets/xsl/support/webpack_static_imports.xml +19 -0
  78. package/assets/xsl/tests/README.md +19 -0
  79. package/assets/xsl/tests/null.xml +19 -0
  80. package/assets/xsl/tests/pretext-text-utilities-test.xsl +1 -1
  81. package/assets/xsl/utilities/README.md +19 -0
  82. package/assets/xsl/utilities/author-report.xsl +1 -1
  83. package/assets/xsl/utilities/fix-deprecations.xsl +5 -5
  84. package/assets/xsl/utilities/pretext-enhanced-source.xsl +1 -1
  85. package/assets/xsl/utilities/report-publisher-variables.xsl +5 -5
  86. package/assets/xsl/xml-to-json.xsl +4 -4
  87. package/assets/xsl-bundle.json +1 -1
  88. package/dist/banner.d.ts +51 -0
  89. package/dist/{cli-DF7XOWN7.js → cli-Bcn4t3B1.js} +387 -240
  90. package/dist/cli.js +2 -2
  91. package/dist/html-static.d.ts +20 -0
  92. package/dist/index.browser.d.ts +2 -0
  93. package/dist/index.browser.js +554 -407
  94. package/dist/index.d.ts +2 -0
  95. package/dist/index.js +28 -25
  96. package/dist/renderer.d.ts +18 -1
  97. package/package.json +2 -1
  98. package/assets/xsl/pretext-smc.xsl +0 -492
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2014-2021 Robert A. Beezer
4
+ Copyright (C) 2014-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2015-2021 Robert A. Beezer
4
+ Copyright (C) 2015-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2014-2021 Robert A. Beezer
4
+ Copyright (C) 2014-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -1,7 +1,7 @@
1
1
  <?xml version='1.0'?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2020 Robert A. Beezer
4
+ Copyright (C) 2020-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7
 
@@ -2294,9 +2294,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2294
2294
  <!-- locate the static representation in a file, generated independently -->
2295
2295
  <!-- NB: this filename is relative to the author's source -->
2296
2296
  <xsl:variable name="filename">
2297
- <xsl:if test="$b-managed-directories">
2298
- <xsl:value-of select="$generated-directory-source"/>
2299
- </xsl:if>
2297
+ <xsl:value-of select="$generated-directory-source"/>
2300
2298
  <xsl:text>problems/mom-</xsl:text>
2301
2299
  <xsl:value-of select="myopenmath/@problem"/>
2302
2300
  <xsl:text>.xml</xsl:text>
@@ -2354,9 +2352,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2354
2352
  <!-- locate the static representation in a file, generated independently -->
2355
2353
  <!-- NB: this filename is relative to the author's source in "generated" -->
2356
2354
  <xsl:variable name="filename">
2357
- <xsl:if test="$b-managed-directories">
2358
- <xsl:value-of select="$generated-directory-source"/>
2359
- </xsl:if>
2355
+ <xsl:value-of select="$generated-directory-source"/>
2360
2356
  <xsl:text>stack/</xsl:text>
2361
2357
  <xsl:apply-templates select="stack" mode="assembly-id"/>
2362
2358
  <xsl:text>.ptx</xsl:text>
@@ -2921,6 +2917,67 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2921
2917
  </xsl:element>
2922
2918
  </xsl:template>
2923
2919
 
2920
+ <!-- 2026-07-30: authored-attribute defaults gather under "defaults" -->
2921
+
2922
+ <!-- A "programs", "parsons", or "cross-references" element, as -->
2923
+ <!-- a child of "docinfo", moves inside a "defaults" element. -->
2924
+ <!-- The first of the trio present builds the container for all, -->
2925
+ <!-- and the same match then suppresses the others. The retired -->
2926
+ <!-- "cross-references" element is renamed "xrefs" on the way in. -->
2927
+ <xsl:template match="docinfo/programs | docinfo/parsons | docinfo/cross-references" mode="repair">
2928
+ <xsl:if test="count(preceding-sibling::programs | preceding-sibling::parsons | preceding-sibling::cross-references) = 0">
2929
+ <xsl:element name="defaults">
2930
+ <xsl:for-each select="../programs | ../parsons | ../cross-references">
2931
+ <xsl:choose>
2932
+ <xsl:when test="self::cross-references">
2933
+ <xsl:element name="xrefs">
2934
+ <xsl:copy-of select="@*"/>
2935
+ </xsl:element>
2936
+ </xsl:when>
2937
+ <xsl:otherwise>
2938
+ <xsl:copy>
2939
+ <xsl:copy-of select="@*"/>
2940
+ </xsl:copy>
2941
+ </xsl:otherwise>
2942
+ </xsl:choose>
2943
+ </xsl:for-each>
2944
+ </xsl:element>
2945
+ </xsl:if>
2946
+ </xsl:template>
2947
+
2948
+ <!-- The old "image-width" element, whose content was the width, -->
2949
+ <!-- becomes a "width" attribute on an "images" element. -->
2950
+ <xsl:template match="docinfo/defaults/image-width" mode="repair">
2951
+ <xsl:element name="images">
2952
+ <xsl:attribute name="width">
2953
+ <xsl:value-of select="normalize-space(.)"/>
2954
+ </xsl:attribute>
2955
+ </xsl:element>
2956
+ </xsl:template>
2957
+
2958
+ <!-- 2026-07-30: an "event" is bibliographic content, so it -->
2959
+ <!-- belongs in "bibinfo", already its home for slideshows. -->
2960
+ <!-- Suppressed at its origin within "docinfo"... -->
2961
+ <xsl:template match="docinfo/event" mode="repair"/>
2962
+
2963
+ <!-- ...and lands in an authored "bibinfo" without its own. -->
2964
+ <xsl:template match="frontmatter/bibinfo[not(event)]" mode="repair">
2965
+ <xsl:copy>
2966
+ <xsl:apply-templates select="@*" mode="repair"/>
2967
+ <xsl:apply-templates select="node()" mode="repair"/>
2968
+ <xsl:apply-templates select="/*/docinfo/event" mode="event-relocate"/>
2969
+ </xsl:copy>
2970
+ </xsl:template>
2971
+
2972
+ <!-- A faithful copy, since the "repair" mode on the same -->
2973
+ <!-- element is its suppression at the original location. -->
2974
+ <xsl:template match="docinfo/event" mode="event-relocate">
2975
+ <xsl:copy>
2976
+ <xsl:apply-templates select="@*" mode="repair"/>
2977
+ <xsl:apply-templates select="node()" mode="repair"/>
2978
+ </xsl:copy>
2979
+ </xsl:template>
2980
+
2924
2981
  <!-- 2024-10-29: program is reworked -->
2925
2982
 
2926
2983
  <!-- Add code element around text in program when missing -->
@@ -2995,6 +3052,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2995
3052
  <xsl:apply-templates select="titlepage/date" mode="repair"/>
2996
3053
  <!-- for slides, we allowed an "event" -->
2997
3054
  <xsl:apply-templates select="titlepage/event" mode="repair"/>
3055
+ <!-- 2026-07-30: an "event" may also arrive from "docinfo" -->
3056
+ <xsl:apply-templates select="/*/docinfo/event[not(current()/titlepage/event)]" mode="event-relocate"/>
2998
3057
  <xsl:apply-templates select="colophon/credit" mode="repair"/>
2999
3058
  <xsl:apply-templates select="colophon/edition" mode="repair"/>
3000
3059
  <xsl:apply-templates select="colophon/website" mode="repair"/>
@@ -1,22 +1,22 @@
1
1
  <?xml version='1.0'?> <!-- As XML file -->
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2013 Robert A. Beezer
4
+ Copyright (C) 2013-2026 Robert A. Beezer
5
5
 
6
- This file is part of MathBook XML.
6
+ This file is part of PreTeXt.
7
7
 
8
- MathBook XML is free software: you can redistribute it and/or modify
8
+ PreTeXt is free software: you can redistribute it and/or modify
9
9
  it under the terms of the GNU General Public License as published by
10
10
  the Free Software Foundation, either version 2 or version 3 of the
11
11
  License (at your option).
12
12
 
13
- MathBook XML is distributed in the hope that it will be useful,
13
+ PreTeXt is distributed in the hope that it will be useful,
14
14
  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
16
  GNU General Public License for more details.
17
17
 
18
18
  You should have received a copy of the GNU General Public License
19
- along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
19
+ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
20
20
  *********************************************************************-->
21
21
 
22
22
  <!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
@@ -1,22 +1,22 @@
1
1
  <?xml version='1.0'?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2018 Robert A. Beezer
4
+ Copyright (C) 2018-2026 Robert A. Beezer
5
5
 
6
- This file is part of MathBook XML.
6
+ This file is part of PreTeXt.
7
7
 
8
- MathBook XML is free software: you can redistribute it and/or modify
8
+ PreTeXt is free software: you can redistribute it and/or modify
9
9
  it under the terms of the GNU General Public License as published by
10
10
  the Free Software Foundation, either version 2 or version 3 of the
11
11
  License (at your option).
12
12
 
13
- MathBook XML is distributed in the hope that it will be useful,
13
+ PreTeXt is distributed in the hope that it will be useful,
14
14
  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
16
  GNU General Public License for more details.
17
17
 
18
18
  You should have received a copy of the GNU General Public License
19
- along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
19
+ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
20
20
  *********************************************************************-->
21
21
 
22
22
  <!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
@@ -1,22 +1,22 @@
1
1
  <?xml version='1.0'?> <!-- As XML file -->
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2013 Robert A. Beezer
4
+ Copyright (C) 2013-2026 Robert A. Beezer
5
5
 
6
- This file is part of MathBook XML.
6
+ This file is part of PreTeXt.
7
7
 
8
- MathBook XML is free software: you can redistribute it and/or modify
8
+ PreTeXt is free software: you can redistribute it and/or modify
9
9
  it under the terms of the GNU General Public License as published by
10
10
  the Free Software Foundation, either version 2 or version 3 of the
11
11
  License (at your option).
12
12
 
13
- MathBook XML is distributed in the hope that it will be useful,
13
+ PreTeXt is distributed in the hope that it will be useful,
14
14
  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
16
  GNU General Public License for more details.
17
17
 
18
18
  You should have received a copy of the GNU General Public License
19
- along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
19
+ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
20
20
  *********************************************************************-->
21
21
 
22
22
  <!-- http://pimpmyxslt.com/articles/entity-tricks-part2/ -->
@@ -219,19 +219,21 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
219
219
  </xsl:choose>
220
220
  </xsl:variable>
221
221
 
222
- <!-- Employing variants of the text displayed for a cross-reference -->
223
- <!-- affects the words shown to the reader, and hence is a choice -->
224
- <!-- preserved in the source, and is not just a processing decision -->
225
- <!-- $xref-text-style is the global choice, based on -->
226
- <!-- docinfo/cross-references/@text -->
227
- <!-- We control the possible values with the schema, allowing junk -->
228
- <!-- NB: blank is not set, and is ignored so the legacy-autoname -->
229
- <!-- scheme controls the global default. When that goes away, we -->
230
- <!-- should set the default here when there is no attribute. -->
222
+ <!-- Employing variants of the text displayed for a cross-reference -->
223
+ <!-- affects the words shown to the reader, and hence is a choice -->
224
+ <!-- preserved in the source, and is not just a processing decision -->
225
+ <!-- $xref-text-style is the global choice, based on -->
226
+ <!-- docinfo/defaults/xrefs/@text -->
227
+ <!-- The "repair" phase of assembly normalizes the retired -->
228
+ <!-- "cross-references" element to this location, so one path serves -->
229
+ <!-- We control the possible values with the schema, allowing junk -->
230
+ <!-- NB: blank is not set, and is ignored so the legacy-autoname -->
231
+ <!-- scheme controls the global default. When that goes away, we -->
232
+ <!-- should set the default here when there is no attribute. -->
231
233
  <xsl:variable name="xref-text-style">
232
234
  <xsl:choose>
233
- <xsl:when test="$docinfo/cross-references/@text">
234
- <xsl:value-of select="$docinfo/cross-references/@text" />
235
+ <xsl:when test="$docinfo/defaults/xrefs/@text">
236
+ <xsl:value-of select="$docinfo/defaults/xrefs/@text" />
235
237
  </xsl:when>
236
238
  <xsl:otherwise>
237
239
  <text />
@@ -1913,7 +1915,7 @@ Book (with parts), "section" at level 3
1913
1915
  <xsl:variable name="math-punctuation">
1914
1916
  <xsl:choose>
1915
1917
  <!-- drop punctuation after display math, if moving to math -->
1916
- <xsl:when test="$b-include-display and contains($clause-ending-marks, $first-char) and preceding-sibling::node()[1][self::md[mrow]]">
1918
+ <xsl:when test="$b-include-display and contains($clause-ending-marks, $first-char) and preceding-sibling::node()[1][self::md]">
1917
1919
  <xsl:call-template name="strip-leading-whitespace">
1918
1920
  <xsl:with-param name="text">
1919
1921
  <xsl:call-template name="drop-clause-punctuation">
@@ -1986,7 +1988,7 @@ Book (with parts), "section" at level 3
1986
1988
  <xsl:variable name="original" select="$text-processed" />
1987
1989
  <xsl:variable name="front-cleaned">
1988
1990
  <xsl:choose>
1989
- <xsl:when test="not(preceding-sibling::node()[self::*|self::text()]) or preceding-sibling::node()[self::*|self::text()][1][self::md[mrow]|self::cd|self::pre|self::ol/parent::p|self::ul/parent::p|self::dl/parent::p]">
1991
+ <xsl:when test="not(preceding-sibling::node()[self::*|self::text()]) or preceding-sibling::node()[self::*|self::text()][1][self::md|self::cd|self::pre|self::ol/parent::p|self::ul/parent::p|self::dl/parent::p]">
1990
1992
  <xsl:call-template name="strip-leading-whitespace">
1991
1993
  <xsl:with-param name="text" select="$original" />
1992
1994
  </xsl:call-template>
@@ -1998,7 +2000,7 @@ Book (with parts), "section" at level 3
1998
2000
  </xsl:variable>
1999
2001
  <xsl:variable name="back-cleaned">
2000
2002
  <xsl:choose>
2001
- <xsl:when test="not(following-sibling::node()[self::*|self::text()]) or following-sibling::node()[self::*|self::text()][1][self::md[mrow]|self::cd|self::pre|self::ol/parent::p|self::ul/parent::p|self::dl/parent::p]">
2003
+ <xsl:when test="not(following-sibling::node()[self::*|self::text()]) or following-sibling::node()[self::*|self::text()][1][self::md|self::cd|self::pre|self::ol/parent::p|self::ul/parent::p|self::dl/parent::p]">
2002
2004
  <xsl:call-template name="strip-trailing-whitespace">
2003
2005
  <xsl:with-param name="text" select="$front-cleaned" />
2004
2006
  </xsl:call-template>
@@ -2911,8 +2913,8 @@ Book (with parts), "section" at level 3
2911
2913
  <xsl:value-of select="@width" />
2912
2914
  </xsl:when>
2913
2915
  <!-- not on an image, but doc-wide default exists -->
2914
- <xsl:when test="self::image and $docinfo/defaults/image-width">
2915
- <xsl:value-of select="$docinfo/defaults/image-width" />
2916
+ <xsl:when test="self::image and $docinfo/defaults/images/@width">
2917
+ <xsl:value-of select="$docinfo/defaults/images/@width" />
2916
2918
  </xsl:when>
2917
2919
  <!-- naked slate, look to enclosing interactive -->
2918
2920
  <xsl:when test="self::slate">
@@ -4199,6 +4201,11 @@ Book (with parts), "section" at level 3
4199
4201
  <xsl:when test="@margins">
4200
4202
  <xsl:value-of select="normalize-space(@margins)" />
4201
4203
  </xsl:when>
4204
+ <!-- not placed on image, or figure/image, -->
4205
+ <!-- but a document-wide default margins exists -->
4206
+ <xsl:when test="self::image and not(ancestor::sidebyside) and $docinfo/defaults/images/@margins">
4207
+ <xsl:value-of select="normalize-space($docinfo/defaults/images/@margins)" />
4208
+ </xsl:when>
4202
4209
  <!-- default if not specified -->
4203
4210
  <xsl:otherwise>
4204
4211
  <xsl:text>auto</xsl:text>
@@ -4237,8 +4244,8 @@ Book (with parts), "section" at level 3
4237
4244
  </xsl:when>
4238
4245
  <!-- not placed on image, or figure/image, -->
4239
4246
  <!-- but a document-wide default width exists -->
4240
- <xsl:when test="self::image and not(ancestor::sidebyside) and $docinfo/defaults/image-width">
4241
- <xsl:value-of select="$docinfo/defaults/image-width" />
4247
+ <xsl:when test="self::image and not(ancestor::sidebyside) and $docinfo/defaults/images/@width">
4248
+ <xsl:value-of select="$docinfo/defaults/images/@width" />
4242
4249
  </xsl:when>
4243
4250
  <!-- default setting if not specified, and not global -->
4244
4251
  <xsl:otherwise>
@@ -5594,6 +5601,22 @@ Book (with parts), "section" at level 3
5594
5601
  <!-- the element from this template would be useful. -->
5595
5602
  <xsl:template match="*" mode="dry-run"/>
5596
5603
 
5604
+ <!-- A PROJECT-LIKE which is *not* already inside a printout, but which -->
5605
+ <!-- requests workspace, is a printout in its own right: it is meant to be -->
5606
+ <!-- worked on paper, so each conversion gives it the treatment it gives -->
5607
+ <!-- a worksheet. In HTML that is a print preview icon, page margins, and -->
5608
+ <!-- workspace divs the preview javascript expands to fill pages; in -->
5609
+ <!-- LaTeX it is a page of its own, with the worksheet margins. Inside a -->
5610
+ <!-- worksheet or handout there is nothing to do, since the enclosing -->
5611
+ <!-- printout already provides all of this. -->
5612
+ <xsl:template match="*" mode="is-standalone-printout">
5613
+ <xsl:value-of select="false()"/>
5614
+ </xsl:template>
5615
+
5616
+ <xsl:template match="&PROJECT-LIKE;" mode="is-standalone-printout">
5617
+ <xsl:value-of select="boolean(not(ancestor::worksheet|ancestor::handout) and (@workspace|.//@workspace))"/>
5618
+ </xsl:template>
5619
+
5597
5620
  <!-- This template is called for items in a printout that can have a -->
5598
5621
  <!-- workspace specified. It is important that this sometimes returns -->
5599
5622
  <!-- an empty string, since that is a signal to not construct some -->
@@ -5606,7 +5629,7 @@ Book (with parts), "section" at level 3
5606
5629
  <!-- NB: a blank workspace is used as a signal in "divisionexercise" -->
5607
5630
  <!-- in LaTeX conversion, via parameter #3 of the environment -->
5608
5631
 
5609
- <xsl:if test="(ancestor::worksheet or ancestor::handout) and not(child::task)">
5632
+ <xsl:if test="(ancestor::worksheet or ancestor::handout or ancestor-or-self::*[&PROJECT-FILTER;]) and not(child::task)">
5610
5633
  <!-- First element with @workspace, confined to the printout -->
5611
5634
  <!-- Could be empty node-set, which will be empty string later -->
5612
5635
  <xsl:variable name="raw-workspace">
@@ -6410,7 +6433,8 @@ Book (with parts), "section" at level 3
6410
6433
  <!-- Printout Margins -->
6411
6434
  <!-- ################ -->
6412
6435
 
6413
- <xsl:template match="&PRINTOUT;" mode="printout-margin">
6436
+ <!-- PROJECT-LIKE is here for standalone printout previews. -->
6437
+ <xsl:template match="&PRINTOUT;|&PROJECT-LIKE;" mode="printout-margin">
6414
6438
  <xsl:param name="author-side"/>
6415
6439
  <xsl:param name="publisher-side"/>
6416
6440
  <xsl:choose>
@@ -7410,10 +7434,29 @@ Book (with parts), "section" at level 3
7410
7434
 
7411
7435
  <!-- Define variables for default active language - will be picked up by -->
7412
7436
  <!-- RS manifest and can be a different string than the raw language. -->
7437
+ <!-- NB: the language-default templates and variables here can be -->
7438
+ <!-- invoked from within the assembly chain's "representations" pass -->
7439
+ <!-- (via import precedence over their near-duplicates in the -->
7440
+ <!-- -runestone-static stylesheet), where the tree behind $docinfo -->
7441
+ <!-- does not exist yet and referencing it is a circular definition. -->
7442
+ <!-- So they read the version tree, and must recognize both the -->
7443
+ <!-- "docinfo/defaults" home (preferred) and the deprecated top-level -->
7444
+ <!-- placement, which the later "repair" pass would have normalized. -->
7445
+ <xsl:variable name="docinfo-programs-language">
7446
+ <xsl:choose>
7447
+ <xsl:when test="$version-docinfo/defaults/programs/@language">
7448
+ <xsl:value-of select="$version-docinfo/defaults/programs/@language"/>
7449
+ </xsl:when>
7450
+ <xsl:when test="$version-docinfo/programs/@language">
7451
+ <xsl:value-of select="$version-docinfo/programs/@language"/>
7452
+ </xsl:when>
7453
+ </xsl:choose>
7454
+ </xsl:variable>
7455
+
7413
7456
  <xsl:variable name="default-active-programming-language">
7414
- <xsl:if test="$version-docinfo/programs/@language">
7457
+ <xsl:if test="not($docinfo-programs-language = '')">
7415
7458
  <xsl:for-each select="$programming-language-table">
7416
- <xsl:value-of select="key('programming-language-key', $version-docinfo/programs/@language)/@active" />
7459
+ <xsl:value-of select="key('programming-language-key', $docinfo-programs-language)/@active" />
7417
7460
  </xsl:for-each>
7418
7461
  </xsl:if>
7419
7462
  </xsl:variable>
@@ -7434,11 +7477,14 @@ Book (with parts), "section" at level 3
7434
7477
  <xsl:when test="@language">
7435
7478
  <xsl:value-of select="@language" />
7436
7479
  </xsl:when>
7480
+ <xsl:when test="$version-docinfo/defaults/parsons/@language">
7481
+ <xsl:value-of select="$version-docinfo/defaults/parsons/@language" />
7482
+ </xsl:when>
7437
7483
  <xsl:when test="$version-docinfo/parsons/@language">
7438
7484
  <xsl:value-of select="$version-docinfo/parsons/@language" />
7439
7485
  </xsl:when>
7440
- <xsl:when test="$version-docinfo/programs/@language">
7441
- <xsl:value-of select="$version-docinfo/programs/@language" />
7486
+ <xsl:when test="not($docinfo-programs-language = '')">
7487
+ <xsl:value-of select="$docinfo-programs-language" />
7442
7488
  </xsl:when>
7443
7489
  </xsl:choose>
7444
7490
  </xsl:template>
@@ -7485,8 +7531,11 @@ Book (with parts), "section" at level 3
7485
7531
  <xsl:when test="@*[name() = $attr]">
7486
7532
  <xsl:value-of select="@*[name() = $attr]" />
7487
7533
  </xsl:when>
7488
- <xsl:when test="$docinfo/programs/@*[name() = $attr]">
7489
- <xsl:value-of select="$docinfo/programs/@*[name() = $attr]" />
7534
+ <xsl:when test="$version-docinfo/defaults/programs/@*[name() = $attr]">
7535
+ <xsl:value-of select="$version-docinfo/defaults/programs/@*[name() = $attr]" />
7536
+ </xsl:when>
7537
+ <xsl:when test="$version-docinfo/programs/@*[name() = $attr]">
7538
+ <xsl:value-of select="$version-docinfo/programs/@*[name() = $attr]" />
7490
7539
  </xsl:when>
7491
7540
  <xsl:otherwise>
7492
7541
  <xsl:value-of select="$default" />
@@ -10720,7 +10769,7 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10720
10769
  <xsl:value-of select="name()" />
10721
10770
  <xsl:text> "</xsl:text>
10722
10771
  <xsl:value-of select="." />
10723
- <xsl:text>" is invalid. Use only letters, numbers, hyphens and underscores.</xsl:text>
10772
+ <xsl:text>" is invalid. Use only the 26 Latin letters (7-bit ASCII, no accents), numbers, hyphens and underscores.</xsl:text>
10724
10773
  </xsl:message>
10725
10774
  </xsl:if>
10726
10775
  <!-- a reserved UI id: "=" against the token node-set is true if this -->
@@ -11811,6 +11860,48 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
11811
11860
  <xsl:with-param name="message" select="'an &quot;audio&quot;, &quot;video&quot;, or &quot;interactive&quot; element may not appear within a &quot;sidebyside&quot;, at any depth. Content may go missing with no further warning. Relocate the element outside the &quot;sidebyside&quot;.'"/>
11812
11861
  </xsl:call-template>
11813
11862
  <!-- -->
11863
+ <!-- 2026-07-30 "programs" and "parsons" relocate into "docinfo/defaults" -->
11864
+ <xsl:call-template name="deprecation-message">
11865
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/programs | $docinfo/parsons&quot;" />
11866
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11867
+ <xsl:with-param name="message" select="'a &quot;programs&quot; or &quot;parsons&quot; element now resides within a &quot;defaults&quot; element of the &quot;docinfo&quot;, alongside other document-wide defaults for authored attributes. We will honor your intent, but please relocate the element.'"/>
11868
+ </xsl:call-template>
11869
+ <!-- -->
11870
+ <!-- 2026-07-30 "docinfo/defaults/image-width" element becomes "images/@width" -->
11871
+ <xsl:call-template name="deprecation-message">
11872
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/defaults/image-width&quot;" />
11873
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11874
+ <xsl:with-param name="message" select="'a document-wide default width for images is now a &quot;width&quot; attribute on an &quot;images&quot; element within &quot;docinfo/defaults&quot;, replacing the &quot;image-width&quot; element. We will honor your intent, but please convert to the attribute form.'"/>
11875
+ </xsl:call-template>
11876
+ <!-- -->
11877
+ <!-- 2026-07-30 "docinfo/images/archive" moves to the publication file -->
11878
+ <xsl:call-template name="deprecation-message">
11879
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/images&quot;" />
11880
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11881
+ <xsl:with-param name="message" select="'requests for archive (download) versions of images have moved to the publication file, as &quot;/publication/html/images/archive&quot;. We will honor an &quot;images&quot; element within &quot;docinfo&quot; while the publication file is silent, but please relocate the request.'"/>
11882
+ </xsl:call-template>
11883
+ <!-- -->
11884
+ <!-- 2026-07-30 "docinfo/brandlogo" moves to the publication file -->
11885
+ <xsl:call-template name="deprecation-message">
11886
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/brandlogo&quot;" />
11887
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11888
+ <xsl:with-param name="message" select="'the brand logo of the HTML masthead has moved to the publication file, as &quot;/publication/html/brandlogo&quot; with the same attributes. We will honor a &quot;brandlogo&quot; within &quot;docinfo&quot; while the publication file is silent, but please relocate the element.'"/>
11889
+ </xsl:call-template>
11890
+ <!-- -->
11891
+ <!-- 2026-07-30 "event" is bibliographic content, belongs in "bibinfo" -->
11892
+ <xsl:call-template name="deprecation-message">
11893
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/event&quot;" />
11894
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11895
+ <xsl:with-param name="message" select="'an &quot;event&quot; element now resides in the &quot;bibinfo&quot; of the &quot;frontmatter&quot;, alongside the other bibliographic facts of a document. We will honor an &quot;event&quot; within &quot;docinfo&quot;, but please relocate the element.'"/>
11896
+ </xsl:call-template>
11897
+ <!-- -->
11898
+ <!-- 2026-07-31 "docinfo/cross-references" becomes "xrefs" within "docinfo/defaults" -->
11899
+ <xsl:call-template name="deprecation-message">
11900
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/cross-references&quot;" />
11901
+ <xsl:with-param name="date-string" select="'2026-07-31'" />
11902
+ <xsl:with-param name="message" select="'the document-wide style of cross-reference text is now a &quot;text&quot; attribute on an &quot;xrefs&quot; element within &quot;docinfo/defaults&quot;, replacing the &quot;cross-references&quot; element. We will honor your intent, but please convert to the new form.'"/>
11903
+ </xsl:call-template>
11904
+ <!-- -->
11814
11905
  </xsl:template>
11815
11906
 
11816
11907
  <!-- Miscellaneous -->
@@ -1,7 +1,7 @@
1
1
  <?xml version='1.0'?> <!-- As XML file -->
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2022 Robert A. Beezer
4
+ Copyright (C) 2022-2026 Robert A. Beezer
5
5
 
6
6
  This file is part of PreTeXt.
7
7