@pretextbook/pretext-html 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -3
- package/assets/preview-html.xsl +56 -0
- package/assets/upstream.json +2 -2
- package/assets/xsl/entities.ent +14 -1
- package/assets/xsl/latex/pretext-latex-texstyle.xsl +5 -2
- package/assets/xsl/localizations/README.md +1 -1
- package/assets/xsl/localizations/af-ZA.xml +5 -6
- package/assets/xsl/localizations/bg-BG.xml +5 -6
- package/assets/xsl/localizations/ca-ES.xml +5 -6
- package/assets/xsl/localizations/cs-CZ.xml +5 -6
- package/assets/xsl/localizations/de-DE.xml +108 -108
- package/assets/xsl/localizations/en-US.xml +18 -17
- package/assets/xsl/localizations/es-ES.xml +5 -6
- package/assets/xsl/localizations/fi-FI.xml +5 -6
- package/assets/xsl/localizations/fr-CA.xml +5 -6
- package/assets/xsl/localizations/fr-FR.xml +5 -6
- package/assets/xsl/localizations/hu-HU.xml +5 -6
- package/assets/xsl/localizations/it-IT.xml +7 -7
- package/assets/xsl/localizations/ku-CKB.xml +5 -6
- package/assets/xsl/localizations/nl-NL.xml +5 -6
- package/assets/xsl/localizations/pt-BR.xml +4 -5
- package/assets/xsl/localizations/pt-PT.xml +4 -5
- package/assets/xsl/localizations/zh-HANS.xml +5 -6
- package/assets/xsl/pretext-assembly.xsl +154 -29
- package/assets/xsl/pretext-beamer.xsl +112 -10
- package/assets/xsl/pretext-braille-preprint.xsl +22 -3
- package/assets/xsl/pretext-common.xsl +117 -42
- package/assets/xsl/pretext-epub.xsl +74 -87
- package/assets/xsl/pretext-fo.xsl +115 -41
- package/assets/xsl/pretext-html.xsl +333 -102
- package/assets/xsl/pretext-latex-classic.xsl +48 -35
- package/assets/xsl/pretext-latex-common.xsl +160 -98
- package/assets/xsl/pretext-latex.xsl +12 -10
- package/assets/xsl/pretext-markdown.xsl +5 -3
- package/assets/xsl/pretext-numbers.xsl +28 -2
- package/assets/xsl/pretext-revealjs.xsl +44 -2
- package/assets/xsl/pretext-runestone-static.xsl +27 -4
- package/assets/xsl/pretext-runestone.xsl +112 -0
- package/assets/xsl/pretext-text.xsl +21 -14
- package/assets/xsl/publisher-variables.xsl +187 -47
- package/assets/xsl/support/extract-math.xsl +22 -2
- package/assets/xsl/support/package-math.xsl +9 -8
- package/assets/xsl/utilities/report-publisher-variables.xsl +4 -0
- package/assets/xsl-bundle.json +1 -1
- package/dist/cli-C0JwLhuv.js +1456 -0
- package/dist/cli.js +3 -3
- package/dist/html-static.d.ts +2 -2
- package/dist/index.browser.d.ts +9 -4
- package/dist/index.browser.js +1151 -841
- package/dist/index.d.ts +9 -3
- package/dist/index.js +50 -46
- package/dist/publication.d.ts +21 -0
- package/dist/renderer.d.ts +134 -13
- package/dist/skeleton.d.ts +68 -7
- package/dist/source-cache.d.ts +36 -0
- package/dist/sourcemap.d.ts +11 -1
- package/dist/subtree.d.ts +79 -0
- package/dist/xinclude.d.ts +40 -3
- package/package.json +1 -1
- package/dist/cli-ox-z2TCZ.js +0 -1145
|
@@ -105,6 +105,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
105
105
|
<!-- as an empty string -->
|
|
106
106
|
<xsl:variable name="chunk-level-entered" select="string($chunks)"/>
|
|
107
107
|
|
|
108
|
+
<!-- Experimental: "statement" and "feedback" inside the "premise" -->
|
|
109
|
+
<!-- and "response" (the "cards") of a "cardsort" exercise. With -->
|
|
110
|
+
<!-- "no" a card is the content of its "statement" and "feedback" -->
|
|
111
|
+
<!-- is dropped. With "yes" the structure survives, for eventual -->
|
|
112
|
+
<!-- use by Runestone. Declared here, since assembly needs it. -->
|
|
113
|
+
<xsl:param name="debug.advanced.feedback" select="'no'"/>
|
|
114
|
+
<xsl:variable name="b-debug-advanced-feedback" select="$debug.advanced.feedback = 'yes'"/>
|
|
115
|
+
|
|
108
116
|
<!-- ############################# -->
|
|
109
117
|
<!-- Structure of the Version Tree -->
|
|
110
118
|
<!-- ############################# -->
|
|
@@ -133,6 +141,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
133
141
|
<xsl:variable name="version-article-sections" select="boolean($version-root/article/section)"/>
|
|
134
142
|
<xsl:variable name="version-article-printouts" select="boolean($version-root/article/worksheet|$version-root/article/handout)"/>
|
|
135
143
|
<xsl:variable name="version-article-subsections" select="boolean($version-root/article/section/subsection)"/>
|
|
144
|
+
<xsl:variable name="version-slideshow-sections" select="boolean($version-root/slideshow/section)"/>
|
|
136
145
|
|
|
137
146
|
<!-- A book must have a chapter -->
|
|
138
147
|
<!-- An article need not have a section -->
|
|
@@ -266,7 +275,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
266
275
|
</xsl:variable>
|
|
267
276
|
|
|
268
277
|
<!-- This is the minimum information to locate a -->
|
|
269
|
-
<!-- Citation
|
|
278
|
+
<!-- Citation Style Language (CSL) style file -->
|
|
270
279
|
<!-- in the CSL repository. It is not expected to -->
|
|
271
280
|
<!-- have the ".csl" suffix, but should have partial -->
|
|
272
281
|
<!-- path names, such as "dependent/". Employers -->
|
|
@@ -275,7 +284,18 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
275
284
|
<xsl:variable name="csl-style-file">
|
|
276
285
|
<xsl:apply-templates select="$publisher-attribute-options/common/citation-stylesheet-language/pi:pub-attribute[@name='style']" mode="set-pubfile-variable"/>
|
|
277
286
|
</xsl:variable>
|
|
278
|
-
<!--
|
|
287
|
+
<!-- A journal named in the publication file supplies a default -->
|
|
288
|
+
<!-- style, as recorded in the list of supported journals, and a -->
|
|
289
|
+
<!-- style named in the publication file still wins. Journal -->
|
|
290
|
+
<!-- codes are matched regardless of case, as in the Python -->
|
|
291
|
+
<!-- get_journal_info() function. -->
|
|
292
|
+
<xsl:template match="common/citation-stylesheet-language/pi:pub-attribute[@name='style']" mode="get-default-pub-variable">
|
|
293
|
+
<xsl:variable name="journal-code" select="translate($journal-name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/>
|
|
294
|
+
<xsl:if test="not($journal-code = '')">
|
|
295
|
+
<xsl:value-of select="document('../journals/journals.xml')/ptx-journals/journal[code = $journal-code]/citation-stylesheet-language/@style"/>
|
|
296
|
+
</xsl:if>
|
|
297
|
+
</xsl:template>
|
|
298
|
+
<!-- global indication of if a publisher has opted in, perhaps by way of a journal -->
|
|
279
299
|
<xsl:variable name="b-using-csl-styles" select="not(normalize-space($csl-style-file) = '')"/>
|
|
280
300
|
<!-- if using styles we form the filename of generated references and citations -->
|
|
281
301
|
<xsl:variable name="csl-file">
|
|
@@ -1409,8 +1429,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1409
1429
|
<!-- on a local http.server process. The summary of all -->
|
|
1410
1430
|
<!-- are recorded in the dynamic-substitutions-file. -->
|
|
1411
1431
|
<xsl:variable name="dynamic-substitutions-file">
|
|
1412
|
-
<!-- Only relevant if there are dynamic exercises present.
|
|
1413
|
-
|
|
1432
|
+
<!-- Only relevant if there are dynamic exercises present. -->
|
|
1433
|
+
<!-- The test here covers exactly the cases that need this file. -->
|
|
1434
|
+
<xsl:if test="$original//fillin[@ansobj] or $original//eval[@obj]">
|
|
1414
1435
|
<!-- the generated directory, declared or defaulted -->
|
|
1415
1436
|
<xsl:value-of select="str:replace(concat($generated-directory-source, 'dynamic_subs/dynamic_substitutions.xml'), ' ', '%20')"/>
|
|
1416
1437
|
</xsl:if>
|
|
@@ -1497,12 +1518,13 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1497
1518
|
<!-- numbered) specialized divisions of a -->
|
|
1498
1519
|
<!-- "subsubsection", then the non-zero maximums -->
|
|
1499
1520
|
<!-- below would go up by 1 -->
|
|
1500
|
-
<!-- article/section:
|
|
1501
|
-
<!-- book:
|
|
1502
|
-
<!-- book/part:
|
|
1521
|
+
<!-- article/section: s.ss.sss => 3 -->
|
|
1522
|
+
<!-- book: c.s.ss.sss => 4 -->
|
|
1523
|
+
<!-- book/part: p.c.s.ss.sss => 5 -->
|
|
1524
|
+
<!-- slideshow/section: s.n => 1 -->
|
|
1503
1525
|
<xsl:variable name="numbering-maxlevel-entered">
|
|
1504
|
-
<!-- these are the maximum possible for a given document type -->
|
|
1505
|
-
<!--
|
|
1526
|
+
<!-- these are the maximum possible for a given document type, -->
|
|
1527
|
+
<!-- an error-check upper-limit, and usually the default -->
|
|
1506
1528
|
<xsl:variable name="max-feasible">
|
|
1507
1529
|
<xsl:choose>
|
|
1508
1530
|
<xsl:when test="$version-has-parts">5</xsl:when>
|
|
@@ -1510,6 +1532,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1510
1532
|
<xsl:when test="$version-article-sections or $version-article-printouts">3</xsl:when>
|
|
1511
1533
|
<xsl:when test="$version-doc-type = 'article'">0</xsl:when>
|
|
1512
1534
|
<xsl:when test="$version-doc-type = 'letter'">0</xsl:when>
|
|
1535
|
+
<xsl:when test="$version-slideshow-sections">1</xsl:when>
|
|
1513
1536
|
<xsl:when test="$version-doc-type = 'slideshow'">0</xsl:when>
|
|
1514
1537
|
<xsl:when test="$version-doc-type = 'memo'">0</xsl:when>
|
|
1515
1538
|
<xsl:otherwise>
|
|
@@ -1517,6 +1540,16 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1517
1540
|
</xsl:otherwise>
|
|
1518
1541
|
</xsl:choose>
|
|
1519
1542
|
</xsl:variable>
|
|
1543
|
+
<!-- A slideshow defaults to level 0, whatever its structure, -->
|
|
1544
|
+
<!-- so its slides are counted through the whole slideshow -->
|
|
1545
|
+
<xsl:variable name="default-level">
|
|
1546
|
+
<xsl:choose>
|
|
1547
|
+
<xsl:when test="$version-doc-type = 'slideshow'">0</xsl:when>
|
|
1548
|
+
<xsl:otherwise>
|
|
1549
|
+
<xsl:value-of select="$max-feasible"/>
|
|
1550
|
+
</xsl:otherwise>
|
|
1551
|
+
</xsl:choose>
|
|
1552
|
+
</xsl:variable>
|
|
1520
1553
|
<xsl:variable name="candidate-maxlevel">
|
|
1521
1554
|
<xsl:choose>
|
|
1522
1555
|
<!-- go with publisher file, check for numerical value -->
|
|
@@ -1526,7 +1559,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1526
1559
|
<!-- NaN does not equal *anything*, so tests if a number -->
|
|
1527
1560
|
<xsl:when test="not(number($the-number) = number($the-number)) or ($the-number < 0)">
|
|
1528
1561
|
<xsl:message>PTX:FALLBACK: numbering level for divisions given in the publisher file ("<xsl:value-of select="$the-number"/>") is not a number or is negative. The default value will be used instead</xsl:message>
|
|
1529
|
-
<xsl:value-of select="$
|
|
1562
|
+
<xsl:value-of select="$default-level"/>
|
|
1530
1563
|
</xsl:when>
|
|
1531
1564
|
<xsl:otherwise>
|
|
1532
1565
|
<xsl:value-of select="$publication/numbering/divisions/@level"/>
|
|
@@ -1537,9 +1570,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1537
1570
|
<xsl:when test="not($numbering.maximum.level = '')">
|
|
1538
1571
|
<xsl:value-of select="$numbering.maximum.level" />
|
|
1539
1572
|
</xsl:when>
|
|
1540
|
-
<!-- various defaults
|
|
1573
|
+
<!-- various defaults, usually the maximum possible -->
|
|
1541
1574
|
<xsl:otherwise>
|
|
1542
|
-
<xsl:value-of select="$
|
|
1575
|
+
<xsl:value-of select="$default-level"/>
|
|
1543
1576
|
</xsl:otherwise>
|
|
1544
1577
|
</xsl:choose>
|
|
1545
1578
|
</xsl:variable>
|
|
@@ -1547,7 +1580,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1547
1580
|
<xsl:choose>
|
|
1548
1581
|
<xsl:when test="$candidate-maxlevel > $max-feasible">
|
|
1549
1582
|
<xsl:message>PTX:FALLBACK: numbering level set for divisions ("<xsl:value-of select="$candidate-maxlevel"/>") is greater than the maximum possible ("<xsl:value-of select="$max-feasible"/>") for this document type. The default value will be used instead</xsl:message>
|
|
1550
|
-
<xsl:value-of select="$
|
|
1583
|
+
<xsl:value-of select="$default-level"/>
|
|
1551
1584
|
</xsl:when>
|
|
1552
1585
|
<xsl:otherwise>
|
|
1553
1586
|
<xsl:value-of select="$candidate-maxlevel"/>
|
|
@@ -2207,8 +2240,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2207
2240
|
<xsl:apply-templates select="$publisher-attribute-options/html/knowl/pi:pub-attribute[@name='exercise-worksheet']" mode="set-pubfile-variable"/>
|
|
2208
2241
|
</xsl:variable>
|
|
2209
2242
|
|
|
2210
|
-
<xsl:variable name="knowl-exercise-
|
|
2211
|
-
<xsl:apply-templates select="$publisher-attribute-options/html/knowl/pi:pub-attribute[@name='exercise-
|
|
2243
|
+
<xsl:variable name="knowl-exercise-reading">
|
|
2244
|
+
<xsl:apply-templates select="$publisher-attribute-options/html/knowl/pi:pub-attribute[@name='exercise-reading']" mode="set-pubfile-variable"/>
|
|
2212
2245
|
</xsl:variable>
|
|
2213
2246
|
|
|
2214
2247
|
<!-- -->
|
|
@@ -3122,6 +3155,33 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3122
3155
|
<xsl:value-of select="substring-after($join-latex-pagebreaks, ' ')"/>
|
|
3123
3156
|
</xsl:variable>
|
|
3124
3157
|
|
|
3158
|
+
<!-- The document classes of the LaTeX conversions, and the Beamer -->
|
|
3159
|
+
<!-- class, accept the same eight point sizes as a class option, so -->
|
|
3160
|
+
<!-- the check on a publisher's choice is shared. A caller provides -->
|
|
3161
|
+
<!-- the value to test, the value to use when the test fails, and -->
|
|
3162
|
+
<!-- the name of the publication file entry, for the message. -->
|
|
3163
|
+
<xsl:template name="validate-font-size">
|
|
3164
|
+
<xsl:param name="candidate"/>
|
|
3165
|
+
<xsl:param name="fallback"/>
|
|
3166
|
+
<xsl:param name="entry"/>
|
|
3167
|
+
<xsl:choose>
|
|
3168
|
+
<xsl:when test="($candidate = '8') or
|
|
3169
|
+
($candidate = '9') or
|
|
3170
|
+
($candidate = '10') or
|
|
3171
|
+
($candidate = '11') or
|
|
3172
|
+
($candidate = '12') or
|
|
3173
|
+
($candidate = '14') or
|
|
3174
|
+
($candidate = '17') or
|
|
3175
|
+
($candidate = '20')">
|
|
3176
|
+
<xsl:value-of select="$candidate"/>
|
|
3177
|
+
</xsl:when>
|
|
3178
|
+
<xsl:otherwise>
|
|
3179
|
+
<xsl:message>PTX:FALLBACK: <xsl:value-of select="$entry"/> in publication file should be 8, 9, 10, 11, 12, 14, 17 or 20 points, not "<xsl:value-of select="$candidate"/>". Proceeding with default value: "<xsl:value-of select="$fallback"/>"</xsl:message>
|
|
3180
|
+
<xsl:value-of select="$fallback"/>
|
|
3181
|
+
</xsl:otherwise>
|
|
3182
|
+
</xsl:choose>
|
|
3183
|
+
</xsl:template>
|
|
3184
|
+
|
|
3125
3185
|
<!-- For historical reasons, this variable has "pt" as part -->
|
|
3126
3186
|
<!-- of its value. A change would need to be coordinated -->
|
|
3127
3187
|
<!-- with every application in the -latex conversion. -->
|
|
@@ -3129,25 +3189,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3129
3189
|
<xsl:choose>
|
|
3130
3190
|
<!-- via publication file -->
|
|
3131
3191
|
<xsl:when test="$publication/latex/@font-size">
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
<xsl:
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
($fs = '11') or
|
|
3139
|
-
($fs = '12') or
|
|
3140
|
-
($fs = '14') or
|
|
3141
|
-
($fs = '17') or
|
|
3142
|
-
($fs = '20')">
|
|
3143
|
-
<xsl:value-of select="$fs"/>
|
|
3144
|
-
<xsl:text>pt</xsl:text>
|
|
3145
|
-
</xsl:when>
|
|
3146
|
-
<xsl:otherwise>
|
|
3147
|
-
<xsl:message>PTX:FALLBACK: LaTeX @font-size in publication file should be 8, 9, 10, 11, 12, 14, 17 or 20 points, not "<xsl:value-of select="$publication/latex/@font-size"/>". Proceeding with default value: "10"</xsl:message>
|
|
3148
|
-
<xsl:text>10pt</xsl:text>
|
|
3149
|
-
</xsl:otherwise>
|
|
3150
|
-
</xsl:choose>
|
|
3192
|
+
<xsl:call-template name="validate-font-size">
|
|
3193
|
+
<xsl:with-param name="candidate" select="$publication/latex/@font-size"/>
|
|
3194
|
+
<xsl:with-param name="fallback" select="'10'"/>
|
|
3195
|
+
<xsl:with-param name="entry" select="'LaTeX @font-size'"/>
|
|
3196
|
+
</xsl:call-template>
|
|
3197
|
+
<xsl:text>pt</xsl:text>
|
|
3151
3198
|
</xsl:when>
|
|
3152
3199
|
<!-- via deprecated stringparam: assumes "pt" as the unit of measure -->
|
|
3153
3200
|
<!-- (this is recycled code, so no real attempt to do better) -->
|
|
@@ -3176,18 +3223,22 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3176
3223
|
</xsl:variable>
|
|
3177
3224
|
|
|
3178
3225
|
<!-- Font selection for the XSL-FO PDF route ("pdf-fo"). A key names a -->
|
|
3179
|
-
<!-- tested font set; the FO conversion maps the key to concrete font
|
|
3180
|
-
<!-- family names, which pretext/fop.xconf embeds.
|
|
3181
|
-
<!--
|
|
3226
|
+
<!-- tested font set; the FO conversion maps the key to concrete font -->
|
|
3227
|
+
<!-- family names, which pretext/fop.xconf embeds. The keys are -->
|
|
3228
|
+
<!-- 'latin-modern' (the default, matching the LaTeX route) and -->
|
|
3229
|
+
<!-- 'alegreya' (a book face for text-heavy documents). -->
|
|
3182
3230
|
<xsl:variable name="pdf-font">
|
|
3183
3231
|
<xsl:variable name="default-pdf-font" select="'latin-modern'"/>
|
|
3184
3232
|
<xsl:choose>
|
|
3185
3233
|
<xsl:when test="$publication/pdf/@font = 'latin-modern'">
|
|
3186
3234
|
<xsl:text>latin-modern</xsl:text>
|
|
3187
3235
|
</xsl:when>
|
|
3236
|
+
<xsl:when test="$publication/pdf/@font = 'alegreya'">
|
|
3237
|
+
<xsl:text>alegreya</xsl:text>
|
|
3238
|
+
</xsl:when>
|
|
3188
3239
|
<!-- attempted to set, but not a recognized key -->
|
|
3189
3240
|
<xsl:when test="$publication/pdf/@font">
|
|
3190
|
-
<xsl:message>PTX:FALLBACK: PDF (XSL-FO) font setting in publisher file should be "latin-modern", not "<xsl:value-of select="$publication/pdf/@font"/>". Proceeding with default value: "<xsl:value-of select="$default-pdf-font"/>"</xsl:message>
|
|
3241
|
+
<xsl:message>PTX:FALLBACK: PDF (XSL-FO) font setting in publisher file should be "latin-modern" or "alegreya", not "<xsl:value-of select="$publication/pdf/@font"/>". Proceeding with default value: "<xsl:value-of select="$default-pdf-font"/>"</xsl:message>
|
|
3191
3242
|
<xsl:value-of select="$default-pdf-font"/>
|
|
3192
3243
|
</xsl:when>
|
|
3193
3244
|
<!-- no attempt at all, so default -->
|
|
@@ -3315,7 +3366,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3315
3366
|
</xsl:when>
|
|
3316
3367
|
<!-- set, but not correct, so inform and use default -->
|
|
3317
3368
|
<xsl:when test="$publication/html/asymptote/@links">
|
|
3318
|
-
<xsl:message>PTX:FALLBACK: HTML links to Asymptote publisher file should be "yes" (adds link below image) or "no" (no links), not "<xsl:value-of select="$publication/
|
|
3369
|
+
<xsl:message>PTX:FALLBACK: HTML links to Asymptote publisher file should be "yes" (adds link below image) or "no" (no links), not "<xsl:value-of select="$publication/html/asymptote/@links"/>". Proceeding with default value: "no" (no links)</xsl:message>
|
|
3319
3370
|
<xsl:text>no</xsl:text>
|
|
3320
3371
|
</xsl:when>
|
|
3321
3372
|
<!-- unset, use the default, which is "no" since -->
|
|
@@ -3406,6 +3457,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3406
3457
|
<xsl:apply-templates select="$publisher-attribute-options/revealjs/appearance/pi:pub-attribute[@name='custom-css']" mode="set-pubfile-variable"/>
|
|
3407
3458
|
</xsl:variable>
|
|
3408
3459
|
|
|
3460
|
+
<!-- Reveal.js Slide Numbering -->
|
|
3461
|
+
|
|
3462
|
+
<xsl:variable name="reveal-slide-numbering">
|
|
3463
|
+
<xsl:apply-templates select="$publisher-attribute-options/revealjs/appearance/pi:pub-attribute[@name='slide-numbering']" mode="set-pubfile-variable"/>
|
|
3464
|
+
</xsl:variable>
|
|
3465
|
+
<!-- Convert "yes"/"no" to a boolean variable -->
|
|
3466
|
+
<xsl:variable name="b-reveal-slide-numbering" select="$reveal-slide-numbering = 'yes'"/>
|
|
3467
|
+
|
|
3409
3468
|
<!-- Reveal.js Controls Back Arrows -->
|
|
3410
3469
|
|
|
3411
3470
|
<xsl:variable name="reveal-control-backarrow">
|
|
@@ -3528,6 +3587,48 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3528
3587
|
<xsl:apply-templates select="$publisher-attribute-options/beamer/appearance/pi:pub-attribute[@name='theme']" mode="set-pubfile-variable"/>
|
|
3529
3588
|
</xsl:variable>
|
|
3530
3589
|
|
|
3590
|
+
<!-- Beamer Slide Numbering -->
|
|
3591
|
+
|
|
3592
|
+
<xsl:variable name="beamer-slide-numbering">
|
|
3593
|
+
<xsl:apply-templates select="$publisher-attribute-options/beamer/appearance/pi:pub-attribute[@name='slide-numbering']" mode="set-pubfile-variable"/>
|
|
3594
|
+
</xsl:variable>
|
|
3595
|
+
<!-- Convert "yes"/"no" to a boolean variable -->
|
|
3596
|
+
<xsl:variable name="b-beamer-slide-numbering" select="$beamer-slide-numbering = 'yes'"/>
|
|
3597
|
+
|
|
3598
|
+
<!-- Beamer Aspect Ratio -->
|
|
3599
|
+
|
|
3600
|
+
<!-- Beamer builds a slide as a small page, which a viewer scales up -->
|
|
3601
|
+
<!-- to fill a screen, so the shape of that page is all a publisher -->
|
|
3602
|
+
<!-- chooses. The Beamer class realizes a shape as a class option, -->
|
|
3603
|
+
<!-- spelled without the separator, and the conversion does that -->
|
|
3604
|
+
<!-- translation; here we only record the publisher's choice. -->
|
|
3605
|
+
<xsl:variable name="beamer-aspect-ratio">
|
|
3606
|
+
<xsl:apply-templates select="$publisher-attribute-options/beamer/page/pi:pub-attribute[@name='aspect-ratio']" mode="set-pubfile-variable"/>
|
|
3607
|
+
</xsl:variable>
|
|
3608
|
+
|
|
3609
|
+
<!-- Beamer Font Size -->
|
|
3610
|
+
|
|
3611
|
+
<!-- The Beamer class accepts the same eight point sizes as the -->
|
|
3612
|
+
<!-- LaTeX document classes, and 11 points is its own default. A -->
|
|
3613
|
+
<!-- size other than 10, 11, or 12 points needs the "extsizes" -->
|
|
3614
|
+
<!-- package. As with the LaTeX conversion, this variable carries -->
|
|
3615
|
+
<!-- "pt" as part of its value. -->
|
|
3616
|
+
<xsl:variable name="beamer-font-size">
|
|
3617
|
+
<xsl:choose>
|
|
3618
|
+
<xsl:when test="$publication/beamer/@font-size">
|
|
3619
|
+
<xsl:call-template name="validate-font-size">
|
|
3620
|
+
<xsl:with-param name="candidate" select="$publication/beamer/@font-size"/>
|
|
3621
|
+
<xsl:with-param name="fallback" select="'11'"/>
|
|
3622
|
+
<xsl:with-param name="entry" select="'Beamer @font-size'"/>
|
|
3623
|
+
</xsl:call-template>
|
|
3624
|
+
</xsl:when>
|
|
3625
|
+
<xsl:otherwise>
|
|
3626
|
+
<xsl:text>11</xsl:text>
|
|
3627
|
+
</xsl:otherwise>
|
|
3628
|
+
</xsl:choose>
|
|
3629
|
+
<xsl:text>pt</xsl:text>
|
|
3630
|
+
</xsl:variable>
|
|
3631
|
+
|
|
3531
3632
|
|
|
3532
3633
|
<!-- ########################################### -->
|
|
3533
3634
|
<!-- Set Values/Defaults for Publisher Variables -->
|
|
@@ -3568,10 +3669,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3568
3669
|
</journal>
|
|
3569
3670
|
<!-- The default CSL style file is empty so that this -->
|
|
3570
3671
|
<!-- feature can be "opt in", initially, and perhaps -->
|
|
3571
|
-
<!-- forever.
|
|
3572
|
-
<!-- the
|
|
3573
|
-
<!--
|
|
3574
|
-
<!--
|
|
3672
|
+
<!-- forever. Naming a journal is one way to opt in, -->
|
|
3673
|
+
<!-- when the journal has a style (see the template -->
|
|
3674
|
+
<!-- computing this default). citeproc-py bundles a -->
|
|
3675
|
+
<!-- single style, while the "citeproc-py-styles" -->
|
|
3676
|
+
<!-- package supplies the CSL repository's thousands. -->
|
|
3575
3677
|
<citation-stylesheet-language>
|
|
3576
3678
|
<pi:pub-attribute name="style" default="" freeform="yes"/>
|
|
3577
3679
|
</citation-stylesheet-language>
|
|
@@ -3606,7 +3708,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3606
3708
|
<html>
|
|
3607
3709
|
<pi:pub-attribute name="short-answer-responses" default="graded" options="always"/>
|
|
3608
3710
|
<pi:pub-attribute name="read-aloud" default="yes" options="no"/>
|
|
3609
|
-
<pi:pub-attribute name="favicon" default="none" options="simple"/>
|
|
3711
|
+
<pi:pub-attribute name="favicon" default="none" options="simple svg"/>
|
|
3610
3712
|
<pi:pub-attribute name="embed-button" default="no" options="yes"/>
|
|
3611
3713
|
<pi:pub-attribute name="design-width" freeform="yes"/>
|
|
3612
3714
|
<calculator>
|
|
@@ -3639,7 +3741,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3639
3741
|
<pi:pub-attribute name="exercise-inline" default="yes" options="no" legacy-stringparam="html.knowl.exercise.inline"/>
|
|
3640
3742
|
<pi:pub-attribute name="exercise-divisional" default="no" options="yes" legacy-stringparam="html.knowl.exercise.sectional"/>
|
|
3641
3743
|
<pi:pub-attribute name="exercise-worksheet" default="no" options="yes" legacy-stringparam="html.knowl.exercise.worksheet"/>
|
|
3642
|
-
<pi:pub-attribute name="exercise-readingquestion" default="no" options="yes" legacy-stringparam="html.knowl.exercise.readingquestion"/>
|
|
3744
|
+
<pi:pub-attribute name="exercise-reading" legacy-name="exercise-readingquestion" default="no" options="yes" legacy-stringparam="html.knowl.exercise.readingquestion"/>
|
|
3643
3745
|
</knowl>
|
|
3644
3746
|
<cross-references>
|
|
3645
3747
|
<pi:pub-attribute name="knowled" default="maximum" options="never cross-page"/>
|
|
@@ -3764,6 +3866,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3764
3866
|
<appearance>
|
|
3765
3867
|
<pi:pub-attribute name="theme" default="simple" freeform="yes"/>
|
|
3766
3868
|
<pi:pub-attribute name="custom-css" default="" freeform="yes"/>
|
|
3869
|
+
<pi:pub-attribute name="slide-numbering" default="no" options="yes"/>
|
|
3767
3870
|
</appearance>
|
|
3768
3871
|
<controls>
|
|
3769
3872
|
<pi:pub-attribute name="backarrows" default="faded" options="hidden visible"/>
|
|
@@ -3784,7 +3887,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3784
3887
|
<beamer>
|
|
3785
3888
|
<appearance>
|
|
3786
3889
|
<pi:pub-attribute name="theme" default="Boadilla" freeform="yes"/>
|
|
3890
|
+
<pi:pub-attribute name="slide-numbering" default="no" options="yes"/>
|
|
3787
3891
|
</appearance>
|
|
3892
|
+
<page>
|
|
3893
|
+
<pi:pub-attribute name="aspect-ratio" default="16:9" options="4:3 16:10 14:9 5:4 3:2"/>
|
|
3894
|
+
</page>
|
|
3788
3895
|
</beamer>
|
|
3789
3896
|
</pi:publisher>
|
|
3790
3897
|
|
|
@@ -3802,7 +3909,29 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3802
3909
|
<!-- get the corresponding attribute from the publisher file -->
|
|
3803
3910
|
<!-- which may not exist -->
|
|
3804
3911
|
<xsl:variable name="full-path" select="concat('$publication/', $path)"/>
|
|
3805
|
-
<xsl:variable name="
|
|
3912
|
+
<xsl:variable name="new-name-attribute" select="dyn:evaluate($full-path)"/>
|
|
3913
|
+
<!-- An attribute that has been renamed carries its old name as -->
|
|
3914
|
+
<!-- "@legacy-name", and a publisher who used that name still gets -->
|
|
3915
|
+
<!-- the value, with a deprecation message. The path to it is the -->
|
|
3916
|
+
<!-- path to this attribute's parent, plus the old name. -->
|
|
3917
|
+
<xsl:variable name="legacy-name-path">
|
|
3918
|
+
<xsl:choose>
|
|
3919
|
+
<xsl:when test="@legacy-name">
|
|
3920
|
+
<xsl:apply-templates select=".." mode="pub-entry-path"/>
|
|
3921
|
+
<xsl:value-of select="concat('@', @legacy-name)"/>
|
|
3922
|
+
</xsl:when>
|
|
3923
|
+
<!-- no old name, so a legal expression selecting nothing -->
|
|
3924
|
+
<xsl:otherwise>
|
|
3925
|
+
<xsl:text>self::node()[false()]</xsl:text>
|
|
3926
|
+
</xsl:otherwise>
|
|
3927
|
+
</xsl:choose>
|
|
3928
|
+
</xsl:variable>
|
|
3929
|
+
<xsl:variable name="legacy-name-attribute" select="dyn:evaluate(concat('$publication/', $legacy-name-path))"/>
|
|
3930
|
+
<xsl:variable name="pubfile-attribute" select="$new-name-attribute | $legacy-name-attribute"/>
|
|
3931
|
+
<!-- say so, once, when only the old name is present -->
|
|
3932
|
+
<xsl:if test="$legacy-name-attribute and not($new-name-attribute)">
|
|
3933
|
+
<xsl:message>PTX:DEPRECATE: the publisher file entry <xsl:value-of select="$legacy-name-path"/> has been renamed <xsl:value-of select="$path"/>. Your value, "<xsl:value-of select="$legacy-name-attribute"/>", will be used. However you should move to the new name.</xsl:message>
|
|
3934
|
+
</xsl:if>
|
|
3806
3935
|
<!-- The default value, which may be specified or may vary conditionally -->
|
|
3807
3936
|
<!-- (via a custom template) appears frequently as the provided value -->
|
|
3808
3937
|
<!-- when there is an error condition of some type, and is also echo'ed -->
|
|
@@ -3919,7 +4048,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3919
4048
|
<!-- is to allow deprecation warnings to flag (and often react -->
|
|
3920
4049
|
<!-- favorably) to attempted uses. Dated, and in chronological -->
|
|
3921
4050
|
<!-- order. Grep, or the git pickaxe (log -S) using the date strings -->
|
|
3922
|
-
|
|
4051
|
+
<!-- is often effective in locating all the pieces of a deprecation. -->
|
|
4052
|
+
<!-- A NEW ENTRY GOES AT THE END OF THE BANK, just above the marker -->
|
|
4053
|
+
<!-- that closes it, never beside a similar parameter higher up. -->
|
|
3923
4054
|
|
|
3924
4055
|
<!-- Conversion specific parameters that die will -->
|
|
3925
4056
|
<!-- live on in warnings, which are isolated in the -->
|
|
@@ -4144,6 +4275,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4144
4275
|
<!-- html/annotation/@platform in publisher file -->
|
|
4145
4276
|
<xsl:param name="html.annotation" select="''" />
|
|
4146
4277
|
|
|
4278
|
+
<!-- End of the bank: a new retired parameter goes just above. -->
|
|
4279
|
+
|
|
4147
4280
|
<!-- ###################################### -->
|
|
4148
4281
|
<!-- Parameter Deprecation Warning Messages -->
|
|
4149
4282
|
<!-- ###################################### -->
|
|
@@ -4185,6 +4318,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4185
4318
|
<xsl:variable name="document-root" select="./*[not(self::docinfo)]"/>
|
|
4186
4319
|
|
|
4187
4320
|
|
|
4321
|
+
<!-- The messages below are in the order the parameters were deprecated, -->
|
|
4322
|
+
<!-- and they print in that order, so A NEW ENTRY GOES AT THE END OF THE -->
|
|
4323
|
+
<!-- SEQUENCE, just above the marker that closes it. Placing one beside -->
|
|
4324
|
+
<!-- a similar message instead lands it among far older dates, where the -->
|
|
4325
|
+
<!-- next reader will not think to look for it. -->
|
|
4326
|
+
<!-- -->
|
|
4188
4327
|
<!-- 2017-07-05 sidebyside cannot be cross-referenced anymore, so not knowlizable -->
|
|
4189
4328
|
<xsl:call-template name="parameter-deprecation-message">
|
|
4190
4329
|
<xsl:with-param name="date-string" select="'2017-07-05'" />
|
|
@@ -4816,6 +4955,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4816
4955
|
<xsl:with-param name="incorrect-use" select="($directory.images != '')" />
|
|
4817
4956
|
</xsl:call-template>
|
|
4818
4957
|
<!-- -->
|
|
4958
|
+
<!-- End of the chronological sequence: a new entry goes just above. -->
|
|
4819
4959
|
</xsl:template>
|
|
4820
4960
|
|
|
4821
4961
|
</xsl:stylesheet>
|
|
@@ -105,6 +105,23 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
105
105
|
<!-- and package math for subsequent processing, so no such -->
|
|
106
106
|
<!-- contortions are necessary and a simpler wrapping is possible. -->
|
|
107
107
|
|
|
108
|
+
<!-- Accidentals inside music notation are the Unicode characters -->
|
|
109
|
+
<!-- the HTML conversion writes, which MathJax renders from its own -->
|
|
110
|
+
<!-- fonts, except the double sharp and double flat, for which it -->
|
|
111
|
+
<!-- has no glyph: it emits them as fallback text in a generic serif -->
|
|
112
|
+
<!-- face, which a PDF or EPUB font may lack (FOP prints a "#"), and -->
|
|
113
|
+
<!-- the Speech Rule Engine can neither speak nor braille them. So -->
|
|
114
|
+
<!-- the extracted LaTeX doubles the single characters instead, -->
|
|
115
|
+
<!-- braced so that a superscript takes both. Written as characters -->
|
|
116
|
+
<!-- rather than \sharp and \flat, they are legal inside the \text{} -->
|
|
117
|
+
<!-- that holds a chord's alterations. -->
|
|
118
|
+
<xsl:template name="doublesharp">
|
|
119
|
+
<xsl:text>{♯♯}</xsl:text>
|
|
120
|
+
</xsl:template>
|
|
121
|
+
<xsl:template name="doubleflat">
|
|
122
|
+
<xsl:text>{♭♭}</xsl:text>
|
|
123
|
+
</xsl:template>
|
|
124
|
+
|
|
108
125
|
<!-- Inline math does not need a "span", just delimiters -->
|
|
109
126
|
<xsl:template name="inline-math-wrapper">
|
|
110
127
|
<xsl:param name="math"/>
|
|
@@ -167,10 +184,13 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
167
184
|
<!-- Flag the context as "inline" v. "displaymath" -->
|
|
168
185
|
<!-- so that we can do things like place a CSS class -->
|
|
169
186
|
<!-- for MathJax to see when processing the math bits. -->
|
|
170
|
-
|
|
187
|
+
<!-- Music notation ("n", "scaledeg", "timesignature", "chord") is -->
|
|
188
|
+
<!-- LaTeX built by the -common templates and set as inline math, so -->
|
|
189
|
+
<!-- it needs a representation exactly as an "m" does. -->
|
|
190
|
+
<xsl:template match="m|md|n|scaledeg|timesignature|chord" mode="extraction">
|
|
171
191
|
<xsl:variable name="context">
|
|
172
192
|
<xsl:choose>
|
|
173
|
-
<xsl:when test="self::m">
|
|
193
|
+
<xsl:when test="self::m or self::n or self::scaledeg or self::timesignature or self::chord">
|
|
174
194
|
<xsl:text>inline</xsl:text>
|
|
175
195
|
</xsl:when>
|
|
176
196
|
<xsl:when test="self::md">
|
|
@@ -48,7 +48,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
48
48
|
xmlns:pi="http://pretextbook.org/2020/pretext/internal"
|
|
49
49
|
xmlns:svg="http://www.w3.org/2000/svg"
|
|
50
50
|
xmlns:math="http://www.w3.org/1998/Math/MathML"
|
|
51
|
-
|
|
51
|
+
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
|
52
|
+
exclude-result-prefixes="svg xhtml"
|
|
52
53
|
>
|
|
53
54
|
|
|
54
55
|
<xsl:output method="xml" encoding="UTF-8"/>
|
|
@@ -70,10 +71,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
70
71
|
|
|
71
72
|
<!-- We explicitly kill the LaTeX macro div, lest -->
|
|
72
73
|
<!-- it get picked up as similar to the other math -->
|
|
73
|
-
<xsl:template match="div[@id = 'latex-macros']"/>
|
|
74
|
+
<xsl:template match="xhtml:div[@id = 'latex-macros']"/>
|
|
74
75
|
|
|
75
76
|
<!-- Body has what we want/need -->
|
|
76
|
-
<xsl:template match="body">
|
|
77
|
+
<xsl:template match="xhtml:body">
|
|
77
78
|
<pi:math-representations>
|
|
78
79
|
<xsl:apply-templates select="node()|@*"/>
|
|
79
80
|
<xsl:text>

</xsl:text>
|
|
@@ -83,14 +84,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
83
84
|
<!-- Replace PreTeXt "div" w/ location info plus MJ "mjx-data" -->
|
|
84
85
|
<!-- container by a consolidated PreteXt "pi:math" container -->
|
|
85
86
|
<!-- with location info -->
|
|
86
|
-
<xsl:template match="div/mjx-data">
|
|
87
|
+
<xsl:template match="xhtml:div/xhtml:mjx-data">
|
|
87
88
|
<xsl:text>

</xsl:text>
|
|
88
89
|
<pi:math>
|
|
89
90
|
<!-- duplicate location, context info -->
|
|
90
91
|
<xsl:copy-of select="../@*"/>
|
|
91
92
|
<!-- pickup whatever gets produced by MJ/SRE script with -->
|
|
92
93
|
<!-- its own containerization: MathML, SVG, braille, speech -->
|
|
93
|
-
<xsl:apply-templates select="math:math|svg:svg|mjx-braille|mjx-speech"/>
|
|
94
|
+
<xsl:apply-templates select="math:math|svg:svg|xhtml:mjx-braille|xhtml:mjx-speech"/>
|
|
94
95
|
</pi:math>
|
|
95
96
|
</xsl:template>
|
|
96
97
|
|
|
@@ -109,13 +110,13 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
109
110
|
</div>
|
|
110
111
|
</xsl:template>
|
|
111
112
|
|
|
112
|
-
<xsl:template match="mjx-braille">
|
|
113
|
+
<xsl:template match="xhtml:mjx-braille">
|
|
113
114
|
<div class="braille">
|
|
114
115
|
<xsl:copy-of select="node()"/>
|
|
115
116
|
</div>
|
|
116
117
|
</xsl:template>
|
|
117
118
|
|
|
118
|
-
<xsl:template match="mjx-speech">
|
|
119
|
+
<xsl:template match="xhtml:mjx-speech">
|
|
119
120
|
<div class="speech">
|
|
120
121
|
<xsl:copy-of select="node()"/>
|
|
121
122
|
</div>
|
|
@@ -129,7 +130,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
129
130
|
<!-- NB: need to have this prefixed with "body" to -->
|
|
130
131
|
<!-- identify it as top-level, global situation, -->
|
|
131
132
|
<!-- rather than local to each individual SVG -->
|
|
132
|
-
<xsl:template match="body/svg:svg[svg:defs]">
|
|
133
|
+
<xsl:template match="xhtml:body/svg:svg[svg:defs]">
|
|
133
134
|
<xsl:copy>
|
|
134
135
|
<xsl:attribute name="id">
|
|
135
136
|
<xsl:text>font-data</xsl:text>
|
|
@@ -55,6 +55,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
55
55
|
<!-- Intend output for a text file -->
|
|
56
56
|
<xsl:output method="text" encoding="UTF-8"/>
|
|
57
57
|
|
|
58
|
+
<!-- A report has no use for generated references and citations, -->
|
|
59
|
+
<!-- so need not look for them, nor say when they are missing -->
|
|
60
|
+
<xsl:variable name="b-consulting-csl-file" select="false()"/>
|
|
61
|
+
|
|
58
62
|
<!-- IMPORTANT: to report the value of a (computed) publisher variable, -->
|
|
59
63
|
<!-- two related routines are involved. For a variable not previously -->
|
|
60
64
|
<!-- supported, a developer must take action to implement a report. The -->
|