@pretextbook/pretext-html 0.3.0 → 0.4.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 (43) hide show
  1. package/README.md +20 -9
  2. package/assets/preview-html.xsl +8 -4
  3. package/assets/upstream.json +1 -1
  4. package/assets/xsl/README.md +25 -24
  5. package/assets/xsl/entities.ent +20 -0
  6. package/assets/xsl/extract-biblio-csl.xsl +1 -1
  7. package/assets/xsl/extract-pg.xsl +111 -297
  8. package/assets/xsl/extract-qrcode.xsl +11 -1
  9. package/assets/xsl/extract-sageplot.xsl +1 -1
  10. package/assets/xsl/latex/pretext-latex-texstyle.xsl +1 -2
  11. package/assets/xsl/localizations/README.md +24 -24
  12. package/assets/xsl/pretext-assembly.xsl +101 -11
  13. package/assets/xsl/pretext-beamer.xsl +43 -146
  14. package/assets/xsl/pretext-braille-preprint.xsl +457 -201
  15. package/assets/xsl/pretext-common.xsl +388 -423
  16. package/assets/xsl/pretext-epub.xsl +301 -72
  17. package/assets/xsl/pretext-fo.xsl +70 -86
  18. package/assets/xsl/pretext-html.xsl +331 -259
  19. package/assets/xsl/pretext-jupyter.xsl +534 -322
  20. package/assets/xsl/pretext-latex-classic.xsl +14 -15
  21. package/assets/xsl/pretext-latex-common.xsl +385 -2389
  22. package/assets/xsl/pretext-latex.xsl +1995 -5
  23. package/assets/xsl/pretext-markdown.xsl +919 -0
  24. package/assets/xsl/pretext-numbers.xsl +22 -4
  25. package/assets/xsl/pretext-revealjs.xsl +241 -33
  26. package/assets/xsl/pretext-runestone-fitb.xsl +20 -22
  27. package/assets/xsl/pretext-runestone.xsl +3 -3
  28. package/assets/xsl/pretext-sage-doctest.xsl +2 -2
  29. package/assets/xsl/pretext-text-utilities.xsl +69 -1
  30. package/assets/xsl/pretext-text.xsl +1077 -107
  31. package/assets/xsl/publisher-variables.xsl +396 -452
  32. package/assets/xsl/support/play-button/README.md +1 -3
  33. package/assets/xsl/tests/README.md +1 -1
  34. package/assets/xsl/utilities/README.md +6 -8
  35. package/assets/xsl/utilities/report-publisher-variables.xsl +15 -0
  36. package/assets/xsl-bundle.json +1 -1
  37. package/dist/{cli-CzoinNle.js → cli-Cp6C0sif.js} +220 -205
  38. package/dist/cli.js +1 -1
  39. package/dist/index.browser.js +351 -342
  40. package/dist/index.js +1 -1
  41. package/dist/publication.d.ts +9 -1
  42. package/dist/renderer.d.ts +20 -0
  43. package/package.json +1 -1
@@ -34,9 +34,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
34
34
  xmlns:str="http://exslt.org/strings"
35
35
  xmlns:dyn="http://exslt.org/dynamic"
36
36
  extension-element-prefixes="pi exsl date str dyn"
37
- xmlns:mb="https://pretextbook.org/"
38
37
  xmlns:pf="https://prefigure.org"
39
- exclude-result-prefixes="mb"
40
38
  >
41
39
 
42
40
  <!-- PreTeXt common templates -->
@@ -404,7 +402,7 @@ $inline-solution-back|$divisional-solution-back|$worksheet-solution-back|$readin
404
402
  </xsl:when>
405
403
  <xsl:otherwise>
406
404
  <xsl:message>
407
- <xsl:text>PTX:WARNING: the whitespace parameter can be 'strict' or 'flexible', not '</xsl:text>
405
+ <xsl:text>PTX:FALLBACK: the whitespace parameter can be 'strict' or 'flexible', not '</xsl:text>
408
406
  <xsl:value-of select="$whitespace" />
409
407
  <xsl:text>'. Using the default ('flexible').</xsl:text>
410
408
  </xsl:message>
@@ -439,7 +437,7 @@ $inline-solution-back|$divisional-solution-back|$worksheet-solution-back|$readin
439
437
  <!-- An "exercisegroup" indents its exercises, to show the -->
440
438
  <!-- scope of the group, by this fraction of the prevailing -->
441
439
  <!-- text width. The LaTeX conversion applies it through -->
442
- <!-- \egindent (that many \linewidth); the XSL-FO conversion -->
440
+ <!-- \ptxegindent (that many \linewidth); the XSL-FO conversion -->
443
441
  <!-- scales its text measure. -->
444
442
  <xsl:variable name="exercisegroup-indentation" select="0.05"/>
445
443
 
@@ -579,7 +577,7 @@ Book (with parts), "section" at level 3
579
577
  <xsl:when test="$normalized-level=3">subsection</xsl:when>
580
578
  <xsl:when test="$normalized-level=4">subsubsection</xsl:when>
581
579
  <xsl:otherwise>
582
- <xsl:message>PTX:ERROR: Level computation is out-of-bounds (input as <xsl:value-of select="$level" />, normalized to <xsl:value-of select="$normalized-level" />)</xsl:message>
580
+ <xsl:message>PTX:BUG: Level computation is out-of-bounds (input as <xsl:value-of select="$level" />, normalized to <xsl:value-of select="$normalized-level" />)</xsl:message>
583
581
  </xsl:otherwise>
584
582
  </xsl:choose>
585
583
  </xsl:template>
@@ -719,7 +717,7 @@ Book (with parts), "section" at level 3
719
717
  <!-- check for bare # (present but \# is not) -->
720
718
  <xsl:if test="contains($inside, '#') and not(contains($inside, '\#'))">
721
719
  <xsl:message>
722
- <xsl:text>PTX:WARNING: a bare "#" inside \text{} in math must be escaped as "\#"</xsl:text>
720
+ <xsl:text>PTX:ERROR: a bare "#" inside \text{} in math must be escaped as "\#"</xsl:text>
723
721
  <xsl:text>&#xa;</xsl:text>
724
722
  <xsl:text> </xsl:text>
725
723
  <xsl:apply-templates select="." mode="location-report"/>
@@ -728,7 +726,7 @@ Book (with parts), "section" at level 3
728
726
  <!-- check for bare % -->
729
727
  <xsl:if test="contains($inside, '%') and not(contains($inside, '\%'))">
730
728
  <xsl:message>
731
- <xsl:text>PTX:WARNING: a bare "%" inside \text{} in math must be escaped as "\%"</xsl:text>
729
+ <xsl:text>PTX:ERROR: a bare "%" inside \text{} in math must be escaped as "\%"</xsl:text>
732
730
  <xsl:text>&#xa;</xsl:text>
733
731
  <xsl:text> </xsl:text>
734
732
  <xsl:apply-templates select="." mode="location-report"/>
@@ -737,7 +735,7 @@ Book (with parts), "section" at level 3
737
735
  <!-- check for bare & -->
738
736
  <xsl:if test="contains($inside, '&amp;') and not(contains($inside, '\&amp;'))">
739
737
  <xsl:message>
740
- <xsl:text>PTX:WARNING: a bare "&amp;" inside \text{} in math must be escaped as "\&amp;"</xsl:text>
738
+ <xsl:text>PTX:ERROR: a bare "&amp;" inside \text{} in math must be escaped as "\&amp;"</xsl:text>
741
739
  <xsl:text>&#xa;</xsl:text>
742
740
  <xsl:text> </xsl:text>
743
741
  <xsl:apply-templates select="." mode="location-report"/>
@@ -1489,9 +1487,15 @@ Book (with parts), "section" at level 3
1489
1487
  <xsl:if test="$rows &gt; 1 or $cols &gt; 1">
1490
1488
  <xsl:text> (</xsl:text>
1491
1489
  <xsl:value-of select="$rows"/>
1492
- <xsl:call-template name="nbsp-character"/>
1493
- <xsl:call-template name="times-character"/>
1494
- <xsl:call-template name="nbsp-character"/>
1490
+ <xsl:call-template name="character">
1491
+ <xsl:with-param name="name" select="'nbsp'"/>
1492
+ </xsl:call-template>
1493
+ <xsl:call-template name="character">
1494
+ <xsl:with-param name="name" select="'times'"/>
1495
+ </xsl:call-template>
1496
+ <xsl:call-template name="character">
1497
+ <xsl:with-param name="name" select="'nbsp'"/>
1498
+ </xsl:call-template>
1495
1499
  <xsl:value-of select="$cols"/>
1496
1500
  <xsl:text> </xsl:text>
1497
1501
  <xsl:apply-templates select="." mode="type-name">
@@ -2012,7 +2016,7 @@ Book (with parts), "section" at level 3
2012
2016
  <xsl:if test="$wsdebug and not($text-processed = $middle-cleaned)">
2013
2017
  <!-- DEBUGGING follows, maybe move outward later -->
2014
2018
  <xsl:message>
2015
- <xsl:text>****&#xa;</xsl:text>
2019
+ <xsl:text>PTX:DEBUG: whitespace diagnostic&#xa;</xsl:text>
2016
2020
  <xsl:text>O:</xsl:text>
2017
2021
  <xsl:value-of select="." />
2018
2022
  <xsl:text>:O&#xa;</xsl:text>
@@ -2267,6 +2271,13 @@ Book (with parts), "section" at level 3
2267
2271
  <!-- Realization: usual presentation, within the enclosing chunk -->
2268
2272
 
2269
2273
 
2274
+ <!-- A conversion opts in to "division companion" chunks: the four -->
2275
+ <!-- elements of &DIVISION-COMPANION; earn their own page (chunk) -->
2276
+ <!-- exactly when their parent division is realized as a summary -->
2277
+ <!-- (intermediate) page. The HTML conversion opts in; conversions -->
2278
+ <!-- with their own chunking (WeBWorK sets, Sage doctest) do not. -->
2279
+ <xsl:variable name="b-division-companion-chunks" select="false()"/>
2280
+
2270
2281
  <!-- An intermediate node is at lesser level -->
2271
2282
  <!-- than chunk-level and is not a leaf -->
2272
2283
  <xsl:template match="*" mode="is-intermediate">
@@ -2317,6 +2328,22 @@ Book (with parts), "section" at level 3
2317
2328
  </xsl:choose>
2318
2329
  </xsl:template>
2319
2330
 
2331
+ <!-- A division companion is a chunk exactly when its parent -->
2332
+ <!-- is a summary (intermediate) page, and the conversion -->
2333
+ <!-- has opted in. It is never an intermediate node itself -->
2334
+ <!-- (the generic template answers correctly), and it is -->
2335
+ <!-- inline content of its parent's page in every other case -->
2336
+ <xsl:template match="&DIVISION-COMPANION;" mode="is-chunk">
2337
+ <xsl:choose>
2338
+ <xsl:when test="$b-division-companion-chunks">
2339
+ <xsl:apply-templates select="parent::*" mode="is-intermediate"/>
2340
+ </xsl:when>
2341
+ <xsl:otherwise>
2342
+ <xsl:value-of select="false()"/>
2343
+ </xsl:otherwise>
2344
+ </xsl:choose>
2345
+ </xsl:template>
2346
+
2320
2347
  <!-- #################################### -->
2321
2348
  <!-- Abstract Chunking of Structural Nodes-->
2322
2349
  <!-- #################################### -->
@@ -2363,11 +2390,23 @@ Book (with parts), "section" at level 3
2363
2390
  </xsl:when>
2364
2391
  <xsl:otherwise>
2365
2392
  <xsl:apply-templates select="." mode="intermediate" />
2366
- <xsl:apply-templates select="&STRUCTURAL;" mode="chunking" />
2393
+ <xsl:apply-templates select="&STRUCTURAL;|&DIVISION-COMPANION;" mode="chunking" />
2367
2394
  </xsl:otherwise>
2368
2395
  </xsl:choose>
2369
2396
  </xsl:template>
2370
2397
 
2398
+ <!-- A division companion produces a page (chunk) or nothing: -->
2399
+ <!-- it is only visited via the recursion above, so a parent -->
2400
+ <!-- summary page is guaranteed, but the opt-in may be off -->
2401
+ <xsl:template match="&DIVISION-COMPANION;" mode="chunking">
2402
+ <xsl:variable name="chunk">
2403
+ <xsl:apply-templates select="." mode="is-chunk" />
2404
+ </xsl:variable>
2405
+ <xsl:if test="$chunk = 'true'">
2406
+ <xsl:apply-templates select="." mode="chunk" />
2407
+ </xsl:if>
2408
+ </xsl:template>
2409
+
2371
2410
  <!-- docinfo, and anything else, is immune and dead-ends -->
2372
2411
  <xsl:template match="*" mode="chunking" />
2373
2412
 
@@ -2384,7 +2423,7 @@ Book (with parts), "section" at level 3
2384
2423
  <!-- parameter holding the contents of the body of the page -->
2385
2424
 
2386
2425
  <!-- A complete file/page for a structural division -->
2387
- <xsl:template match="&STRUCTURAL;" mode="chunk">
2426
+ <xsl:template match="&STRUCTURAL;|&DIVISION-COMPANION;" mode="chunk">
2388
2427
  <xsl:apply-templates select="." mode="file-wrap">
2389
2428
  <xsl:with-param name="content">
2390
2429
  <xsl:apply-templates select="." />
@@ -2886,7 +2925,7 @@ Book (with parts), "section" at level 3
2886
2925
  <xsl:variable name="normalized-width" select="normalize-space($raw-width)" />
2887
2926
  <xsl:choose>
2888
2927
  <xsl:when test="not(substring($normalized-width, string-length($normalized-width)) = '%')">
2889
- <xsl:message>PTX:WARNING: a "width" attribute should be given as a percentage (such as "40%", not as "<xsl:value-of select="$normalized-width" />, using 100% instead"</xsl:message>
2928
+ <xsl:message>PTX:FALLBACK: a "width" attribute should be given as a percentage (such as "40%", not as "<xsl:value-of select="$normalized-width" />, using 100% instead"</xsl:message>
2890
2929
  <xsl:apply-templates select="." mode="location-report" />
2891
2930
  <!-- replace by 100% -->
2892
2931
  <xsl:text>100%</xsl:text>
@@ -2981,7 +3020,7 @@ Book (with parts), "section" at level 3
2981
3020
  <!-- NaN does not equal *anything*, so tests if a number -->
2982
3021
  <!-- http://stackoverflow.com/questions/6895870 -->
2983
3022
  <xsl:when test="not(number($the-aspect) = number($the-aspect)) or ($the-aspect &lt; 0)">
2984
- <xsl:message>PTX:WARNING: the @aspect attribute should be a ratio, like 4:3, or a positive number, not "<xsl:value-of select="$the-aspect" />"</xsl:message>
3023
+ <xsl:message>PTX:ERROR: the @aspect attribute should be a ratio, like 4:3, or a positive number, not "<xsl:value-of select="$the-aspect" />"</xsl:message>
2985
3024
  <xsl:apply-templates select="." mode="location-report" />
2986
3025
  </xsl:when>
2987
3026
  <!-- survives as a number -->
@@ -3157,7 +3196,7 @@ Book (with parts), "section" at level 3
3157
3196
  <xsl:text>[</xsl:text>
3158
3197
  <xsl:value-of select="$str-id" />
3159
3198
  <xsl:text>]</xsl:text>
3160
- <xsl:message>PTX:WARNING: could not translate string with id "<xsl:value-of select="$str-id"/>" into language for code "<xsl:value-of select="$lang"/>"</xsl:message>
3199
+ <xsl:message>PTX:BUG: could not translate string with id "<xsl:value-of select="$str-id"/>" into language for code "<xsl:value-of select="$lang"/>"</xsl:message>
3161
3200
  </xsl:otherwise>
3162
3201
  </xsl:choose>
3163
3202
  </xsl:template>
@@ -3775,7 +3814,7 @@ Book (with parts), "section" at level 3
3775
3814
  </xsl:when>
3776
3815
  <xsl:when test="$b-host-runestone and not(@authored-label)">
3777
3816
  <xsl:message>
3778
- <xsl:text>PTX:WARNING: While building for a Runestone server, a PreTeXt "</xsl:text>
3817
+ <xsl:text>PTX:FALLBACK: While building for a Runestone server, a PreTeXt "</xsl:text>
3779
3818
  <xsl:value-of select="local-name(.)"/>
3780
3819
  <xsl:text>" element&#xa;</xsl:text>
3781
3820
  <xsl:text>has been encountered without a @label attribute. For reasons of backward-compatibility &#xa;</xsl:text>
@@ -3920,7 +3959,7 @@ Book (with parts), "section" at level 3
3920
3959
  <!-- or is defined to be a null string in a particular conversion stylesheet, in which -->
3921
3960
  <!-- case no extra space is added. -->
3922
3961
  <xsl:template name="case-cycle-delimiter-space">
3923
- <xsl:message>PTX:BUG A "case" has "direction" equal to "cycle", but the conversion for this output target does not have a "delimiter space" symbol defined. The maintainer for this output target may wish to know about this (or may wish to set the "delimiter space" symbol to be a null string to suppress this warning message).</xsl:message>
3962
+ <xsl:message>PTX:BUG: A "case" has "direction" equal to "cycle", but the conversion for this output target does not have a "delimiter space" symbol defined. The maintainer for this output target may wish to know about this (or may wish to set the "delimiter space" symbol to be a null string to suppress this warning message).</xsl:message>
3924
3963
  <xsl:apply-templates select="." mode="location-report"/>
3925
3964
  </xsl:template>
3926
3965
 
@@ -4306,7 +4345,7 @@ Book (with parts), "section" at level 3
4306
4345
  <xsl:if test="$normalized-aspect = 0">
4307
4346
  <xsl:message>PTX:FATAL: an @aspect attribute equal to zero will cause serious errors.</xsl:message>
4308
4347
  <xsl:apply-templates select="." mode="location-report" />
4309
- <xsl:message terminate="yes">Quitting...</xsl:message>
4348
+ <xsl:message terminate="yes">PTX:FATAL: Quitting...</xsl:message>
4310
4349
  </xsl:if>
4311
4350
 
4312
4351
  <!-- Perhaps save for debugging -->
@@ -4488,7 +4527,7 @@ Book (with parts), "section" at level 3
4488
4527
  <!-- count the elements destined for panels -->
4489
4528
  <xsl:variable name="number-panels" select="count(*)" />
4490
4529
  <xsl:if test="$sbsdebug">
4491
- <xsl:message>N:<xsl:value-of select="$number-panels" />:N</xsl:message>
4530
+ <xsl:message>PTX:DEBUG: N:<xsl:value-of select="$number-panels" />:N</xsl:message>
4492
4531
  </xsl:if>
4493
4532
  <!-- Add to RTF -->
4494
4533
  <number-panels>
@@ -4534,7 +4573,7 @@ Book (with parts), "section" at level 3
4534
4573
  </xsl:choose>
4535
4574
  </xsl:variable>
4536
4575
  <xsl:if test="$sbsdebug">
4537
- <xsl:message>VA:<xsl:value-of select="$valigns" />:VA</xsl:message>
4576
+ <xsl:message>PTX:DEBUG: VA:<xsl:value-of select="$valigns" />:VA</xsl:message>
4538
4577
  </xsl:if>
4539
4578
  <!-- check length (author-supplied could be wrong) -->
4540
4579
  <xsl:variable name="nspaces-valigns" select="string-length($valigns) - string-length(translate($valigns, ' ', ''))" />
@@ -4542,7 +4581,7 @@ Book (with parts), "section" at level 3
4542
4581
  <xsl:when test="$nspaces-valigns &lt; $number-panels">
4543
4582
  <xsl:message>PTX:FATAL: a &lt;sidebyside&gt; or &lt;sbsgroup&gt; does not have enough "@valigns" (maybe you did not specify enough?)</xsl:message>
4544
4583
  <xsl:apply-templates select="." mode="location-report" />
4545
- <xsl:message terminate="yes"> That's fatal. Sorry. Quitting...</xsl:message>
4584
+ <xsl:message terminate="yes">PTX:FATAL: Quitting...</xsl:message>
4546
4585
  </xsl:when>
4547
4586
  <xsl:when test="$nspaces-valigns &gt; $number-panels">
4548
4587
  <xsl:message>PTX:WARNING: a &lt;sidebyside&gt; or &lt;sbsgroup&gt; has extra "@valigns" (did you confuse singular and plural attribute names?)</xsl:message>
@@ -4694,7 +4733,7 @@ Book (with parts), "section" at level 3
4694
4733
  </xsl:choose>
4695
4734
  </xsl:variable>
4696
4735
  <xsl:if test="$sbsdebug">
4697
- <xsl:message>M:<xsl:value-of select="$left-margin" />:<xsl:value-of select="$right-margin" />:M</xsl:message>
4736
+ <xsl:message>PTX:DEBUG: M:<xsl:value-of select="$left-margin" />:<xsl:value-of select="$right-margin" />:M</xsl:message>
4698
4737
  </xsl:if>
4699
4738
  <!-- error check for reasonable values -->
4700
4739
  <!-- When there are three values, the "left" margin still -->
@@ -4739,7 +4778,7 @@ Book (with parts), "section" at level 3
4739
4778
  </xsl:choose>
4740
4779
  </xsl:variable>
4741
4780
  <xsl:if test="$sbsdebug">
4742
- <xsl:message>W:<xsl:value-of select="$widths" />:W</xsl:message>
4781
+ <xsl:message>PTX:DEBUG: W:<xsl:value-of select="$widths" />:W</xsl:message>
4743
4782
  </xsl:if>
4744
4783
  <!-- check length (author-supplied could be wrong) -->
4745
4784
  <xsl:variable name="nspaces-widths" select="string-length($widths) - string-length(translate($widths, ' ', ''))" />
@@ -4747,7 +4786,7 @@ Book (with parts), "section" at level 3
4747
4786
  <xsl:when test="$nspaces-widths &lt; $number-panels">
4748
4787
  <xsl:message>PTX:FATAL: a &lt;sidebyside&gt; or &lt;sbsgroup&gt; does not have enough "@widths" (maybe you did not specify enough?)</xsl:message>
4749
4788
  <xsl:apply-templates select="." mode="location-report" />
4750
- <xsl:message terminate="yes"> That's fatal. Sorry. Quitting...</xsl:message>
4789
+ <xsl:message terminate="yes">PTX:FATAL: Quitting...</xsl:message>
4751
4790
  </xsl:when>
4752
4791
  <xsl:when test="$nspaces-widths &gt; $number-panels">
4753
4792
  <xsl:message>PTX:WARNING: a &lt;sidebyside&gt; or &lt;sbsgroup&gt; has extra "@widths" (did you confuse singular and plural attribute names?)</xsl:message>
@@ -4778,7 +4817,7 @@ Book (with parts), "section" at level 3
4778
4817
  <xsl:text>%</xsl:text>
4779
4818
  </xsl:variable>
4780
4819
  <xsl:if test="$sbsdebug">
4781
- <xsl:message>SW:<xsl:value-of select="$space-width" />:SW</xsl:message>
4820
+ <xsl:message>PTX:DEBUG: SW:<xsl:value-of select="$space-width" />:SW</xsl:message>
4782
4821
  </xsl:if>
4783
4822
  <!-- overall error check on space width -->
4784
4823
  <xsl:choose>
@@ -4871,6 +4910,32 @@ Book (with parts), "section" at level 3
4871
4910
  <!-- SideBySide Main Template -->
4872
4911
  <!-- ######################## -->
4873
4912
 
4913
+ <!-- Panels are converted first, each through the modal -->
4914
+ <!-- "panel-panel" template, and the results accumulate into a -->
4915
+ <!-- single result-tree fragment. That fragment, plus the computed -->
4916
+ <!-- layout, goes to the modal "compose-panels" template, which can -->
4917
+ <!-- wrap the finished panels but cannot place structure between -->
4918
+ <!-- them. The "panel-panel" parameters are the union of what the -->
4919
+ <!-- implementations need, so any one implementation may ignore -->
4920
+ <!-- some of them. This two-phase contract fits a conversion whose -->
4921
+ <!-- target expresses the entire layout declaratively on a -->
4922
+ <!-- container: HTML (CSS grid on a wrapping div; EPUB and Jupyter -->
4923
+ <!-- inherit), LaTeX (arguments of the "sidebyside" environment; -->
4924
+ <!-- Beamer and the solution manual inherit), and Reveal.js (CSS -->
4925
+ <!-- table display). A target that must interleave structure among -->
4926
+ <!-- the panels (XSL-FO: margin and gap table cells) or that has no -->
4927
+ <!-- horizontal layout at all (text, and Markdown by import; -->
4928
+ <!-- braille) instead overrides this template entirely and reuses -->
4929
+ <!-- the "layout-parameters" computation where meaningful; each -->
4930
+ <!-- such stylesheet documents its reasons. The panel vocabulary -->
4931
+ <!-- is context-dependent beyond what the schema expresses: an -->
4932
+ <!-- "exercise" panel only within a "worksheet" or "handout", a -->
4933
+ <!-- "slate" panel only within an "interactive", and never an -->
4934
+ <!-- "audio", "video", or "interactive", whose static -->
4935
+ <!-- representation is itself a manufactured "sidebyside", which -->
4936
+ <!-- must not nest. The validation-plus stylesheet enforces all -->
4937
+ <!-- three restrictions. -->
4938
+
4874
4939
  <xsl:template match="sidebyside">
4875
4940
  <xsl:param name="b-original" select="true()" />
4876
4941
  <xsl:param name="heading-level"/>
@@ -4913,23 +4978,10 @@ Book (with parts), "section" at level 3
4913
4978
  <xsl:message>~~~~~~~~~~~~~~~~~~~~</xsl:message>
4914
4979
  -->
4915
4980
 
4916
- <!-- "paragraphs" deprecated within sidebyside, 2018-05-02 -->
4917
- <!-- jsxgraph deprecated? Check -->
4918
-
4919
- <xsl:variable name="panels" select="p|pre|ol|ul|dl|program|console|poem|audio|video|interactive|slate|exercise|image|figure|table|listing|list|tabular|stack|jsxgraph|paragraphs" />
4981
+ <xsl:variable name="panels" select="&SBSPANEL;" />
4920
4982
 
4921
- <!-- We build up lists of various parts of a panel -->
4922
- <!-- It has setup (LaTeX), headers (titles), panels, -->
4923
- <!-- and captions. These then go to "compose-panels". -->
4924
- <!-- Implementations need to define modal templates -->
4925
- <!-- panel-header, panel-panel, panel-caption -->
4926
- <!-- The parameters passed to each is the union of what -->
4927
- <!-- is needed for LaTeX and HTML implementations. -->
4928
- <!-- Final results are collectively sent to modal -->
4929
- <!-- compose-panels -->
4930
- <!-- template to be arranged -->
4931
- <!-- TODO: Instead we could pass the $layout to the four, -->
4932
- <!-- and infer the $panel-number in the receiving templates. -->
4983
+ <!-- TODO: Instead we could pass the $layout to "panel-panel", -->
4984
+ <!-- and infer the $panel-number in the receiving templates. -->
4933
4985
 
4934
4986
  <xsl:variable name="panel-panels">
4935
4987
  <xsl:for-each select="$panels">
@@ -5004,7 +5056,7 @@ Book (with parts), "section" at level 3
5004
5056
  <xsl:param name="width" />
5005
5057
  <xsl:param name="heading-level"/>
5006
5058
 
5007
- <xsl:apply-templates select="tabular|image|p|pre|ol|ul|dl|audio|video|interactive|slate|program|console|exercise">
5059
+ <xsl:apply-templates select="&STACKABLE;">
5008
5060
  <xsl:with-param name="b-original" select="$b-original" />
5009
5061
  <xsl:with-param name="width" select="$width"/>
5010
5062
  <xsl:with-param name="heading-level" select="$heading-level"/>
@@ -5038,7 +5090,7 @@ Book (with parts), "section" at level 3
5038
5090
  <xsl:template match="li[p|ol|ul|dl]/text()">
5039
5091
  <xsl:variable name="text" select="normalize-space(.)" />
5040
5092
  <xsl:if test="$text">
5041
- <xsl:message>PTX:WARNING: Unstructured content within a list item is being ignored ("<xsl:value-of select="$text" />")</xsl:message>
5093
+ <xsl:message>PTX:ERROR: Unstructured content within a list item is being ignored ("<xsl:value-of select="$text" />")</xsl:message>
5042
5094
  <xsl:apply-templates select=".." mode="location-report" />
5043
5095
  </xsl:if>
5044
5096
  </xsl:template>
@@ -5144,7 +5196,7 @@ Book (with parts), "section" at level 3
5144
5196
  <xsl:when test="@marker='square'">square</xsl:when>
5145
5197
  <xsl:when test="@marker=''">none</xsl:when>
5146
5198
  <xsl:otherwise>
5147
- <xsl:message>ptx:ERROR: unordered list label (<xsl:value-of select="@marker" />) not recognized</xsl:message>
5199
+ <xsl:message>PTX:ERROR: unordered list label (<xsl:value-of select="@marker" />) not recognized</xsl:message>
5148
5200
  </xsl:otherwise>
5149
5201
  </xsl:choose>
5150
5202
  </xsl:when>
@@ -5587,7 +5639,7 @@ Book (with parts), "section" at level 3
5587
5639
  <xsl:when test="substring($raw-workspace, string-length($raw-workspace) - 0) = '%'">
5588
5640
  <xsl:variable name="approximate-inches" select="concat(substring($raw-workspace, 1, string-length($raw-workspace) - 1) div 10, 'in')"/>
5589
5641
  <xsl:value-of select="$approximate-inches"/>
5590
- <xsl:message>PTX:WARNING: as of 2020-03-17 worksheet exercises' workspace should be specified in 'in' or in 'cm'. Approximating a page fraction of <xsl:value-of select="@workspace"/> by <xsl:value-of select="$approximate-inches"/>.</xsl:message>
5642
+ <xsl:message>PTX:FALLBACK: as of 2020-03-17 worksheet exercises' workspace should be specified in 'in' or in 'cm'. Approximating a page fraction of <xsl:value-of select="@workspace"/> by <xsl:value-of select="$approximate-inches"/>.</xsl:message>
5591
5643
  <xsl:apply-templates select="." mode="location-report"/>
5592
5644
  </xsl:when>
5593
5645
  <xsl:when test="substring($raw-workspace, string-length($raw-workspace) - 1) = 'in'">
@@ -5597,7 +5649,7 @@ Book (with parts), "section" at level 3
5597
5649
  <xsl:value-of select="$raw-workspace"/>
5598
5650
  </xsl:when>
5599
5651
  <xsl:otherwise>
5600
- <xsl:message>PTX:WARNING: a worksheet exercises', project-likes' or tasks' workspace should be specified with units of 'in' or 'cm', and not as "<xsl:value-of select="@workspace"/>". Using a default of "2in".</xsl:message>
5652
+ <xsl:message>PTX:FALLBACK: a worksheet exercises', project-likes' or tasks' workspace should be specified with units of 'in' or 'cm', and not as "<xsl:value-of select="@workspace"/>". Using a default of "2in".</xsl:message>
5601
5653
  <xsl:text>2in</xsl:text>
5602
5654
  </xsl:otherwise>
5603
5655
  </xsl:choose>
@@ -5641,7 +5693,7 @@ Book (with parts), "section" at level 3
5641
5693
  <exercise-component-report has-hint="{$b-has-reading-hint}" has-answer="{$b-has-reading-answer}" has-solution="{$b-has-reading-solution}"/>
5642
5694
  </xsl:when>
5643
5695
  <xsl:otherwise>
5644
- <xsl:message>PTX:ERROR: can't determine exercise type</xsl:message>
5696
+ <xsl:message>PTX:BUG: can't determine exercise type</xsl:message>
5645
5697
  <xsl:apply-templates select="." mode="location-report" />
5646
5698
  </xsl:otherwise>
5647
5699
  </xsl:choose>
@@ -5710,7 +5762,7 @@ Book (with parts), "section" at level 3
5710
5762
  <!-- template -->
5711
5763
  <xsl:variable name="scope" select="id(@scope)"/>
5712
5764
  <xsl:if test="not($scope)">
5713
- <xsl:message>PTX:WARNING: unresolved @scope ("<xsl:value-of select="@scope"/>") for a &lt;solutions&gt; division</xsl:message>
5765
+ <xsl:message>PTX:ERROR: unresolved @scope ("<xsl:value-of select="@scope"/>") for a &lt;solutions&gt; division</xsl:message>
5714
5766
  <xsl:apply-templates select="." mode="location-report" />
5715
5767
  </xsl:if>
5716
5768
  <xsl:if test="not($scope/self::book|$scope/self::article|$scope/self::chapter|$scope/self::section|$scope/self::subsection|$scope/self::subsubsection|$scope/self::exercises|$scope/self::worksheet|$scope/self::reading-questions)">
@@ -7283,12 +7335,9 @@ Book (with parts), "section" at level 3
7283
7335
 
7284
7336
 
7285
7337
  <!-- Programming Language Names -->
7286
- <!-- Packages for listing and syntax highlighting -->
7287
- <!-- have their own ideas about the names of languages -->
7288
- <!-- We use keys to perform the translation -->
7289
- <!-- See: https://gist.github.com/frabad/4189876 -->
7290
- <!-- for motivation and document() syntax for standalone file -->
7291
- <!-- Also: see contributors in FCLA work -->
7338
+ <!-- Packages for listing and syntax highlighting -->
7339
+ <!-- have their own ideas about the names of languages -->
7340
+ <!-- We use keys to perform the translation -->
7292
7341
 
7293
7342
  <!-- The data: attribute is our usage, elements belong to -->
7294
7343
  <!-- other packages. Blank means not explicitly supported. -->
@@ -7311,64 +7360,63 @@ Book (with parts), "section" at level 3
7311
7360
  <!-- additional popular packages (e.g. numpy, pandas) -->
7312
7361
  <!-- are available. -->
7313
7362
 
7314
- <!-- Our strings (@ptx) are always all-lowercase, no symbols, no punctuation -->
7315
- <mb:programming>
7363
+ <!-- Our strings (@name) are always all-lowercase, no symbols, no punctuation -->
7364
+ <xsl:variable name="programming-language-rtf">
7316
7365
  <!-- Procedural -->
7317
- <language ptx="basic" active="" listings="Basic" prism="basic"/>
7318
- <language ptx="c" active="c" listings="C" prism="c"/>
7319
- <language ptx="cpp" active="cpp" listings="C++" prism="cpp"/>
7320
- <language ptx="go" active="" listings="C" prism="go"/>
7321
- <language ptx="java" active="java" listings="Java" prism="java"/>
7322
- <language ptx="javascript" active="javascript" listings="" prism="javascript"/>
7323
- <language ptx="kotlin" active="kotlin" listings="" prism="kotlin"/>
7324
- <language ptx="lua" active="" listings="Lua" prism="lua"/>
7325
- <language ptx="pascal" active="" listings="Pascal" prism="pascal"/>
7326
- <language ptx="perl" active="" listings="Perl" prism="perl"/>
7327
- <language ptx="python" active="python" listings="Python" prism="py"/>
7328
- <language ptx="python3" active="python3" listings="Python" prism="py"/>
7329
- <language ptx="r" active="" listings="R" prism="r"/>
7330
- <language ptx="s" active="" listings="S" prism="s"/>
7331
- <language ptx="sas" active="" listings="SAS" prism="s"/>
7332
- <language ptx="sage" active="" listings="Python" prism="py"/>
7333
- <language ptx="splus" active="" listings="[Plus]S" prism="s"/>
7334
- <language ptx="vbasic" active="" listings="[Visual]Basic" prism="visual-basic"/>
7335
- <language ptx="vbscript" active="" listings="VBscript" prism="visual-basic"/>
7366
+ <language name="basic" active="" listings="Basic" prism="basic"/>
7367
+ <language name="c" active="c" listings="C" prism="c"/>
7368
+ <language name="cpp" active="cpp" listings="C++" prism="cpp"/>
7369
+ <language name="go" active="" listings="C" prism="go"/>
7370
+ <language name="java" active="java" listings="Java" prism="java"/>
7371
+ <language name="javascript" active="javascript" listings="" prism="javascript"/>
7372
+ <language name="kotlin" active="kotlin" listings="" prism="kotlin"/>
7373
+ <language name="lua" active="" listings="Lua" prism="lua"/>
7374
+ <language name="pascal" active="" listings="Pascal" prism="pascal"/>
7375
+ <language name="perl" active="" listings="Perl" prism="perl"/>
7376
+ <language name="python" active="python" listings="Python" prism="py"/>
7377
+ <language name="python3" active="python3" listings="Python" prism="py"/>
7378
+ <language name="r" active="" listings="R" prism="r"/>
7379
+ <language name="s" active="" listings="S" prism="s"/>
7380
+ <language name="sas" active="" listings="SAS" prism="s"/>
7381
+ <language name="sage" active="" listings="Python" prism="py"/>
7382
+ <language name="splus" active="" listings="[Plus]S" prism="s"/>
7383
+ <language name="vbasic" active="" listings="[Visual]Basic" prism="visual-basic"/>
7384
+ <language name="vbscript" active="" listings="VBscript" prism="visual-basic"/>
7336
7385
  <!-- Others (esp. functional) -->
7337
- <language ptx="clojure" active="" listings="Lisp" prism="clojure"/>
7338
- <language ptx="lisp" active="" listings="Lisp" prism="lisp"/>
7339
- <language ptx="clisp" active="" listings="Lisp" prism="lisp"/>
7340
- <language ptx="elisp" active="" listings="Lisp" prism="elisp"/>
7341
- <language ptx="scheme" active="" listings="Lisp" prism="scheme"/>
7342
- <language ptx="racket" active="" listings="Lisp" prism="racket"/>
7343
- <language ptx="sql" active="sql" listings="SQL" prism="sql"/>
7344
- <language ptx="llvm" active="" listings="LLVM" prism="llvm"/>
7345
- <language ptx="matlab" active="" listings="Matlab" prism="matlab"/>
7346
- <language ptx="octave" active="octave" listings="Octave" prism="matlab"/>
7347
- <language ptx="ml" active="" listings="ML" prism=""/>
7348
- <language ptx="ocaml" active="" listings="[Objective]Caml" prism="ocaml"/>
7349
- <language ptx="fsharp" active="" listings="ML" prism="fsharp"/>
7386
+ <language name="clojure" active="" listings="Lisp" prism="clojure"/>
7387
+ <language name="lisp" active="" listings="Lisp" prism="lisp"/>
7388
+ <language name="clisp" active="" listings="Lisp" prism="lisp"/>
7389
+ <language name="elisp" active="" listings="Lisp" prism="elisp"/>
7390
+ <language name="scheme" active="" listings="Lisp" prism="scheme"/>
7391
+ <language name="racket" active="" listings="Lisp" prism="racket"/>
7392
+ <language name="sql" active="sql" listings="SQL" prism="sql"/>
7393
+ <language name="llvm" active="" listings="LLVM" prism="llvm"/>
7394
+ <language name="matlab" active="" listings="Matlab" prism="matlab"/>
7395
+ <language name="octave" active="octave" listings="Octave" prism="matlab"/>
7396
+ <language name="ml" active="" listings="ML" prism=""/>
7397
+ <language name="ocaml" active="" listings="[Objective]Caml" prism="ocaml"/>
7398
+ <language name="fsharp" active="" listings="ML" prism="fsharp"/>
7350
7399
  <!-- Text Manipulation -->
7351
- <language ptx="css" active="" listings="" prism="css"/>
7352
- <language ptx="latex" active="" listings="[LaTeX]TeX" prism="latex"/>
7353
- <language ptx="html" active="html" listings="HTML" prism="html"/>
7354
- <language ptx="tex" active="" listings="[plain]TeX" prism="tex"/>
7355
- <language ptx="xml" active="" listings="XML" prism="xml"/>
7356
- <language ptx="xslt" active="" listings="XSLT" prism="xml"/>
7357
- </mb:programming>
7400
+ <language name="css" active="" listings="" prism="css"/>
7401
+ <language name="latex" active="" listings="[LaTeX]TeX" prism="latex"/>
7402
+ <language name="html" active="html" listings="HTML" prism="html"/>
7403
+ <language name="tex" active="" listings="[plain]TeX" prism="tex"/>
7404
+ <language name="xml" active="" listings="XML" prism="xml"/>
7405
+ <language name="xslt" active="" listings="XSLT" prism="xml"/>
7406
+ </xsl:variable>
7407
+
7408
+ <xsl:variable name="programming-language-table"
7409
+ select="exsl:node-set($programming-language-rtf)"/>
7358
7410
 
7359
7411
  <!-- Define the key for indexing into the data list -->
7360
- <xsl:key name="proglang" match="language" use="@ptx" />
7361
- <!-- And make a variable with the context for key lookups useing that key -->
7362
- <!-- doing the 'document('')/*/mb:programming' repeatedly is expensive. -->
7363
- <!-- (Especially in program|pf[prism-language] -->
7364
- <xsl:variable name="proglang-key-context" select="exsl:node-set(document('')/*/mb:programming)"/>
7412
+ <xsl:key name="programming-language-key" match="language" use="@name"/>
7365
7413
 
7366
7414
  <!-- Define variables for default active language - will be picked up by -->
7367
7415
  <!-- RS manifest and can be a different string than the raw language. -->
7368
7416
  <xsl:variable name="default-active-programming-language">
7369
7417
  <xsl:if test="$version-docinfo/programs/@language">
7370
- <xsl:for-each select="$proglang-key-context">
7371
- <xsl:value-of select="key('proglang', $version-docinfo/programs/@language)/@active" />
7418
+ <xsl:for-each select="$programming-language-table">
7419
+ <xsl:value-of select="key('programming-language-key', $version-docinfo/programs/@language)/@active" />
7372
7420
  </xsl:for-each>
7373
7421
  </xsl:if>
7374
7422
  </xsl:variable>
@@ -7404,8 +7452,8 @@ Book (with parts), "section" at level 3
7404
7452
  <xsl:variable name="language">
7405
7453
  <xsl:apply-templates select="." mode="get-programming-language"/>
7406
7454
  </xsl:variable>
7407
- <xsl:for-each select="$proglang-key-context">
7408
- <xsl:value-of select="key('proglang', $language)/@active" />
7455
+ <xsl:for-each select="$programming-language-table">
7456
+ <xsl:value-of select="key('programming-language-key', $language)/@active" />
7409
7457
  </xsl:for-each>
7410
7458
  </xsl:template>
7411
7459
 
@@ -7415,30 +7463,19 @@ Book (with parts), "section" at level 3
7415
7463
  <xsl:variable name="language">
7416
7464
  <xsl:apply-templates select="." mode="get-programming-language"/>
7417
7465
  </xsl:variable>
7418
- <xsl:for-each select="$proglang-key-context">
7419
- <xsl:value-of select="key('proglang', $language)/@listings" />
7466
+ <xsl:for-each select="$programming-language-table">
7467
+ <xsl:value-of select="key('programming-language-key', $language)/@listings" />
7420
7468
  </xsl:for-each>
7421
7469
  </xsl:template>
7422
7470
 
7423
- <!-- This works, without keys, and could be adapted to range over actual data in text -->
7424
- <!-- For example, this approach is used for contributors to FCLA -->
7425
- <!--
7426
- <xsl:template match="*" mode="listings-language">
7427
- <xsl:variable name="language">
7428
- <xsl:value-of select="@language"/>
7429
- </xsl:variable>
7430
- <xsl:value-of select="document('')/*/mb:programming/language[@ptx=$language]/listings"/>
7431
- </xsl:template>
7432
- -->
7433
-
7434
7471
  <!-- A whole <program> node comes in, -->
7435
7472
  <!-- text of prism name comes out -->
7436
7473
  <xsl:template match="program|pf" mode="prism-language">
7437
7474
  <xsl:variable name="language">
7438
7475
  <xsl:apply-templates select="." mode="get-programming-language"/>
7439
7476
  </xsl:variable>
7440
- <xsl:for-each select="$proglang-key-context">
7441
- <xsl:value-of select="key('proglang', $language)/@prism" />
7477
+ <xsl:for-each select="$programming-language-table">
7478
+ <xsl:value-of select="key('programming-language-key', $language)/@prism" />
7442
7479
  </xsl:for-each>
7443
7480
  </xsl:template>
7444
7481
 
@@ -8261,7 +8298,9 @@ Book (with parts), "section" at level 3
8261
8298
  <xsl:choose>
8262
8299
  <xsl:when test="$b-is-biblio-target">
8263
8300
  <xsl:text>,</xsl:text>
8264
- <xsl:call-template name="nbsp-character"/>
8301
+ <xsl:call-template name="character">
8302
+ <xsl:with-param name="name" select="'nbsp'"/>
8303
+ </xsl:call-template>
8265
8304
  <!-- this info should not be in an attribute! -->
8266
8305
  <xsl:apply-templates select="@detail" />
8267
8306
  </xsl:when>
@@ -8380,7 +8419,9 @@ Book (with parts), "section" at level 3
8380
8419
  <xsl:apply-templates/>
8381
8420
  </xsl:with-param>
8382
8421
  </xsl:apply-templates>
8383
- <xsl:call-template name="ndash-character"/>
8422
+ <xsl:call-template name="character">
8423
+ <xsl:with-param name="name" select="'ndash'"/>
8424
+ </xsl:call-template>
8384
8425
  <xsl:apply-templates select="." mode="xref-text" >
8385
8426
  <xsl:with-param name="target" select="$target-two" />
8386
8427
  <xsl:with-param name="text-style" select="$text-style-two" />
@@ -8540,7 +8581,7 @@ Book (with parts), "section" at level 3
8540
8581
 
8541
8582
  <!-- Warnings for a high-frequency mistake -->
8542
8583
  <xsl:template match="xref[not(@ref) and not(@first and @last) and not(@provisional)]">
8543
- <xsl:message>PTX:WARNING: A cross-reference (&lt;xref&gt;) must have a @ref attribute, a @first/@last attribute pair, or a @provisional attribute</xsl:message>
8584
+ <xsl:message>PTX:ERROR: A cross-reference (&lt;xref&gt;) must have a @ref attribute, a @first/@last attribute pair, or a @provisional attribute</xsl:message>
8544
8585
  <xsl:apply-templates select="." mode="location-report" />
8545
8586
  <xsl:call-template name="inline-warning">
8546
8587
  <xsl:with-param name="warning">
@@ -8810,7 +8851,7 @@ Book (with parts), "section" at level 3
8810
8851
  </xsl:variable>
8811
8852
  <xsl:if test="$the-title = ''">
8812
8853
  <xsl:message>
8813
- <xsl:text>PTX:WARNING: </xsl:text>
8854
+ <xsl:text>PTX:ERROR: </xsl:text>
8814
8855
  <xsl:text>An &lt;xref&gt; wants to build text using a title to identify the target, but the target (which has @xml:id "</xsl:text>
8815
8856
  <xsl:value-of select="@ref"/>
8816
8857
  <xsl:text>") has no title, not even a default title.</xsl:text>
@@ -8821,7 +8862,7 @@ Book (with parts), "section" at level 3
8821
8862
  <xsl:when test="$text-style = 'custom'">
8822
8863
  <xsl:if test="not($b-has-content)">
8823
8864
  <xsl:message>
8824
- <xsl:text>PTX:WARNING: </xsl:text>
8865
+ <xsl:text>PTX:ERROR: </xsl:text>
8825
8866
  <xsl:text>An &lt;xref&gt; wants to use custom text to describe the target, but no custom text was provided as the content of the "xref".</xsl:text>
8826
8867
  </xsl:message>
8827
8868
  <xsl:apply-templates select="." mode="location-report" />
@@ -8842,7 +8883,7 @@ Book (with parts), "section" at level 3
8842
8883
  </xsl:variable>
8843
8884
  <xsl:if test="($the-number = '') and not($b-is-contributor-target)">
8844
8885
  <xsl:message>
8845
- <xsl:text>PTX:WARNING: </xsl:text>
8886
+ <xsl:text>PTX:ERROR: </xsl:text>
8846
8887
  <xsl:text>An &lt;xref&gt; wants to build text using a number to identify the target, but the target (which has @xml:id "</xsl:text>
8847
8888
  <xsl:value-of select="@ref"/>
8848
8889
  <xsl:text>") does not have a number. You could try 'text="title"' or 'text="custom"' on the "xref".</xsl:text>
@@ -8986,13 +9027,13 @@ Book (with parts), "section" at level 3
8986
9027
  <!-- catch this first and provide no text at all (could provide busted text?) -->
8987
9028
  <!-- anonymous lists live in "p", but this is an unreliable indication -->
8988
9029
  <xsl:when test="($text-style = 'phrase-global' or $text-style = 'phrase-hybrid') and ($target/self::li and not($target/ancestor::list or $target/ancestor::objectives or $target/ancestor::outcomes or $target/ancestor::exercise))">
8989
- <xsl:message>PTX:WARNING: a cross-reference to a list item of an anonymous list ("<xsl:apply-templates select="$target" mode="serial-number" />") with 'phrase-global' and 'phrase-hybrid' styles for the xref text will yield no text at all, and possibly create unpredictable results in output</xsl:message>
9030
+ <xsl:message>PTX:ERROR: a cross-reference to a list item of an anonymous list ("<xsl:apply-templates select="$target" mode="serial-number" />") with 'phrase-global' and 'phrase-hybrid' styles for the xref text will yield no text at all, and possibly create unpredictable results in output</xsl:message>
8990
9031
  </xsl:when>
8991
9032
  <xsl:when test="$text-style = 'phrase-global' or $text-style = 'phrase-hybrid'">
8992
9033
  <!-- no content override in this case -->
8993
9034
  <!-- maybe we can relax this somehow? -->
8994
9035
  <xsl:if test="$b-has-content">
8995
- <xsl:message>PTX:WARNING: providing content ("<xsl:value-of select="." />") for an "xref" element is ignored for 'phrase-global' and 'phrase-hybrid' styles for xref text</xsl:message>
9036
+ <xsl:message>PTX:FALLBACK: providing content ("<xsl:value-of select="." />") for an "xref" element is ignored for 'phrase-global' and 'phrase-hybrid' styles for xref text</xsl:message>
8996
9037
  <xsl:apply-templates select="." mode="location-report" />
8997
9038
  </xsl:if>
8998
9039
  <!-- type-local first, no matter what -->
@@ -9054,7 +9095,7 @@ Book (with parts), "section" at level 3
9054
9095
  <!-- we can get here by a variety of routes.) -->
9055
9096
  <xsl:when test="$b-has-content">
9056
9097
  <xsl:message>
9057
- <xsl:text>PTX:WARNING: </xsl:text>
9098
+ <xsl:text>PTX:DEPRECATE: </xsl:text>
9058
9099
  <xsl:text>An &lt;xref&gt; requests a 'title' as its text but also provides alternate content. The construction is deprecated as of 2020-02-18. Instead, specify that xref/@text should be 'custom', either globally or on a per-xref basis.</xsl:text>
9059
9100
  </xsl:message>
9060
9101
  <xsl:apply-templates select="." mode="location-report" />
@@ -9091,7 +9132,9 @@ Book (with parts), "section" at level 3
9091
9132
  <xsl:text> </xsl:text>
9092
9133
  </xsl:when>
9093
9134
  <xsl:otherwise>
9094
- <xsl:call-template name="nbsp-character"/>
9135
+ <xsl:call-template name="character">
9136
+ <xsl:with-param name="name" select="'nbsp'"/>
9137
+ </xsl:call-template>
9095
9138
  </xsl:otherwise>
9096
9139
  </xsl:choose>
9097
9140
  </xsl:template>
@@ -9237,7 +9280,9 @@ Book (with parts), "section" at level 3
9237
9280
  <!-- connector, internationalize -->
9238
9281
  <xsl:text> of </xsl:text>
9239
9282
  <xsl:apply-templates select="$highest-match" mode="type-name" />
9240
- <xsl:call-template name="nbsp-character"/>
9283
+ <xsl:call-template name="character">
9284
+ <xsl:with-param name="name" select="'nbsp'"/>
9285
+ </xsl:call-template>
9241
9286
  <xsl:apply-templates select="$highest-match" mode="xref-number">
9242
9287
  <xsl:with-param name="xref" select="." />
9243
9288
  </xsl:apply-templates>
@@ -9312,7 +9357,9 @@ Book (with parts), "section" at level 3
9312
9357
  <!-- connector, internationalize -->
9313
9358
  <xsl:text> of </xsl:text>
9314
9359
  <xsl:apply-templates select="$targets-list" mode="type-name" />
9315
- <xsl:call-template name="nbsp-character"/>
9360
+ <xsl:call-template name="character">
9361
+ <xsl:with-param name="name" select="'nbsp'"/>
9362
+ </xsl:call-template>
9316
9363
  <xsl:apply-templates select="$targets-list" mode="xref-number">
9317
9364
  <xsl:with-param name="xref" select="." />
9318
9365
  </xsl:apply-templates>
@@ -9523,41 +9570,12 @@ Book (with parts), "section" at level 3
9523
9570
  <!-- Dashes and hyphens - worth reviewing -->
9524
9571
  <!-- http://www.cs.tut.fi/~jkorpela/dashes.html -->
9525
9572
 
9526
- <xsl:template name="nbsp-character">
9527
- <xsl:call-template name="warn-unimplemented-character">
9528
- <xsl:with-param name="char-name" select="'nbsp'"/>
9529
- </xsl:call-template>
9530
- </xsl:template>
9531
- <xsl:template match="nbsp">
9532
- <xsl:call-template name="nbsp-character"/>
9533
- </xsl:template>
9534
-
9535
- <xsl:template name="ndash-character">
9536
- <xsl:call-template name="warn-unimplemented-character">
9537
- <xsl:with-param name="char-name" select="'ndash'"/>
9538
- </xsl:call-template>
9539
- </xsl:template>
9540
- <xsl:template match="ndash">
9541
- <xsl:call-template name="ndash-character"/>
9542
- </xsl:template>
9543
-
9544
9573
  <!-- An mdash may have thin space around it, otherwise it -->
9545
9574
  <!-- should have none. It might be difficult to enforce this -->
9546
9575
  <!-- (we could!), but we don't. Instead, we make the thin-space -->
9547
- <!-- version a publisher option. So we need two base characters -->
9548
- <!-- as abstract templates and do everything else here. -->
9549
-
9550
- <xsl:template name="mdash-character">
9551
- <xsl:call-template name="warn-unimplemented-character">
9552
- <xsl:with-param name="char-name" select="'mdash'"/>
9553
- </xsl:call-template>
9554
- </xsl:template>
9555
-
9556
- <xsl:template name="thin-space-character">
9557
- <xsl:call-template name="warn-unimplemented-character">
9558
- <xsl:with-param name="char-name" select="'thin-space'"/>
9559
- </xsl:call-template>
9560
- </xsl:template>
9576
+ <!-- version a publisher option. So the "thin-space" character -->
9577
+ <!-- joins the representation table for that purpose, and the -->
9578
+ <!-- assembly of the pieces happens here. -->
9561
9579
 
9562
9580
  <!-- The variable, surrounding space. This approach is -->
9563
9581
  <!-- executed once, so not local to template for "mdash" -->
@@ -9567,21 +9585,21 @@ Book (with parts), "section" at level 3
9567
9585
  <xsl:text />
9568
9586
  </xsl:when>
9569
9587
  <xsl:when test="$emdash-space='thin'">
9570
- <xsl:call-template name="thin-space-character"/>
9588
+ <xsl:call-template name="character">
9589
+ <xsl:with-param name="name" select="'thin-space'"/>
9590
+ </xsl:call-template>
9571
9591
  </xsl:when>
9572
9592
  </xsl:choose>
9573
9593
  </xsl:variable>
9574
9594
 
9575
9595
  <xsl:template match="mdash">
9576
9596
  <xsl:value-of select="$emdash-space-char"/>
9577
- <xsl:call-template name="mdash-character"/>
9597
+ <xsl:call-template name="character">
9598
+ <xsl:with-param name="name" select="'mdash'"/>
9599
+ </xsl:call-template>
9578
9600
  <xsl:value-of select="$emdash-space-char"/>
9579
9601
  </xsl:template>
9580
9602
 
9581
- <!-- ################## -->
9582
- <!-- Special Characters -->
9583
- <!-- ################## -->
9584
-
9585
9603
 
9586
9604
  <!-- These are characters which may look really bad -->
9587
9605
  <!-- if faked from a keyboard (double brackets), -->
@@ -9598,6 +9616,137 @@ Book (with parts), "section" at level 3
9598
9616
  <xsl:text>]]]</xsl:text>
9599
9617
  </xsl:template>
9600
9618
 
9619
+ <!-- The table of character representations: one row per character, -->
9620
+ <!-- one column per representation, each read by a conversion's -->
9621
+ <!-- modal "character" template; a character whose rendering needs -->
9622
+ <!-- more than a column value (fonts, wrapper markup) gets a -->
9623
+ <!-- per-character template overriding that mode. Column notes: -->
9624
+ <!-- "unicode" the bare code point -->
9625
+ <!-- "latex" macro or construction; the reader appends an -->
9626
+ <!-- empty group ({}) unless latex-ending="no" -->
9627
+ <!-- "ascii" 7-bit stand-in for text's ascii election; -->
9628
+ <!-- absent = unimplemented, warns -->
9629
+ <!-- "webwork" PGML form for WeBWorK problem extraction; -->
9630
+ <!-- absent = unimplemented, warns -->
9631
+ <!-- "braille" absent = liblouis uses the "unicode" value; -->
9632
+ <!-- a value = a substitute character, since liblouis -->
9633
+ <!-- cannot use the true one; "none" = no rendering -->
9634
+ <!-- at all, warns -->
9635
+
9636
+ <xsl:variable name="character-rtf">
9637
+ <!-- U+00A0: NO-BREAK SPACE -->
9638
+ <!-- (the "&nbsp;" entity is undefined in XSL; always the numeric reference) -->
9639
+ <char name="nbsp" unicode="&#x00a0;" latex="~" latex-ending="no" ascii=" " webwork="[$NBSP]*"/>
9640
+ <!-- U+2013: EN DASH -->
9641
+ <char name="ndash" unicode="&#x2013;" latex="\textendash" ascii="-" webwork="[$NDASH]*"/>
9642
+ <!-- U+2014: EM DASH -->
9643
+ <char name="mdash" unicode="&#x2014;" latex="\textemdash" ascii="--" webwork="[$MDASH]*"/>
9644
+ <!-- U+2009: THIN SPACE -->
9645
+ <char name="thin-space" unicode="&#x2009;" latex="\," latex-ending="no" ascii=" " webwork=" "/>
9646
+ <!-- U+27E6: MATHEMATICAL LEFT WHITE SQUARE BRACKET -->
9647
+ <char name="ldblbracket" unicode="&#x27e6;" latex="\textlbrackdbl" braille="none"/>
9648
+ <!-- U+27E7: MATHEMATICAL RIGHT WHITE SQUARE BRACKET -->
9649
+ <char name="rdblbracket" unicode="&#x27e7;" latex="\textrbrackdbl" braille="none"/>
9650
+ <!-- U+27E8: MATHEMATICAL LEFT ANGLE BRACKET -->
9651
+ <char name="langle" unicode="&#x27e8;" latex="\textlangle" ascii="&lt;"/>
9652
+ <!-- U+27E9: MATHEMATICAL RIGHT ANGLE BRACKET -->
9653
+ <char name="rangle" unicode="&#x27e9;" latex="\textrangle" ascii="&gt;"/>
9654
+ <!-- U+2026: HORIZONTAL ELLIPSIS -->
9655
+ <char name="ellipsis" unicode="&#x2026;" latex="\textellipsis" ascii="..." webwork="..."/>
9656
+ <!-- U+00B7: MIDDLE DOT -->
9657
+ <!-- (sometimes like a decorative dash; tex.stackexchange.com/questions/19180) -->
9658
+ <char name="midpoint" unicode="&#x00b7;" latex="\textperiodcentered" ascii="*"/>
9659
+ <!-- U+2053: SWUNG DASH -->
9660
+ <char name="swungdash" unicode="&#x2053;" latex="\ptxswungdash" ascii="~" braille="~"/>
9661
+ <!-- U+2030: PER MILLE SIGN -->
9662
+ <char name="permille" unicode="&#x2030;" latex="\textperthousand" ascii="o/oo" braille="none"/>
9663
+ <!-- U+00B6: PILCROW SIGN -->
9664
+ <char name="pilcrow" unicode="&#x00b6;" latex="\textpilcrow" ascii="[pilcrow]"/>
9665
+ <!-- U+00A7: SECTION SIGN -->
9666
+ <char name="section-mark" unicode="&#x00a7;" latex="\textsection" ascii="[section]"/>
9667
+ <!-- U+2212: MINUS SIGN -->
9668
+ <char name="minus" unicode="&#x2212;" latex="\textminus" ascii="-"/>
9669
+ <!-- U+00D7: MULTIPLICATION SIGN -->
9670
+ <char name="times" unicode="&#x00d7;" latex="\texttimes" ascii="x"/>
9671
+ <!-- U+2044: FRACTION SLASH -->
9672
+ <!-- (the LaTeX form should not allow a linebreak; not tested) -->
9673
+ <char name="solidus" unicode="&#x2044;" latex="\textfractionsolidus" ascii="/" braille="/"/>
9674
+ <!-- U+00F7: DIVISION SIGN -->
9675
+ <char name="obelus" unicode="&#x00f7;" latex="\textdiv" ascii="/"/>
9676
+ <!-- U+00B1: PLUS-MINUS SIGN -->
9677
+ <char name="plusminus" unicode="&#x00b1;" latex="\textpm" ascii="+/-"/>
9678
+ <!-- U+00A9: COPYRIGHT SIGN -->
9679
+ <!-- (LaTeX form: tex.stackexchange.com/questions/1676) -->
9680
+ <char name="copyright" unicode="&#x00a9;" latex="\textcopyright" ascii="(c)"/>
9681
+ <!-- U+2117: SOUND RECORDING COPYRIGHT -->
9682
+ <char name="phonomark" unicode="&#x2117;" latex="\textcircledP" braille="none"/>
9683
+ <!-- U+1F12F: COPYLEFT SYMBOL -->
9684
+ <!-- (may not be universally available in fonts; Open C (U+0254) -->
9685
+ <!-- plus Combining Circle (U+20DD) can imitate) -->
9686
+ <char name="copyleft" unicode="&#x1f12f;" latex="\textcopyleft" braille="none"/>
9687
+ <!-- U+00AE: REGISTERED SIGN -->
9688
+ <!-- (Bringhurst: should be superscript; not so in a font is a -->
9689
+ <!-- font mistake, but a "sup" wrapper renders way too small in -->
9690
+ <!-- a correct font) -->
9691
+ <char name="registered" unicode="&#x00ae;" latex="\textregistered" ascii="(R)"/>
9692
+ <!-- U+2122: TRADE MARK SIGN -->
9693
+ <char name="trademark" unicode="&#x2122;" latex="\texttrademark" ascii="(TM)"/>
9694
+ <!-- U+2120: SERVICE MARK -->
9695
+ <char name="servicemark" unicode="&#x2120;" latex="\textservicemark" braille="none"/>
9696
+ <!-- U+00B0: DEGREE SIGN -->
9697
+ <char name="degree" unicode="&#x00b0;" latex="\textdegree" ascii="deg"/>
9698
+ <!-- U+2032: PRIME -->
9699
+ <!-- (a LaTeX math construction looks better, but needs protection -->
9700
+ <!-- during text-processing; Bringhurst: many text fonts lack a prime -->
9701
+ <!-- and/or double-prime glyph) -->
9702
+ <char name="prime" unicode="&#x2032;" latex="\textquotesingle" ascii="'"/>
9703
+ <!-- U+2033: DOUBLE PRIME -->
9704
+ <char name="dblprime" unicode="&#x2033;" latex="\textquotesingle\textquotesingle" ascii="''"/>
9705
+ </xsl:variable>
9706
+
9707
+ <xsl:variable name="character-table"
9708
+ select="exsl:node-set($character-rtf)"/>
9709
+
9710
+ <xsl:key name="character-key" match="char" use="@name"/>
9711
+
9712
+ <!-- Look up a character by name, then render it with the modal -->
9713
+ <!-- "character" implementation in effect. An unknown name is a -->
9714
+ <!-- defect in a calling template, not an authoring error. -->
9715
+ <xsl:template name="character">
9716
+ <xsl:param name="name"/>
9717
+ <!-- a key resolves within the document holding the context -->
9718
+ <!-- node, so step inside the table, a node-set of one node -->
9719
+ <xsl:for-each select="$character-table">
9720
+ <xsl:variable name="the-row" select="key('character-key', $name)"/>
9721
+ <xsl:choose>
9722
+ <xsl:when test="$the-row">
9723
+ <xsl:apply-templates select="$the-row" mode="character"/>
9724
+ </xsl:when>
9725
+ <xsl:otherwise>
9726
+ <xsl:message>PTX:BUG: the character named "<xsl:value-of select="$name"/>" is not in the character table</xsl:message>
9727
+ </xsl:otherwise>
9728
+ </xsl:choose>
9729
+ </xsl:for-each>
9730
+ </xsl:template>
9731
+
9732
+ <!-- A conversion without a modal "character" implementation gets -->
9733
+ <!-- a warning for every character in the table -->
9734
+ <xsl:template match="char" mode="character">
9735
+ <xsl:call-template name="warn-unimplemented-character">
9736
+ <xsl:with-param name="char-name" select="@name"/>
9737
+ </xsl:call-template>
9738
+ </xsl:template>
9739
+
9740
+ <!-- The empty source elements share one dispatcher; "mdash" is an -->
9741
+ <!-- exception (publisher-elected surrounding space), and the -->
9742
+ <!-- "thin-space" row has no element of its own (it exists for the -->
9743
+ <!-- "mdash" machinery and internal use) -->
9744
+ <xsl:template match="nbsp|ndash|ldblbracket|rdblbracket|langle|rangle|ellipsis|midpoint|swungdash|permille|pilcrow|section-mark|minus|times|solidus|obelus|plusminus|copyright|phonomark|copyleft|registered|trademark|servicemark|degree|prime|dblprime">
9745
+ <xsl:call-template name="character">
9746
+ <xsl:with-param name="name" select="local-name()"/>
9747
+ </xsl:call-template>
9748
+ </xsl:template>
9749
+
9601
9750
  <!-- A given document may use for different characters for quotations: -->
9602
9751
  <!-- -->
9603
9752
  <!-- left/right (open/close) by primary/secondary -->
@@ -9649,267 +9798,34 @@ Book (with parts), "section" at level 3
9649
9798
  <xsl:apply-templates select="." mode="rq-character"/>
9650
9799
  </xsl:template>
9651
9800
 
9652
- <!-- Left Double Bracket -->
9653
- <xsl:template name="ldblbracket-character">
9654
- <xsl:call-template name="warn-unimplemented-character">
9655
- <xsl:with-param name="char-name" select="'ldblbracket'"/>
9656
- </xsl:call-template>
9657
- </xsl:template>
9658
- <xsl:template match="ldblbracket">
9659
- <xsl:call-template name="ldblbracket-character"/>
9660
- </xsl:template>
9661
9801
 
9662
- <!-- Right Double Bracket -->
9663
- <xsl:template name="rdblbracket-character">
9664
- <xsl:call-template name="warn-unimplemented-character">
9665
- <xsl:with-param name="char-name" select="'rdblbracket'"/>
9666
- </xsl:call-template>
9667
- </xsl:template>
9668
- <xsl:template match="rdblbracket">
9669
- <xsl:call-template name="rdblbracket-character"/>
9670
- </xsl:template>
9671
9802
 
9672
- <!-- Left Angle Bracket -->
9673
- <xsl:template name="langle-character">
9674
- <xsl:call-template name="warn-unimplemented-character">
9675
- <xsl:with-param name="char-name" select="'langle'"/>
9676
- </xsl:call-template>
9677
- </xsl:template>
9678
- <xsl:template match="langle">
9679
- <xsl:call-template name="langle-character"/>
9680
- </xsl:template>
9681
9803
 
9682
- <!-- Right Angle Bracket -->
9683
- <xsl:template name="rangle-character">
9684
- <xsl:call-template name="warn-unimplemented-character">
9685
- <xsl:with-param name="char-name" select="'rangle'"/>
9686
- </xsl:call-template>
9687
- </xsl:template>
9688
- <xsl:template match="rangle">
9689
- <xsl:call-template name="rangle-character"/>
9690
- </xsl:template>
9691
9804
 
9692
- <!-- Ellipsis (dots), for text, not math -->
9693
- <xsl:template name="ellipsis-character">
9694
- <xsl:call-template name="warn-unimplemented-character">
9695
- <xsl:with-param name="char-name" select="'ellipsis'"/>
9696
- </xsl:call-template>
9697
- </xsl:template>
9698
- <xsl:template match="ellipsis">
9699
- <xsl:call-template name="ellipsis-character"/>
9700
- </xsl:template>
9701
9805
 
9702
- <!-- Midpoint -->
9703
- <!-- A centered dot used sometimes like a decorative dash -->
9704
- <xsl:template name="midpoint-character">
9705
- <xsl:call-template name="warn-unimplemented-character">
9706
- <xsl:with-param name="char-name" select="'midpoint'"/>
9707
- </xsl:call-template>
9708
- </xsl:template>
9709
- <xsl:template match="midpoint">
9710
- <xsl:call-template name="midpoint-character"/>
9711
- </xsl:template>
9712
9806
 
9713
- <!-- Swung Dash -->
9714
- <!-- A decorative dash, like a tilde, but bigger, and centered -->
9715
- <xsl:template name="swungdash-character">
9716
- <xsl:call-template name="warn-unimplemented-character">
9717
- <xsl:with-param name="char-name" select="'swungdash'"/>
9718
- </xsl:call-template>
9719
- </xsl:template>
9720
- <xsl:template match="swungdash">
9721
- <xsl:call-template name="swungdash-character"/>
9722
- </xsl:template>
9723
9807
 
9724
- <!-- Per Mille -->
9725
- <!-- Or, per thousand, like a percent sign -->
9726
- <xsl:template name="permille-character">
9727
- <xsl:call-template name="warn-unimplemented-character">
9728
- <xsl:with-param name="char-name" select="'permille'"/>
9729
- </xsl:call-template>
9730
- </xsl:template>
9731
- <xsl:template match="permille">
9732
- <xsl:call-template name="permille-character"/>
9733
- </xsl:template>
9734
9808
 
9735
- <!-- Pilcrow -->
9736
- <!-- Often used to mark the start of a paragraph -->
9737
- <xsl:template name="pilcrow-character">
9738
- <xsl:call-template name="warn-unimplemented-character">
9739
- <xsl:with-param name="char-name" select="'pilcrow'"/>
9740
- </xsl:call-template>
9741
- </xsl:template>
9742
- <xsl:template match="pilcrow">
9743
- <xsl:call-template name="pilcrow-character"/>
9744
- </xsl:template>
9745
9809
 
9746
- <!-- Section Mark -->
9747
- <!-- The stylized double-S to indicate section numbers -->
9748
- <xsl:template name="section-mark-character">
9749
- <xsl:call-template name="warn-unimplemented-character">
9750
- <xsl:with-param name="char-name" select="'section-mark'"/>
9751
- </xsl:call-template>
9752
- </xsl:template>
9753
- <xsl:template match="section-mark">
9754
- <xsl:call-template name="section-mark-character"/>
9755
- </xsl:template>
9756
9810
 
9757
- <!-- Minus -->
9758
- <!-- A hyphen/dash for use in text as subtraction or negation-->
9759
- <xsl:template name="minus-character">
9760
- <xsl:call-template name="warn-unimplemented-character">
9761
- <xsl:with-param name="char-name" select="'minus'"/>
9762
- </xsl:call-template>
9763
- </xsl:template>
9764
- <xsl:template match="minus">
9765
- <xsl:call-template name="minus-character"/>
9766
- </xsl:template>
9767
9811
 
9768
- <!-- Times -->
9769
- <!-- A "multiplication sign" symbol for use in text -->
9770
- <xsl:template name="times-character">
9771
- <xsl:call-template name="warn-unimplemented-character">
9772
- <xsl:with-param name="char-name" select="'times'"/>
9773
- </xsl:call-template>
9774
- </xsl:template>
9775
- <xsl:template match="times">
9776
- <xsl:call-template name="times-character"/>
9777
- </xsl:template>
9778
9812
 
9779
- <!-- Solidus -->
9780
- <!-- Fraction bar, not as steep as a forward slash -->
9781
- <xsl:template name="solidus-character">
9782
- <xsl:call-template name="warn-unimplemented-character">
9783
- <xsl:with-param name="char-name" select="'solidus'"/>
9784
- </xsl:call-template>
9785
- </xsl:template>
9786
- <xsl:template match="solidus">
9787
- <xsl:call-template name="solidus-character"/>
9788
- </xsl:template>
9789
9813
 
9790
- <!-- Obelus -->
9791
- <!-- A "division" symbol for use in text -->
9792
- <xsl:template name="obelus-character">
9793
- <xsl:call-template name="warn-unimplemented-character">
9794
- <xsl:with-param name="char-name" select="'obelus'"/>
9795
- </xsl:call-template>
9796
- </xsl:template>
9797
- <xsl:template match="obelus">
9798
- <xsl:call-template name="obelus-character"/>
9799
- </xsl:template>
9800
9814
 
9801
- <!-- Plus/Minus -->
9802
- <!-- The combined symbol -->
9803
- <xsl:template name="plusminus-character">
9804
- <xsl:call-template name="warn-unimplemented-character">
9805
- <xsl:with-param name="char-name" select="'plusminus'"/>
9806
- </xsl:call-template>
9807
- </xsl:template>
9808
- <xsl:template match="plusminus">
9809
- <xsl:call-template name="plusminus-character"/>
9810
- </xsl:template>
9811
9815
 
9812
- <!-- Copyright -->
9813
- <!-- Bringhurst: on baseline (i.e. not superscript) -->
9814
- <xsl:template name="copyright-character">
9815
- <xsl:call-template name="warn-unimplemented-character">
9816
- <xsl:with-param name="char-name" select="'copyright'"/>
9817
- </xsl:call-template>
9818
- </xsl:template>
9819
- <xsl:template match="copyright">
9820
- <xsl:call-template name="copyright-character"/>
9821
- </xsl:template>
9822
9816
 
9823
- <!-- Phonomark -->
9824
- <!-- copyright on sound recordings -->
9825
- <!-- Bringhurst: counterpart copyright on baseline -->
9826
- <xsl:template name="phonomark-character">
9827
- <xsl:call-template name="warn-unimplemented-character">
9828
- <xsl:with-param name="char-name" select="'phonomark'"/>
9829
- </xsl:call-template>
9830
- </xsl:template>
9831
- <xsl:template match="phonomark">
9832
- <xsl:call-template name="phonomark-character"/>
9833
- </xsl:template>
9834
9817
 
9835
- <!-- Copyleft -->
9836
- <!-- Bringhurst: counterpart copyright on baseline -->
9837
- <xsl:template name="copyleft-character">
9838
- <xsl:call-template name="warn-unimplemented-character">
9839
- <xsl:with-param name="char-name" select="'copyleft'"/>
9840
- </xsl:call-template>
9841
- </xsl:template>
9842
- <xsl:template match="copyleft">
9843
- <xsl:call-template name="copyleft-character"/>
9844
- </xsl:template>
9845
9818
 
9846
- <!-- Registered -->
9847
- <!-- Bringhurst: should be superscript -->
9848
- <xsl:template name="registered-character">
9849
- <xsl:call-template name="warn-unimplemented-character">
9850
- <xsl:with-param name="char-name" select="'registered'"/>
9851
- </xsl:call-template>
9852
- </xsl:template>
9853
- <xsl:template match="registered">
9854
- <xsl:call-template name="registered-character"/>
9855
- </xsl:template>
9856
9819
 
9857
- <!-- Trademark -->
9858
- <!-- Bringhurst: should be superscript -->
9859
- <xsl:template name="trademark-character">
9860
- <xsl:call-template name="warn-unimplemented-character">
9861
- <xsl:with-param name="char-name" select="'trademark'"/>
9862
- </xsl:call-template>
9863
- </xsl:template>
9864
- <xsl:template match="trademark">
9865
- <xsl:call-template name="trademark-character"/>
9866
- </xsl:template>
9867
9820
 
9868
- <!-- Servicemark -->
9869
- <!-- Bringhurst: counterpart trademark should be superscript -->
9870
- <xsl:template name="servicemark-character">
9871
- <xsl:call-template name="warn-unimplemented-character">
9872
- <xsl:with-param name="char-name" select="'servicemark'"/>
9873
- </xsl:call-template>
9874
- </xsl:template>
9875
- <xsl:template match="servicemark">
9876
- <xsl:call-template name="servicemark-character"/>
9877
- </xsl:template>
9878
9821
 
9879
9822
  <!-- Coordinates, Temperature, English distance -->
9880
9823
  <!-- Intended for simple non-technical uses, without too -->
9881
9824
  <!-- much overhead. The SI unit markup would be better -->
9882
9825
  <!-- suited for scientific or technical work. -->
9883
9826
 
9884
- <!-- Degree -->
9885
- <xsl:template name="degree-character">
9886
- <xsl:call-template name="warn-unimplemented-character">
9887
- <xsl:with-param name="char-name" select="'degree'"/>
9888
- </xsl:call-template>
9889
- </xsl:template>
9890
- <xsl:template match="degree">
9891
- <xsl:call-template name="degree-character"/>
9892
- </xsl:template>
9893
9827
 
9894
- <!-- Prime -->
9895
- <xsl:template name="prime-character">
9896
- <xsl:call-template name="warn-unimplemented-character">
9897
- <xsl:with-param name="char-name" select="'prime'"/>
9898
- </xsl:call-template>
9899
- </xsl:template>
9900
- <xsl:template match="prime">
9901
- <xsl:call-template name="prime-character"/>
9902
- </xsl:template>
9903
9828
 
9904
- <!-- Double Prime -->
9905
- <xsl:template name="dblprime-character">
9906
- <xsl:call-template name="warn-unimplemented-character">
9907
- <xsl:with-param name="char-name" select="'dblprime'"/>
9908
- </xsl:call-template>
9909
- </xsl:template>
9910
- <xsl:template match="dblprime">
9911
- <xsl:call-template name="dblprime-character"/>
9912
- </xsl:template>
9913
9829
 
9914
9830
  <!-- Characters for Tagging Equations -->
9915
9831
 
@@ -9970,15 +9886,23 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
9970
9886
  </xsl:template>
9971
9887
 
9972
9888
  <xsl:template match="dblbrackets">
9973
- <xsl:call-template name="ldblbracket-character"/>
9889
+ <xsl:call-template name="character">
9890
+ <xsl:with-param name="name" select="'ldblbracket'"/>
9891
+ </xsl:call-template>
9974
9892
  <xsl:apply-templates/>
9975
- <xsl:call-template name="rdblbracket-character"/>
9893
+ <xsl:call-template name="character">
9894
+ <xsl:with-param name="name" select="'rdblbracket'"/>
9895
+ </xsl:call-template>
9976
9896
  </xsl:template>
9977
9897
 
9978
9898
  <xsl:template match="angles">
9979
- <xsl:call-template name="langle-character"/>
9899
+ <xsl:call-template name="character">
9900
+ <xsl:with-param name="name" select="'langle'"/>
9901
+ </xsl:call-template>
9980
9902
  <xsl:apply-templates/>
9981
- <xsl:call-template name="rangle-character"/>
9903
+ <xsl:call-template name="character">
9904
+ <xsl:with-param name="name" select="'rangle'"/>
9905
+ </xsl:call-template>
9982
9906
  </xsl:template>
9983
9907
 
9984
9908
  <!-- ########## -->
@@ -10150,7 +10074,9 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10150
10074
  <xsl:template match="biblio[@type='raw']/number">
10151
10075
  <xsl:text>no</xsl:text>
10152
10076
  <xsl:call-template name="biblio-period"/>
10153
- <xsl:call-template name="thin-space-character"/>
10077
+ <xsl:call-template name="character">
10078
+ <xsl:with-param name="name" select="'thin-space'"/>
10079
+ </xsl:call-template>
10154
10080
  <xsl:apply-templates/>
10155
10081
  </xsl:template>
10156
10082
 
@@ -10253,7 +10179,9 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10253
10179
  <xsl:template match="biblio[@type='bibtex']/number">
10254
10180
  <xsl:text>no</xsl:text>
10255
10181
  <xsl:call-template name="biblio-period"/>
10256
- <xsl:call-template name="thin-space-character"/>
10182
+ <xsl:call-template name="character">
10183
+ <xsl:with-param name="name" select="'thin-space'"/>
10184
+ </xsl:call-template>
10257
10185
  <xsl:apply-templates select="text()"/>
10258
10186
  <xsl:apply-templates select="." mode="bibtex-separator">
10259
10187
  <xsl:with-param name="separator" select="' '"/>
@@ -10282,7 +10210,9 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10282
10210
  <xsl:template match="biblio[@type='bibtex']/pages[@start]">
10283
10211
  <xsl:text>pp</xsl:text>
10284
10212
  <xsl:call-template name="biblio-period"/>
10285
- <xsl:call-template name="thin-space-character"/>
10213
+ <xsl:call-template name="character">
10214
+ <xsl:with-param name="name" select="'thin-space'"/>
10215
+ </xsl:call-template>
10286
10216
  <xsl:value-of select="@start"/><xsl:text>-</xsl:text><xsl:value-of select="@end"/>
10287
10217
  <xsl:apply-templates select="." mode="bibtex-separator">
10288
10218
  <xsl:with-param name="separator" select="', '"/>
@@ -10295,7 +10225,7 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10295
10225
  <!-- Final period when no following-siblings -->
10296
10226
 
10297
10227
  <xsl:template match="biblio[not(@type = 'raw') and not(@type = 'bibtex')]/*">
10298
- <xsl:message>PTX:WARNING: a child of "biblio" (<xsl:value-of select="local-name()"/>) is not being processed. Please report me so this can be fixed.</xsl:message>
10228
+ <xsl:message>PTX:BUG: a child of "biblio" (<xsl:value-of select="local-name()"/>) is not being processed. Please report me so this can be fixed.</xsl:message>
10299
10229
  </xsl:template>
10300
10230
 
10301
10231
  <!-- Authors: no lead-in, names via the shared "contributor-names" -->
@@ -10563,19 +10493,33 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10563
10493
 
10564
10494
  <xsl:template name="warning-line-by-line">
10565
10495
  <xsl:param name="warning" />
10566
- <xsl:variable name="after" select="substring-before($warning,'&#xa;')"/>
10496
+ <!-- the first line, which may be all of the text -->
10497
+ <xsl:variable name="first-line">
10498
+ <xsl:choose>
10499
+ <xsl:when test="contains($warning, '&#xa;')">
10500
+ <xsl:value-of select="substring-before($warning, '&#xa;')"/>
10501
+ </xsl:when>
10502
+ <xsl:otherwise>
10503
+ <xsl:value-of select="$warning"/>
10504
+ </xsl:otherwise>
10505
+ </xsl:choose>
10506
+ </xsl:variable>
10567
10507
  <xsl:choose>
10568
- <!-- no line breaks in warning, just print it -->
10569
- <xsl:when test="substring-before($warning,'&#xa;') = ''">
10570
- <xsl:message><xsl:value-of select="$warning" /></xsl:message>
10508
+ <!-- a message with no content is reported strangely -->
10509
+ <!-- by the processing library, a space displays well -->
10510
+ <xsl:when test="$first-line = ''">
10511
+ <xsl:message><xsl:text> </xsl:text></xsl:message>
10571
10512
  </xsl:when>
10572
10513
  <xsl:otherwise>
10573
- <xsl:message><xsl:value-of select="substring-before($warning,'&#xa;')" /></xsl:message>
10574
- <xsl:call-template name="warning-line-by-line">
10575
- <xsl:with-param name="warning" select="substring-after($warning,'&#xa;')" />
10576
- </xsl:call-template>
10514
+ <xsl:message><xsl:value-of select="$first-line"/></xsl:message>
10577
10515
  </xsl:otherwise>
10578
10516
  </xsl:choose>
10517
+ <!-- and the lines after the first, if any -->
10518
+ <xsl:if test="contains($warning, '&#xa;')">
10519
+ <xsl:call-template name="warning-line-by-line">
10520
+ <xsl:with-param name="warning" select="substring-after($warning, '&#xa;')"/>
10521
+ </xsl:call-template>
10522
+ </xsl:if>
10579
10523
  </xsl:template>
10580
10524
 
10581
10525
  <!-- Report the location of an element or attribute, for use after a -->
@@ -10701,7 +10645,7 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10701
10645
  <xsl:text>&#xa;</xsl:text>
10702
10646
  <xsl:text> 1. Code generation is functional, but does not respect indentation&#xa;</xsl:text>
10703
10647
  <xsl:text> 2. LaTeX generation is functional, could be improved, 2020-11-11&#xa;</xsl:text>
10704
- <xsl:text> 2. HTML generation is functional, could be improved, 2020-11-11&#xa;</xsl:text>
10648
+ <xsl:text> 3. HTML generation is functional, could be improved, 2020-11-11&#xa;</xsl:text>
10705
10649
  </xsl:with-param>
10706
10650
  </xsl:call-template>
10707
10651
  </xsl:if>
@@ -10905,7 +10849,7 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
10905
10849
  </xsl:when>
10906
10850
  <xsl:otherwise>
10907
10851
  <xsl:text>P100Y</xsl:text>
10908
- <xsl:message>PTX:WARNING: "author.deprecations.all" should be "yes" or "no", not "<xsl:value-of select="$author.deprecations.all"/>", using the default value of "yes"</xsl:message>
10852
+ <xsl:message>PTX:FALLBACK: "author.deprecations.all" should be "yes" or "no", not "<xsl:value-of select="$author.deprecations.all"/>", using the default value of "yes"</xsl:message>
10909
10853
  </xsl:otherwise>
10910
10854
  </xsl:choose>
10911
10855
  </xsl:variable>
@@ -11203,11 +11147,18 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
11203
11147
  <xsl:with-param name="message" select="'the &quot;jsxgraph&quot; element has been deprecated, but remains functional, rework with the &quot;interactive&quot; element'" />
11204
11148
  </xsl:call-template>
11205
11149
  <!-- -->
11150
+ <!-- 2018-04-06 jsxgraph no longer a panel of a sidebyside -->
11151
+ <xsl:call-template name="deprecation-message">
11152
+ <xsl:with-param name="occurrences" select="&quot;$document-root//sidebyside/jsxgraph&quot;" />
11153
+ <xsl:with-param name="date-string" select="'2018-04-06'" />
11154
+ <xsl:with-param name="message" select="'a &quot;jsxgraph&quot; can no longer appear within a &quot;sidebyside&quot;, rework with the &quot;interactive&quot; element; as of 2026-07-22 the &quot;jsxgraph&quot; will be silently ignored'" />
11155
+ </xsl:call-template>
11156
+ <!-- -->
11206
11157
  <!-- 2018-05-02 paragraphs purely as a lightweight division -->
11207
11158
  <xsl:call-template name="deprecation-message">
11208
11159
  <xsl:with-param name="occurrences" select="&quot;$document-root//sidebyside/paragraphs&quot;" />
11209
11160
  <xsl:with-param name="date-string" select="'2018-04-06'" />
11210
- <xsl:with-param name="message" select="'a &quot;paragraphs&quot; can no longer appear within a &quot;sidebyside&quot;, replace with a &quot;stack&quot; containing multiple elements, such as &quot;p&quot;'" />
11161
+ <xsl:with-param name="message" select="'a &quot;paragraphs&quot; can no longer appear within a &quot;sidebyside&quot;, replace with a &quot;stack&quot; containing multiple elements, such as &quot;p&quot;; as of 2026-07-22 the &quot;paragraphs&quot; and its content will be silently ignored'" />
11211
11162
  </xsl:call-template>
11212
11163
  <!-- 2018-05-18 WeBWorK refactor no longer needs setup/var elements for static representations-->
11213
11164
  <xsl:call-template name="deprecation-message">
@@ -11835,6 +11786,20 @@ http://andrewmccarthy.ie/2014/11/06/swung-dash-in-latex/
11835
11786
  <xsl:with-param name="message" select="'the &quot;@include-source&quot; attribute has been deprecated and it will be ignored. No replacement is planned.'"/>
11836
11787
  </xsl:call-template>
11837
11788
  <!-- -->
11789
+ <!-- 2026-07-08 "title" deprecated on "introduction"/"conclusion" of a traditional division -->
11790
+ <xsl:call-template name="deprecation-message">
11791
+ <xsl:with-param name="occurrences" select="&quot;$document-root//introduction[parent::article or parent::chapter or parent::appendix or parent::section or parent::subsection]/title | $document-root//conclusion[parent::article or parent::chapter or parent::appendix or parent::section or parent::subsection]/title&quot;" />
11792
+ <xsl:with-param name="date-string" select="'2026-07-08'" />
11793
+ <xsl:with-param name="message" select="'a &quot;title&quot; on an &quot;introduction&quot; or &quot;conclusion&quot; of a traditional division has been deprecated, and it will be ignored.'"/>
11794
+ </xsl:call-template>
11795
+ <!-- -->
11796
+ <!-- 2026-07-22 "audio", "video", "interactive" precluded within "sidebyside" -->
11797
+ <xsl:call-template name="deprecation-message">
11798
+ <xsl:with-param name="occurrences" select="&quot;$document-root//sidebyside//audio | $document-root//sidebyside//video | $document-root//sidebyside//interactive&quot;" />
11799
+ <xsl:with-param name="date-string" select="'2026-07-22'" />
11800
+ <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;.'"/>
11801
+ </xsl:call-template>
11802
+ <!-- -->
11838
11803
  </xsl:template>
11839
11804
 
11840
11805
  <!-- Miscellaneous -->