@pretextbook/pretext-html 0.19.0 → 0.19.1
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/assets/upstream.json +2 -2
- package/assets/xsl/extract-biblio-csl.xsl +1 -1
- package/assets/xsl/extract-pg.xsl +2 -2
- package/assets/xsl/latex/pretext-latex-texstyle.xsl +3 -3
- package/assets/xsl/pretext-assembly.xsl +35 -11
- package/assets/xsl/pretext-common.xsl +4 -4
- package/assets/xsl/pretext-html.xsl +20 -10
- package/assets/xsl/pretext-latex-common.xsl +26 -25
- package/assets/xsl/pretext-runestone.xsl +26 -0
- package/assets/xsl-bundle.json +1 -1
- package/dist/{cli-CddPgMt-.js → cli-BkcKZmqL.js} +5 -6
- package/dist/cli.js +1 -1
- package/dist/html-static.d.ts +2 -2
- package/dist/index.browser.js +6 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/assets/upstream.json
CHANGED
|
@@ -326,7 +326,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
326
326
|
<xsl:element name="xref-csl" namespace="http://pretextbook.org/2020/pretext/internal">
|
|
327
327
|
<!-- namespacing the attribute is sort of ugly -->
|
|
328
328
|
<xsl:attribute name="id">
|
|
329
|
-
<xsl:
|
|
329
|
+
<xsl:apply-templates select="." mode="assembly-id"/>
|
|
330
330
|
</xsl:attribute>
|
|
331
331
|
<xsl:value-of select="$citation-item-list"/>
|
|
332
332
|
</xsl:element>
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
|
|
176
176
|
<xsl:template match="webwork[@source|statement|task|text()]" mode="extraction">
|
|
177
177
|
<xsl:variable name="problem">
|
|
178
|
-
<xsl:
|
|
178
|
+
<xsl:apply-templates select=".." mode="assembly-id"/>
|
|
179
179
|
</xsl:variable>
|
|
180
180
|
<problem>
|
|
181
181
|
<xsl:attribute name="id">
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
<!-- the Python routines, which know it as "copied-from". -->
|
|
199
199
|
<xsl:if test="@pi:copied-from">
|
|
200
200
|
<xsl:attribute name="copied-from">
|
|
201
|
-
<xsl:
|
|
201
|
+
<xsl:apply-templates select="id(@pi:copied-from)/.." mode="assembly-id"/>
|
|
202
202
|
</xsl:attribute>
|
|
203
203
|
</xsl:if>
|
|
204
204
|
<!-- 2. a seed for randomization (with a default explicitly declared) -->
|
|
@@ -493,7 +493,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
493
493
|
<xsl:text>{</xsl:text>
|
|
494
494
|
<xsl:choose>
|
|
495
495
|
<xsl:when test="@arg = 'unique-id'">
|
|
496
|
-
<xsl:
|
|
496
|
+
<xsl:apply-templates select="$ptx-node" mode="unique-id"/>
|
|
497
497
|
</xsl:when>
|
|
498
498
|
<xsl:when test="@arg = 'ordinal'">
|
|
499
499
|
<xsl:apply-templates select="$ptx-node" mode="texstyle-number"/>
|
|
@@ -511,7 +511,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
511
511
|
<xsl:text>[</xsl:text>
|
|
512
512
|
<xsl:choose>
|
|
513
513
|
<xsl:when test="@opt = 'unique-id'">
|
|
514
|
-
<xsl:
|
|
514
|
+
<xsl:apply-templates select="$ptx-node" mode="unique-id"/>
|
|
515
515
|
</xsl:when>
|
|
516
516
|
<xsl:when test="@arg = 'ordinal'">
|
|
517
517
|
<xsl:apply-templates select="$ptx-node" mode="texstyle-number"/>
|
|
@@ -523,7 +523,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
523
523
|
<xsl:text>{</xsl:text>
|
|
524
524
|
<xsl:choose>
|
|
525
525
|
<xsl:when test="@arg = 'unique-id'">
|
|
526
|
-
<xsl:
|
|
526
|
+
<xsl:apply-templates select="$ptx-node" mode="unique-id"/>
|
|
527
527
|
</xsl:when>
|
|
528
528
|
<xsl:when test="@arg = 'ordinal'">
|
|
529
529
|
<xsl:apply-templates select="$ptx-node" mode="texstyle-number"/>
|
|
@@ -2093,8 +2093,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2093
2093
|
<xsl:otherwise>
|
|
2094
2094
|
<!-- Load the per-exercise representation file for this -->
|
|
2095
2095
|
<!-- exercise, identified by its @pi:assembly-id. -->
|
|
2096
|
+
<xsl:variable name="the-id">
|
|
2097
|
+
<xsl:apply-templates select="." mode="assembly-id"/>
|
|
2098
|
+
</xsl:variable>
|
|
2096
2099
|
<xsl:variable name="webwork-rep-uri"
|
|
2097
|
-
select="concat($webwork-representations-dir,
|
|
2100
|
+
select="concat($webwork-representations-dir, $the-id, '.xml')"/>
|
|
2098
2101
|
<xsl:variable name="the-webwork-rep"
|
|
2099
2102
|
select="document($webwork-rep-uri, $original)/webwork-reps"/>
|
|
2100
2103
|
<xsl:choose>
|
|
@@ -2106,14 +2109,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2106
2109
|
<xsl:copy>
|
|
2107
2110
|
<xsl:apply-templates select="node()|@*" mode="representations"/>
|
|
2108
2111
|
</xsl:copy>
|
|
2109
|
-
<xsl:message>PTX:ERROR: no WeBWorK representations directory configured in the publication file; WeBWorK exercise with @pi:assembly-id "<xsl:value-of select="
|
|
2112
|
+
<xsl:message>PTX:ERROR: no WeBWorK representations directory configured in the publication file; WeBWorK exercise with @pi:assembly-id "<xsl:value-of select="$the-id"/>" will be empty.</xsl:message>
|
|
2110
2113
|
</xsl:when>
|
|
2111
2114
|
<!-- This should only fail if the file is missing or stale. Repeatedly. -->
|
|
2112
2115
|
<xsl:when test="not($the-webwork-rep)">
|
|
2113
2116
|
<xsl:copy>
|
|
2114
2117
|
<xsl:apply-templates select="node()|@*" mode="representations"/>
|
|
2115
2118
|
</xsl:copy>
|
|
2116
|
-
<xsl:message>PTX:ERROR: could not load WeBWorK representation file "<xsl:value-of select="$webwork-rep-uri"/>" for @pi:assembly-id "<xsl:value-of select="
|
|
2119
|
+
<xsl:message>PTX:ERROR: could not load WeBWorK representation file "<xsl:value-of select="$webwork-rep-uri"/>" for @pi:assembly-id "<xsl:value-of select="$the-id"/>"; re-generate the WeBWorK representations. A "webwork-representations.xml" in that directory indicates old-format files that need replacing.</xsl:message>
|
|
2117
2120
|
</xsl:when>
|
|
2118
2121
|
<xsl:otherwise>
|
|
2119
2122
|
<!-- The representation file may record a server failure -->
|
|
@@ -2123,7 +2126,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2123
2126
|
<!-- but warn the author so the failure does not go -->
|
|
2124
2127
|
<!-- unnoticed in later builds. -->
|
|
2125
2128
|
<xsl:if test="$the-webwork-rep/static/@failure">
|
|
2126
|
-
<xsl:message>PTX:WARNING: the WeBWorK problem with @pi:assembly-id "<xsl:value-of select="
|
|
2129
|
+
<xsl:message>PTX:WARNING: the WeBWorK problem with @pi:assembly-id "<xsl:value-of select="$the-id"/>" has a stored "<xsl:value-of select="$the-webwork-rep/static/@failure"/>" failure recorded when the WeBWorK representations were last generated. A placeholder is being rendered in its place. Re-generate the WeBWorK representations (and watch for errors) to retry.</xsl:message>
|
|
2127
2130
|
</xsl:if>
|
|
2128
2131
|
<!-- Build a temporary exercise with "webwork-reps" from the -->
|
|
2129
2132
|
<!-- representations file substituted in place of "webwork". -->
|
|
@@ -2557,8 +2560,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2557
2560
|
<xsl:when test="($exercise-style = 'static') and not($b-extracting)">
|
|
2558
2561
|
<!-- Read pre-computed URLs from sidecar file -->
|
|
2559
2562
|
<!-- But not if doing an extraction -->
|
|
2563
|
+
<xsl:variable name="the-id">
|
|
2564
|
+
<xsl:apply-templates select="." mode="assembly-id"/>
|
|
2565
|
+
</xsl:variable>
|
|
2560
2566
|
<xsl:variable name="url-file"
|
|
2561
|
-
select="document(concat($generated-directory-source, 'qrcode/',
|
|
2567
|
+
select="document(concat($generated-directory-source, 'qrcode/', $the-id, '-url.xml'), $original)"/>
|
|
2562
2568
|
<!-- panel widths are experimental -->
|
|
2563
2569
|
<sidebyside margins="7.5% 7.5%" widths="47% 21%" valign="top" halign="center">
|
|
2564
2570
|
<!-- copy over @xml:id, which may be in use by -->
|
|
@@ -3925,7 +3931,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3925
3931
|
<!-- id, and the derived name keeps it stable and -->
|
|
3926
3932
|
<!-- collision-free. -->
|
|
3927
3933
|
<xsl:attribute name="xml:id">
|
|
3928
|
-
<xsl:
|
|
3934
|
+
<xsl:apply-templates select="." mode="assembly-id"/>
|
|
3929
3935
|
<xsl:text>-ggb-slate</xsl:text>
|
|
3930
3936
|
</xsl:attribute>
|
|
3931
3937
|
<xsl:attribute name="surface">
|
|
@@ -5036,6 +5042,18 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
5036
5042
|
<!-- interrogate the file manufactured in the generated directory in -->
|
|
5037
5043
|
<!-- order to make a sample of its content. This happens before we -->
|
|
5038
5044
|
<!-- construct unique-id. -->
|
|
5045
|
+
<!-- -->
|
|
5046
|
+
<!-- exercise and the project-like elements, when holding a "webwork" -->
|
|
5047
|
+
<!-- A WeBWorK problem goes to a WeBWorK server, and what the server -->
|
|
5048
|
+
<!-- returns is saved in a file of representations named by this id. -->
|
|
5049
|
+
<!-- The "representations" pass reads that file back in, which happens -->
|
|
5050
|
+
<!-- before we construct unique-id. -->
|
|
5051
|
+
<!-- -->
|
|
5052
|
+
<!-- xref -->
|
|
5053
|
+
<!-- A citation is formatted for a Citation Style Language (CSL) style -->
|
|
5054
|
+
<!-- outside of this stylesheet, and the result is labeled by this id. -->
|
|
5055
|
+
<!-- The "assembly" pass reads the formatted citations back in, which -->
|
|
5056
|
+
<!-- happens before we construct unique-id. -->
|
|
5039
5057
|
|
|
5040
5058
|
<!-- NB: we believe the @pi:assembly-id will equal the @pi:unique-id -->
|
|
5041
5059
|
<!-- ("unique-id" template) for objects at the level of blocks, -->
|
|
@@ -5061,11 +5079,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
5061
5079
|
|
|
5062
5080
|
<!-- Every element carrying an "@pi:assembly-id" stamp reports it -->
|
|
5063
5081
|
<!-- through this single template. The match list is deliberately -->
|
|
5064
|
-
<!-- explicit — media and images, data files,
|
|
5065
|
-
<!--
|
|
5066
|
-
<!--
|
|
5067
|
-
<!--
|
|
5068
|
-
<!-- application.
|
|
5082
|
+
<!-- explicit — media and images, data files, WeBWorK and STACK -->
|
|
5083
|
+
<!-- problems, cross-references for citations, and the fill-in -->
|
|
5084
|
+
<!-- dynamic-substitution owners (the exercise-like elements, or a -->
|
|
5085
|
+
<!-- "task" they contain, whichever holds "setup") — so the BUG -->
|
|
5086
|
+
<!-- fallback below can catch an unexpected application. -->
|
|
5069
5087
|
<!-- -->
|
|
5070
5088
|
<!-- The stamp belongs to the assembly, laid down partway through -->
|
|
5071
5089
|
<!-- the phases so that the later ones can coordinate on it. It is -->
|
|
@@ -5077,6 +5095,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
5077
5095
|
<xsl:template match="audio|video|interactive|image
|
|
5078
5096
|
| datafile
|
|
5079
5097
|
| exercise/stack
|
|
5098
|
+
| exercise[@pi:exercise-interactive='webwork']
|
|
5099
|
+
| project[@pi:exercise-interactive='webwork']
|
|
5100
|
+
| activity[@pi:exercise-interactive='webwork']
|
|
5101
|
+
| exploration[@pi:exercise-interactive='webwork']
|
|
5102
|
+
| investigation[@pi:exercise-interactive='webwork']
|
|
5103
|
+
| xref
|
|
5080
5104
|
| exercise[@pi:exercise-interactive='fillin' and setup]
|
|
5081
5105
|
| project[@pi:exercise-interactive='fillin' and setup]
|
|
5082
5106
|
| activity[@pi:exercise-interactive='fillin' and setup]
|
|
@@ -1621,8 +1621,8 @@ Book (with parts), "section" at level 3
|
|
|
1621
1621
|
</xsl:apply-templates>
|
|
1622
1622
|
</xsl:template>
|
|
1623
1623
|
|
|
1624
|
-
<!-- Console Session, prompt on input line-->
|
|
1625
|
-
<!-- An interactive command-line session
|
|
1624
|
+
<!-- Console Session, prompt on input line -->
|
|
1625
|
+
<!-- An interactive command-line session, input and output in any order -->
|
|
1626
1626
|
<!-- Determining the prompt is a bit complicated, but always the same -->
|
|
1627
1627
|
<!-- and always a pure textual result. It becomes a part of the input -->
|
|
1628
1628
|
<!-- line, so this modal template has an "input" as its context. -->
|
|
@@ -3856,10 +3856,10 @@ Book (with parts), "section" at level 3
|
|
|
3856
3856
|
<!-- If part of exercise-like, use that label, otherwise own -->
|
|
3857
3857
|
<!-- This is an implicit use of &PROJECT-LIKE; and should be kept in sync -->
|
|
3858
3858
|
<xsl:when test="parent::exercise|parent::task|parent::project|parent::activity|parent::exploration|parent::investigation">
|
|
3859
|
-
<xsl:
|
|
3859
|
+
<xsl:apply-templates select=".." mode="unique-id"/>
|
|
3860
3860
|
</xsl:when>
|
|
3861
3861
|
<xsl:otherwise>
|
|
3862
|
-
<xsl:
|
|
3862
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
3863
3863
|
</xsl:otherwise>
|
|
3864
3864
|
</xsl:choose>
|
|
3865
3865
|
<xsl:text>.js</xsl:text>
|
|
@@ -6866,7 +6866,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6866
6866
|
<xsl:when test="latex-image">
|
|
6867
6867
|
<xsl:apply-templates select="$image-svg-xml/svg:svg/*" mode="svg-unique-ids">
|
|
6868
6868
|
<xsl:with-param name="svg-unique-id">
|
|
6869
|
-
<xsl:
|
|
6869
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
6870
6870
|
</xsl:with-param>
|
|
6871
6871
|
</xsl:apply-templates>
|
|
6872
6872
|
</xsl:when>
|
|
@@ -6936,7 +6936,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6936
6936
|
<!-- on the image, but kept within the available width, so an image -->
|
|
6937
6937
|
<!-- placed off-center by @margins does not push its description out -->
|
|
6938
6938
|
<!-- of the text. -->
|
|
6939
|
-
<xsl:template match="image[not(&SBS-LAYOUT-FILTER;)]" mode="description-style">
|
|
6939
|
+
<xsl:template match="image[not(&SBS-LAYOUT-FILTER;) and not(parent::datafile)]" mode="description-style">
|
|
6940
6940
|
<xsl:param name="layout" select="/.."/>
|
|
6941
6941
|
|
|
6942
6942
|
<xsl:variable name="width" select="number($layout/width)"/>
|
|
@@ -6968,9 +6968,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
6968
6968
|
</xsl:if>
|
|
6969
6969
|
</xsl:template>
|
|
6970
6970
|
|
|
6971
|
-
<!-- An interactive
|
|
6972
|
-
<!-- available width, so its
|
|
6973
|
-
|
|
6971
|
+
<!-- An interactive, or the image of a data file, is centered -->
|
|
6972
|
+
<!-- in a container that spans the available width, so its -->
|
|
6973
|
+
<!-- description is simply centered -->
|
|
6974
|
+
<xsl:template match="interactive[not(&SBS-LAYOUT-FILTER;)]|datafile/image" mode="description-style">
|
|
6974
6975
|
<xsl:attribute name="style">
|
|
6975
6976
|
<xsl:text>width: 80%; margin-left: 10%;</xsl:text>
|
|
6976
6977
|
</xsl:attribute>
|
|
@@ -10724,8 +10725,15 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
10724
10725
|
<!-- period below is Javascript syntax for methods -->
|
|
10725
10726
|
<xsl:with-param name="pad" select="concat($applet-onload-argument,'.')" />
|
|
10726
10727
|
</xsl:call-template>
|
|
10727
|
-
<!--
|
|
10728
|
-
|
|
10728
|
+
<!-- A script attached by the "source" attribute of the "interactive" -->
|
|
10729
|
+
<!-- may define a function named "listeners". It receives the applet -->
|
|
10730
|
+
<!-- once the commands above have run, so that event listeners can tie -->
|
|
10731
|
+
<!-- the applet to the HTML of the interactive, which they cannot do -->
|
|
10732
|
+
<!-- before the applet exists. Most interactives attach no such script, -->
|
|
10733
|
+
<!-- so the call is made only when the function is defined. -->
|
|
10734
|
+
<xsl:text>if (typeof listeners === "function") { listeners(</xsl:text>
|
|
10735
|
+
<xsl:value-of select="$applet-onload-argument"/>
|
|
10736
|
+
<xsl:text>); }
</xsl:text>
|
|
10729
10737
|
<xsl:text>};
</xsl:text>
|
|
10730
10738
|
</xsl:if>
|
|
10731
10739
|
<!-- Parameter reference: -->
|
|
@@ -13565,7 +13573,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13565
13573
|
</xsl:attribute>
|
|
13566
13574
|
<!-- copy id of this li for use in customization pass -->
|
|
13567
13575
|
<xsl:attribute name="uid">
|
|
13568
|
-
<xsl:
|
|
13576
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
13569
13577
|
</xsl:attribute>
|
|
13570
13578
|
<div class="toc-title-box">
|
|
13571
13579
|
<a href="{$the-url}" class="internal">
|
|
@@ -13599,7 +13607,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13599
13607
|
</xsl:attribute>
|
|
13600
13608
|
<!-- copy id of this li for use in customization pass, will remove there -->
|
|
13601
13609
|
<xsl:attribute name="uid">
|
|
13602
|
-
<xsl:
|
|
13610
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
13603
13611
|
</xsl:attribute>
|
|
13604
13612
|
<div class="toc-title-box">
|
|
13605
13613
|
<a href="{$the-url}" class="internal">
|
|
@@ -13628,7 +13636,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13628
13636
|
<xsl:variable name="toc-contents" select="exsl:node-set($toc-contents-rtf)"/>
|
|
13629
13637
|
|
|
13630
13638
|
<!-- get the unique id of the current page -->
|
|
13631
|
-
<xsl:variable name="uid"
|
|
13639
|
+
<xsl:variable name="uid">
|
|
13640
|
+
<xsl:apply-templates select="." mode="unique-id"/>
|
|
13641
|
+
</xsl:variable>
|
|
13632
13642
|
<!-- use that to find the ToC node for that page -->
|
|
13633
13643
|
<xsl:variable name="this-page-node" select="$toc-contents//*[@uid = $uid]"/>
|
|
13634
13644
|
<!-- ancestor list will allow us to identify when we are in the path to the page -->
|
|
@@ -339,9 +339,9 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
339
339
|
<xsl:text>%% this is a necessity for isolating styling and behavior
</xsl:text>
|
|
340
340
|
<xsl:text>%% The tcolorbox library of the same name loads the base library
</xsl:text>
|
|
341
341
|
<xsl:text>\tcbuselibrary{xparse}
</xsl:text>
|
|
342
|
-
<xsl:text>%% The tcolorbox
|
|
343
|
-
<xsl:text>%%
|
|
344
|
-
<xsl:text>%%
|
|
342
|
+
<xsl:text>%% The tcolorbox package loads TikZ. The TikZ calc library, for coordinate
</xsl:text>
|
|
343
|
+
<xsl:text>%% arithmetic, is not used by PreTeXt's own LaTeX; it is loaded because
</xsl:text>
|
|
344
|
+
<xsl:text>%% TikZ code provided by an author may rely on it
</xsl:text>
|
|
345
345
|
<xsl:text>\usetikzlibrary{calc}
</xsl:text>
|
|
346
346
|
<xsl:text>%% We use some more exotic tcolorbox keys to restore indentation to parboxes
</xsl:text>
|
|
347
347
|
<xsl:text>\tcbuselibrary{hooks}
</xsl:text>
|
|
@@ -1021,26 +1021,25 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
1021
1021
|
<xsl:text>\newcommand{\ptxhrulemedium}{\noalign{\hrule height 0.07em}}
</xsl:text>
|
|
1022
1022
|
<xsl:text>\newcommand{\ptxhrulethick} {\noalign{\hrule height 0.11em}}
</xsl:text>
|
|
1023
1023
|
<!-- http://tex.stackexchange.com/questions/24549/horizontal-rule-with-adjustable-height-behaving-like-clinen-m -->
|
|
1024
|
-
<!-- Could preserve/restore \arrayrulewidth on entry/exit to tabular
|
|
1025
|
-
<!-- But we'll get cleaner source with this built into macros
|
|
1026
|
-
<!--
|
|
1027
|
-
<!--
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
<xsl:text>\let\ptxoldsetlength\setlength
</xsl:text>
|
|
1024
|
+
<!-- Could preserve/restore \arrayrulewidth on entry/exit to tabular -->
|
|
1025
|
+
<!-- But we'll get cleaner source with this built into macros -->
|
|
1026
|
+
<!-- The widths are plain TeX assignments, not \setlength: a package -->
|
|
1027
|
+
<!-- such as "calc" (loaded by "pdfpages", "musicography", "mathtools") -->
|
|
1028
|
+
<!-- redefines \setlength, and a \global in front of its version has -->
|
|
1029
|
+
<!-- no lasting effect, so a partial rule would keep the default width -->
|
|
1031
1030
|
<xsl:text>\newlength{\ptxOldarrayrulewidth}
</xsl:text>
|
|
1032
1031
|
<xsl:text>\newcommand{\ptxcrulethin}[1]%
</xsl:text>
|
|
1033
|
-
<xsl:text>{\noalign{\global\
|
|
1034
|
-
<xsl:text>\noalign{\global\
|
|
1035
|
-
<xsl:text>\noalign{\global\
|
|
1032
|
+
<xsl:text>{\noalign{\global\ptxOldarrayrulewidth=\arrayrulewidth}%
</xsl:text>
|
|
1033
|
+
<xsl:text>\noalign{\global\arrayrulewidth=0.04em}\cline{#1}%
</xsl:text>
|
|
1034
|
+
<xsl:text>\noalign{\global\arrayrulewidth=\ptxOldarrayrulewidth}}%
</xsl:text>
|
|
1036
1035
|
<xsl:text>\newcommand{\ptxcrulemedium}[1]%
</xsl:text>
|
|
1037
|
-
<xsl:text>{\noalign{\global\
|
|
1038
|
-
<xsl:text>\noalign{\global\
|
|
1039
|
-
<xsl:text>\noalign{\global\
|
|
1036
|
+
<xsl:text>{\noalign{\global\ptxOldarrayrulewidth=\arrayrulewidth}%
</xsl:text>
|
|
1037
|
+
<xsl:text>\noalign{\global\arrayrulewidth=0.07em}\cline{#1}%
</xsl:text>
|
|
1038
|
+
<xsl:text>\noalign{\global\arrayrulewidth=\ptxOldarrayrulewidth}}
</xsl:text>
|
|
1040
1039
|
<xsl:text>\newcommand{\ptxcrulethick}[1]%
</xsl:text>
|
|
1041
|
-
<xsl:text>{\noalign{\global\
|
|
1042
|
-
<xsl:text>\noalign{\global\
|
|
1043
|
-
<xsl:text>\noalign{\global\
|
|
1040
|
+
<xsl:text>{\noalign{\global\ptxOldarrayrulewidth=\arrayrulewidth}%
</xsl:text>
|
|
1041
|
+
<xsl:text>\noalign{\global\arrayrulewidth=0.11em}\cline{#1}%
</xsl:text>
|
|
1042
|
+
<xsl:text>\noalign{\global\arrayrulewidth=\ptxOldarrayrulewidth}}
</xsl:text>
|
|
1044
1043
|
<!-- http://tex.stackexchange.com/questions/119153/table-with-different-rule-widths -->
|
|
1045
1044
|
<xsl:text>%% Single letter column specifiers defined via array package
</xsl:text>
|
|
1046
1045
|
<xsl:text>\newcolumntype{A}{!{\vrule width 0.04em}}
</xsl:text>
|
|
@@ -2135,9 +2134,8 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2135
2134
|
<xsl:text>%% You have elected to load the LaTeX "extpfeil" package
</xsl:text>
|
|
2136
2135
|
<xsl:text>%% for certain extensible arrows, and it should appear just below.
</xsl:text>
|
|
2137
2136
|
<xsl:text>%% This package has numerous shortcomings leading to conflicts with
</xsl:text>
|
|
2138
|
-
<xsl:text>%% packages like "stmaryrd"
|
|
2139
|
-
<xsl:text>%%
|
|
2140
|
-
<xsl:text>%% in the preamble in an effort to mitigate these shortcomings.
</xsl:text>
|
|
2137
|
+
<xsl:text>%% packages like "stmaryrd". It should appear late in the preamble
</xsl:text>
|
|
2138
|
+
<xsl:text>%% in an effort to mitigate these shortcomings.
</xsl:text>
|
|
2141
2139
|
</xsl:if>
|
|
2142
2140
|
<xsl:if test="not($latex-packages = '')">
|
|
2143
2141
|
<xsl:text>%% Begin: Author-provided TeX/LaTeX packages
</xsl:text>
|
|
@@ -2190,7 +2188,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2190
2188
|
<!-- Fill-in-the-blank in text content -->
|
|
2191
2189
|
<xsl:template name="fillin-text">
|
|
2192
2190
|
<xsl:text>%% Used for fillin answer blank in text
</xsl:text>
|
|
2193
|
-
<xsl:text>%%
|
|
2191
|
+
<xsl:text>%% Box style sizes its sides with \dimexpr, no package needed
</xsl:text>
|
|
2194
2192
|
<xsl:text>%% Argument is intended number of characters of blank
</xsl:text>
|
|
2195
2193
|
<xsl:text>%% Length may compress for output to fit in one line
</xsl:text>
|
|
2196
2194
|
<xsl:text>\newlength{\ptxfillinmaxwidth}
</xsl:text>
|
|
@@ -2204,13 +2202,16 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
2204
2202
|
<xsl:text>\newcommand{\ptxfillintext}[1]{%
</xsl:text>
|
|
2205
2203
|
<xsl:text>\setlength{\ptxfillinmaxwidth}{#1\ptxcharmaxwidth}%
</xsl:text>
|
|
2206
2204
|
<xsl:text>\setlength{\ptxfillincontract}{#1\ptxcharminwidth}%
</xsl:text>
|
|
2207
|
-
|
|
2205
|
+
<!-- The height of the box and shade styles comes from the strut box, -->
|
|
2206
|
+
<!-- which is one line high everywhere, while a "tabular" sets -->
|
|
2207
|
+
<!-- \baselineskip to zero inside its cells -->
|
|
2208
|
+
<xsl:text>\setlength{\ptxfillinheight}{\dimexpr\ht\strutbox+\dp\strutbox+1.2pt\relax}%
</xsl:text>
|
|
2208
2209
|
<xsl:choose>
|
|
2209
2210
|
<xsl:when test="$fillin-text-style = 'underline'">
|
|
2210
2211
|
<xsl:text>\strut\nobreak\leaders\vbox{\hrule width 0.3pt height 0.3pt \vskip -1.2pt}\hskip 1\ptxfillinmaxwidth minus \ptxfillincontract\nobreak\strut%
</xsl:text>
|
|
2211
2212
|
</xsl:when>
|
|
2212
2213
|
<xsl:when test="$fillin-text-style = 'box'">
|
|
2213
|
-
<xsl:text>\rule[-1.2pt]{0.3pt}{\
|
|
2214
|
+
<xsl:text>\rule[-1.2pt]{0.3pt}{\dimexpr\ptxfillinheight+0.6pt\relax}\nobreak\hspace{-0.3pt}\nobreak\leaders\vbox{\hrule width 0.3pt height 0.3pt \vskip \ptxfillinheight \hrule width 0.3pt height 0.3pt \vskip -1.2pt}\hskip 1\ptxfillinmaxwidth minus \ptxfillincontract\nobreak\hspace{-0.3pt}\rule[-1.2pt]{0.3pt}{\dimexpr\ptxfillinheight+0.6pt\relax}%
</xsl:text>
|
|
2214
2215
|
</xsl:when>
|
|
2215
2216
|
<xsl:when test="$fillin-text-style = 'shade'">
|
|
2216
2217
|
<xsl:text>{\color{fillintextshade}\strut\nobreak\leaders\vbox{\hrule width 0.3pt height \ptxfillinheight \vskip -1.2pt}\hskip 1\ptxfillinmaxwidth minus \ptxfillincontract}%
</xsl:text>
|
|
@@ -3104,7 +3104,33 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
3104
3104
|
<xsl:text>;base64,</xsl:text>
|
|
3105
3105
|
<xsl:value-of select="$image-b64-elt/@pi:base64"/>
|
|
3106
3106
|
</xsl:attribute>
|
|
3107
|
+
<!-- Alternative text as for other images, except that a -->
|
|
3108
|
+
<!-- data file is never decorative: an image without any -->
|
|
3109
|
+
<!-- description is named by its file instead -->
|
|
3110
|
+
<xsl:choose>
|
|
3111
|
+
<xsl:when test="not(string(image/shortdescription) = '')">
|
|
3112
|
+
<xsl:attribute name="alt">
|
|
3113
|
+
<xsl:apply-templates select="image/shortdescription"/>
|
|
3114
|
+
</xsl:attribute>
|
|
3115
|
+
</xsl:when>
|
|
3116
|
+
<xsl:when test="image/description">
|
|
3117
|
+
<xsl:attribute name="alt">
|
|
3118
|
+
<xsl:text>described in detail following the image</xsl:text>
|
|
3119
|
+
</xsl:attribute>
|
|
3120
|
+
<xsl:attribute name="aria-describedby">
|
|
3121
|
+
<xsl:apply-templates select="image" mode="describedby-id"/>
|
|
3122
|
+
</xsl:attribute>
|
|
3123
|
+
</xsl:when>
|
|
3124
|
+
<xsl:otherwise>
|
|
3125
|
+
<xsl:attribute name="alt">
|
|
3126
|
+
<xsl:text>Image file: </xsl:text>
|
|
3127
|
+
<xsl:value-of select="@filename"/>
|
|
3128
|
+
</xsl:attribute>
|
|
3129
|
+
</xsl:otherwise>
|
|
3130
|
+
</xsl:choose>
|
|
3107
3131
|
</img>
|
|
3132
|
+
<!-- possibly give a long description -->
|
|
3133
|
+
<xsl:apply-templates select="image" mode="description"/>
|
|
3108
3134
|
</xsl:when>
|
|
3109
3135
|
<!-- text, an authored toy example, or a serious external file -->
|
|
3110
3136
|
<xsl:when test="pre">
|