@pretextbook/pretext-html 0.6.0 → 0.7.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 (96) hide show
  1. package/assets/upstream.json +1 -1
  2. package/assets/xsl/LICENSE-pretext +1 -1
  3. package/assets/xsl/README.md +43 -25
  4. package/assets/xsl/entities.ent +4 -4
  5. package/assets/xsl/extract-asymptote.xsl +5 -5
  6. package/assets/xsl/extract-biblio-csl.xsl +1 -1
  7. package/assets/xsl/extract-datafile.xsl +1 -1
  8. package/assets/xsl/extract-dynamic.xsl +1 -1
  9. package/assets/xsl/extract-identity.xsl +5 -5
  10. package/assets/xsl/extract-interactive.xsl +1 -1
  11. package/assets/xsl/extract-latex-image.xsl +5 -5
  12. package/assets/xsl/extract-mermaid.xsl +1 -1
  13. package/assets/xsl/extract-mom.xsl +5 -5
  14. package/assets/xsl/extract-pg.xsl +1 -1
  15. package/assets/xsl/extract-prefigure.xsl +5 -5
  16. package/assets/xsl/extract-qrcode.xsl +1 -1
  17. package/assets/xsl/extract-runestone-page-template.xsl +1 -1
  18. package/assets/xsl/extract-sageplot.xsl +5 -5
  19. package/assets/xsl/extract-stack.xsl +1 -1
  20. package/assets/xsl/extract-trace.xsl +1 -1
  21. package/assets/xsl/extract-youtube.xsl +5 -5
  22. package/assets/xsl/latex/pretext-latex-AIM.xsl +1 -1
  23. package/assets/xsl/latex/pretext-latex-chaos.xsl +1 -1
  24. package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +1 -1
  25. package/assets/xsl/latex/pretext-latex-guide.xsl +1 -1
  26. package/assets/xsl/localizations/README.md +25 -25
  27. package/assets/xsl/localizations/af-ZA.xml +1 -1
  28. package/assets/xsl/localizations/bg-BG.xml +1 -1
  29. package/assets/xsl/localizations/ca-ES.xml +1 -1
  30. package/assets/xsl/localizations/cs-CZ.xml +1 -1
  31. package/assets/xsl/localizations/de-DE.xml +1 -1
  32. package/assets/xsl/localizations/en-US.xml +1 -1
  33. package/assets/xsl/localizations/es-ES.xml +1 -1
  34. package/assets/xsl/localizations/fi-FI.xml +1 -1
  35. package/assets/xsl/localizations/fr-CA.xml +1 -1
  36. package/assets/xsl/localizations/fr-FR.xml +1 -1
  37. package/assets/xsl/localizations/hu-HU.xml +1 -1
  38. package/assets/xsl/localizations/it-IT.xml +1 -1
  39. package/assets/xsl/localizations/ku-CKB.xml +1 -1
  40. package/assets/xsl/localizations/localizations.xml +1 -1
  41. package/assets/xsl/localizations/nl-NL.xml +1 -1
  42. package/assets/xsl/localizations/pt-BR.xml +1 -1
  43. package/assets/xsl/localizations/pt-PT.xml +1 -1
  44. package/assets/xsl/localizations/zh-HANS.xml +1 -1
  45. package/assets/xsl/pretext-assembly.xsl +64 -1
  46. package/assets/xsl/pretext-basic-html.xsl +5 -5
  47. package/assets/xsl/pretext-braille-preprint.xsl +5 -5
  48. package/assets/xsl/pretext-common.xsl +104 -30
  49. package/assets/xsl/pretext-dynamic.xsl +1 -1
  50. package/assets/xsl/pretext-epub.xsl +90 -84
  51. package/assets/xsl/pretext-fo.xsl +1 -1
  52. package/assets/xsl/pretext-html.xsl +57 -34
  53. package/assets/xsl/pretext-json-manifest.xsl +1 -1
  54. package/assets/xsl/pretext-jupyter.xsl +5 -5
  55. package/assets/xsl/pretext-latex-classic.xsl +1 -1
  56. package/assets/xsl/pretext-latex-common.xsl +7 -5
  57. package/assets/xsl/pretext-latex.xsl +3 -3
  58. package/assets/xsl/pretext-litprog.xsl +9 -2
  59. package/assets/xsl/pretext-markdown.xsl +1 -1
  60. package/assets/xsl/pretext-numbers.xsl +1 -1
  61. package/assets/xsl/pretext-runestone-fitb.xsl +18 -0
  62. package/assets/xsl/pretext-runestone-static.xsl +13 -1
  63. package/assets/xsl/pretext-runestone.xsl +34 -6
  64. package/assets/xsl/pretext-sage-doctest.xsl +18 -0
  65. package/assets/xsl/pretext-solution-manual-latex.xsl +4 -4
  66. package/assets/xsl/pretext-text-utilities.xsl +1 -1
  67. package/assets/xsl/pretext-text.xsl +5 -5
  68. package/assets/xsl/pretext-units.xsl +5 -5
  69. package/assets/xsl/pretext-view-source.xsl +1 -1
  70. package/assets/xsl/pretext-ww-problem-sets.xsl +15 -12
  71. package/assets/xsl/publisher-variables.xsl +104 -36
  72. package/assets/xsl/support/README.md +19 -0
  73. package/assets/xsl/support/extract-math.xsl +1 -1
  74. package/assets/xsl/support/package-math.xsl +1 -1
  75. package/assets/xsl/support/play-button/README.md +3 -1
  76. package/assets/xsl/support/webpack_static_imports.xml +19 -0
  77. package/assets/xsl/tests/README.md +20 -1
  78. package/assets/xsl/tests/null.xml +19 -0
  79. package/assets/xsl/tests/pretext-text-utilities-test.xsl +1 -1
  80. package/assets/xsl/utilities/README.md +27 -6
  81. package/assets/xsl/utilities/author-report.xsl +1 -1
  82. package/assets/xsl/utilities/fix-deprecations.xsl +5 -5
  83. package/assets/xsl/utilities/pretext-enhanced-source.xsl +1 -1
  84. package/assets/xsl/utilities/report-publisher-variables.xsl +5 -5
  85. package/assets/xsl/xml-to-json.xsl +4 -4
  86. package/assets/xsl-bundle.json +1 -1
  87. package/dist/banner.d.ts +51 -0
  88. package/dist/{cli-DF7XOWN7.js → cli-D0m0Ha1j.js} +343 -211
  89. package/dist/cli.js +2 -2
  90. package/dist/index.browser.d.ts +2 -0
  91. package/dist/index.browser.js +528 -396
  92. package/dist/index.d.ts +2 -0
  93. package/dist/index.js +28 -25
  94. package/dist/renderer.d.ts +13 -0
  95. package/package.json +1 -1
  96. 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 2016-2021 Robert A. Beezer
4
+ Copyright (C) 2016-2026 Robert A. Beezer
5
5
  This file is part of PreTeXt.
6
6
  PreTeXt is free software: you can redistribute it and/or modify
7
7
  it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8" ?>
2
2
 
3
3
  <!--********************************************************************
4
- Copyright 2016-2021 Robert A. Beezer
4
+ Copyright (C) 2016-2026 Robert A. Beezer
5
5
  This file is part of PreTeXt.
6
6
  PreTeXt is free software: you can redistribute it and/or modify
7
7
  it under the terms of the GNU General Public License as published by
@@ -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 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 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 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 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 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
 
@@ -2921,6 +2921,67 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2921
2921
  </xsl:element>
2922
2922
  </xsl:template>
2923
2923
 
2924
+ <!-- 2026-07-30: authored-attribute defaults gather under "defaults" -->
2925
+
2926
+ <!-- A "programs", "parsons", or "cross-references" element, as -->
2927
+ <!-- a child of "docinfo", moves inside a "defaults" element. -->
2928
+ <!-- The first of the trio present builds the container for all, -->
2929
+ <!-- and the same match then suppresses the others. The retired -->
2930
+ <!-- "cross-references" element is renamed "xrefs" on the way in. -->
2931
+ <xsl:template match="docinfo/programs | docinfo/parsons | docinfo/cross-references" mode="repair">
2932
+ <xsl:if test="count(preceding-sibling::programs | preceding-sibling::parsons | preceding-sibling::cross-references) = 0">
2933
+ <xsl:element name="defaults">
2934
+ <xsl:for-each select="../programs | ../parsons | ../cross-references">
2935
+ <xsl:choose>
2936
+ <xsl:when test="self::cross-references">
2937
+ <xsl:element name="xrefs">
2938
+ <xsl:copy-of select="@*"/>
2939
+ </xsl:element>
2940
+ </xsl:when>
2941
+ <xsl:otherwise>
2942
+ <xsl:copy>
2943
+ <xsl:copy-of select="@*"/>
2944
+ </xsl:copy>
2945
+ </xsl:otherwise>
2946
+ </xsl:choose>
2947
+ </xsl:for-each>
2948
+ </xsl:element>
2949
+ </xsl:if>
2950
+ </xsl:template>
2951
+
2952
+ <!-- The old "image-width" element, whose content was the width, -->
2953
+ <!-- becomes a "width" attribute on an "images" element. -->
2954
+ <xsl:template match="docinfo/defaults/image-width" mode="repair">
2955
+ <xsl:element name="images">
2956
+ <xsl:attribute name="width">
2957
+ <xsl:value-of select="normalize-space(.)"/>
2958
+ </xsl:attribute>
2959
+ </xsl:element>
2960
+ </xsl:template>
2961
+
2962
+ <!-- 2026-07-30: an "event" is bibliographic content, so it -->
2963
+ <!-- belongs in "bibinfo", already its home for slideshows. -->
2964
+ <!-- Suppressed at its origin within "docinfo"... -->
2965
+ <xsl:template match="docinfo/event" mode="repair"/>
2966
+
2967
+ <!-- ...and lands in an authored "bibinfo" without its own. -->
2968
+ <xsl:template match="frontmatter/bibinfo[not(event)]" mode="repair">
2969
+ <xsl:copy>
2970
+ <xsl:apply-templates select="@*" mode="repair"/>
2971
+ <xsl:apply-templates select="node()" mode="repair"/>
2972
+ <xsl:apply-templates select="/*/docinfo/event" mode="event-relocate"/>
2973
+ </xsl:copy>
2974
+ </xsl:template>
2975
+
2976
+ <!-- A faithful copy, since the "repair" mode on the same -->
2977
+ <!-- element is its suppression at the original location. -->
2978
+ <xsl:template match="docinfo/event" mode="event-relocate">
2979
+ <xsl:copy>
2980
+ <xsl:apply-templates select="@*" mode="repair"/>
2981
+ <xsl:apply-templates select="node()" mode="repair"/>
2982
+ </xsl:copy>
2983
+ </xsl:template>
2984
+
2924
2985
  <!-- 2024-10-29: program is reworked -->
2925
2986
 
2926
2987
  <!-- Add code element around text in program when missing -->
@@ -2995,6 +3056,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
2995
3056
  <xsl:apply-templates select="titlepage/date" mode="repair"/>
2996
3057
  <!-- for slides, we allowed an "event" -->
2997
3058
  <xsl:apply-templates select="titlepage/event" mode="repair"/>
3059
+ <!-- 2026-07-30: an "event" may also arrive from "docinfo" -->
3060
+ <xsl:apply-templates select="/*/docinfo/event[not(current()/titlepage/event)]" mode="event-relocate"/>
2998
3061
  <xsl:apply-templates select="colophon/credit" mode="repair"/>
2999
3062
  <xsl:apply-templates select="colophon/edition" mode="repair"/>
3000
3063
  <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>
@@ -7410,10 +7417,29 @@ Book (with parts), "section" at level 3
7410
7417
 
7411
7418
  <!-- Define variables for default active language - will be picked up by -->
7412
7419
  <!-- RS manifest and can be a different string than the raw language. -->
7420
+ <!-- NB: the language-default templates and variables here can be -->
7421
+ <!-- invoked from within the assembly chain's "representations" pass -->
7422
+ <!-- (via import precedence over their near-duplicates in the -->
7423
+ <!-- -runestone-static stylesheet), where the tree behind $docinfo -->
7424
+ <!-- does not exist yet and referencing it is a circular definition. -->
7425
+ <!-- So they read the version tree, and must recognize both the -->
7426
+ <!-- "docinfo/defaults" home (preferred) and the deprecated top-level -->
7427
+ <!-- placement, which the later "repair" pass would have normalized. -->
7428
+ <xsl:variable name="docinfo-programs-language">
7429
+ <xsl:choose>
7430
+ <xsl:when test="$version-docinfo/defaults/programs/@language">
7431
+ <xsl:value-of select="$version-docinfo/defaults/programs/@language"/>
7432
+ </xsl:when>
7433
+ <xsl:when test="$version-docinfo/programs/@language">
7434
+ <xsl:value-of select="$version-docinfo/programs/@language"/>
7435
+ </xsl:when>
7436
+ </xsl:choose>
7437
+ </xsl:variable>
7438
+
7413
7439
  <xsl:variable name="default-active-programming-language">
7414
- <xsl:if test="$version-docinfo/programs/@language">
7440
+ <xsl:if test="not($docinfo-programs-language = '')">
7415
7441
  <xsl:for-each select="$programming-language-table">
7416
- <xsl:value-of select="key('programming-language-key', $version-docinfo/programs/@language)/@active" />
7442
+ <xsl:value-of select="key('programming-language-key', $docinfo-programs-language)/@active" />
7417
7443
  </xsl:for-each>
7418
7444
  </xsl:if>
7419
7445
  </xsl:variable>
@@ -7434,11 +7460,14 @@ Book (with parts), "section" at level 3
7434
7460
  <xsl:when test="@language">
7435
7461
  <xsl:value-of select="@language" />
7436
7462
  </xsl:when>
7463
+ <xsl:when test="$version-docinfo/defaults/parsons/@language">
7464
+ <xsl:value-of select="$version-docinfo/defaults/parsons/@language" />
7465
+ </xsl:when>
7437
7466
  <xsl:when test="$version-docinfo/parsons/@language">
7438
7467
  <xsl:value-of select="$version-docinfo/parsons/@language" />
7439
7468
  </xsl:when>
7440
- <xsl:when test="$version-docinfo/programs/@language">
7441
- <xsl:value-of select="$version-docinfo/programs/@language" />
7469
+ <xsl:when test="not($docinfo-programs-language = '')">
7470
+ <xsl:value-of select="$docinfo-programs-language" />
7442
7471
  </xsl:when>
7443
7472
  </xsl:choose>
7444
7473
  </xsl:template>
@@ -7485,8 +7514,11 @@ Book (with parts), "section" at level 3
7485
7514
  <xsl:when test="@*[name() = $attr]">
7486
7515
  <xsl:value-of select="@*[name() = $attr]" />
7487
7516
  </xsl:when>
7488
- <xsl:when test="$docinfo/programs/@*[name() = $attr]">
7489
- <xsl:value-of select="$docinfo/programs/@*[name() = $attr]" />
7517
+ <xsl:when test="$version-docinfo/defaults/programs/@*[name() = $attr]">
7518
+ <xsl:value-of select="$version-docinfo/defaults/programs/@*[name() = $attr]" />
7519
+ </xsl:when>
7520
+ <xsl:when test="$version-docinfo/programs/@*[name() = $attr]">
7521
+ <xsl:value-of select="$version-docinfo/programs/@*[name() = $attr]" />
7490
7522
  </xsl:when>
7491
7523
  <xsl:otherwise>
7492
7524
  <xsl:value-of select="$default" />
@@ -10720,7 +10752,7 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10720
10752
  <xsl:value-of select="name()" />
10721
10753
  <xsl:text> "</xsl:text>
10722
10754
  <xsl:value-of select="." />
10723
- <xsl:text>" is invalid. Use only letters, numbers, hyphens and underscores.</xsl:text>
10755
+ <xsl:text>" is invalid. Use only the 26 Latin letters (7-bit ASCII, no accents), numbers, hyphens and underscores.</xsl:text>
10724
10756
  </xsl:message>
10725
10757
  </xsl:if>
10726
10758
  <!-- a reserved UI id: "=" against the token node-set is true if this -->
@@ -11811,6 +11843,48 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
11811
11843
  <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
11844
  </xsl:call-template>
11813
11845
  <!-- -->
11846
+ <!-- 2026-07-30 "programs" and "parsons" relocate into "docinfo/defaults" -->
11847
+ <xsl:call-template name="deprecation-message">
11848
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/programs | $docinfo/parsons&quot;" />
11849
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11850
+ <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.'"/>
11851
+ </xsl:call-template>
11852
+ <!-- -->
11853
+ <!-- 2026-07-30 "docinfo/defaults/image-width" element becomes "images/@width" -->
11854
+ <xsl:call-template name="deprecation-message">
11855
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/defaults/image-width&quot;" />
11856
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11857
+ <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.'"/>
11858
+ </xsl:call-template>
11859
+ <!-- -->
11860
+ <!-- 2026-07-30 "docinfo/images/archive" moves to the publication file -->
11861
+ <xsl:call-template name="deprecation-message">
11862
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/images&quot;" />
11863
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11864
+ <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.'"/>
11865
+ </xsl:call-template>
11866
+ <!-- -->
11867
+ <!-- 2026-07-30 "docinfo/brandlogo" moves to the publication file -->
11868
+ <xsl:call-template name="deprecation-message">
11869
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/brandlogo&quot;" />
11870
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11871
+ <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.'"/>
11872
+ </xsl:call-template>
11873
+ <!-- -->
11874
+ <!-- 2026-07-30 "event" is bibliographic content, belongs in "bibinfo" -->
11875
+ <xsl:call-template name="deprecation-message">
11876
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/event&quot;" />
11877
+ <xsl:with-param name="date-string" select="'2026-07-30'" />
11878
+ <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.'"/>
11879
+ </xsl:call-template>
11880
+ <!-- -->
11881
+ <!-- 2026-07-31 "docinfo/cross-references" becomes "xrefs" within "docinfo/defaults" -->
11882
+ <xsl:call-template name="deprecation-message">
11883
+ <xsl:with-param name="occurrences" select="&quot;$docinfo/cross-references&quot;" />
11884
+ <xsl:with-param name="date-string" select="'2026-07-31'" />
11885
+ <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.'"/>
11886
+ </xsl:call-template>
11887
+ <!-- -->
11814
11888
  </xsl:template>
11815
11889
 
11816
11890
  <!-- 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