@pretextbook/pretext-html 0.1.0 → 0.1.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/README.md +42 -3
- package/assets/preview-html.xsl +230 -230
- package/assets/upstream.json +7 -7
- package/assets/xsl/README.md +0 -0
- package/assets/xsl/entities.ent +154 -154
- package/assets/xsl/extract-asymptote.xsl +68 -68
- package/assets/xsl/extract-biblio-csl.xsl +327 -327
- package/assets/xsl/extract-datafile.xsl +71 -71
- package/assets/xsl/extract-dynamic.xsl +139 -139
- package/assets/xsl/extract-identity.xsl +136 -136
- package/assets/xsl/extract-interactive.xsl +81 -81
- package/assets/xsl/extract-latex-image.xsl +118 -118
- package/assets/xsl/extract-mermaid.xsl +58 -58
- package/assets/xsl/extract-mom.xsl +63 -63
- package/assets/xsl/extract-pg.xsl +2897 -2897
- package/assets/xsl/extract-prefigure.xsl +157 -157
- package/assets/xsl/extract-qrcode.xsl +100 -100
- package/assets/xsl/extract-runestone-page-template.xsl +139 -139
- package/assets/xsl/extract-sageplot.xsl +166 -166
- package/assets/xsl/extract-stack.xsl +56 -56
- package/assets/xsl/extract-trace.xsl +134 -134
- package/assets/xsl/extract-youtube.xsl +63 -63
- package/assets/xsl/html-symbols.xsl +3344 -3344
- package/assets/xsl/latex/pretext-latex-AIM.xsl +56 -56
- package/assets/xsl/latex/pretext-latex-CLP.xsl +148 -148
- package/assets/xsl/latex/pretext-latex-chaos.xsl +317 -317
- package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +76 -76
- package/assets/xsl/latex/pretext-latex-guide.xsl +104 -104
- package/assets/xsl/latex/pretext-latex-texstyle.xsl +862 -862
- package/assets/xsl/localizations/README.md +0 -0
- package/assets/xsl/localizations/af-ZA.xml +276 -276
- package/assets/xsl/localizations/bg-BG.xml +276 -276
- package/assets/xsl/localizations/ca-ES.xml +285 -285
- package/assets/xsl/localizations/cs-CZ.xml +280 -280
- package/assets/xsl/localizations/de-DE.xml +281 -281
- package/assets/xsl/localizations/en-US.xml +427 -427
- package/assets/xsl/localizations/es-ES.xml +287 -287
- package/assets/xsl/localizations/fi-FI.xml +275 -275
- package/assets/xsl/localizations/fr-CA.xml +276 -276
- package/assets/xsl/localizations/fr-FR.xml +280 -280
- package/assets/xsl/localizations/hu-HU.xml +280 -280
- package/assets/xsl/localizations/it-IT.xml +276 -276
- package/assets/xsl/localizations/ku-CKB.xml +275 -275
- package/assets/xsl/localizations/localizations.xml +48 -48
- package/assets/xsl/localizations/nl-NL.xml +275 -275
- package/assets/xsl/localizations/pt-BR.xml +288 -288
- package/assets/xsl/localizations/pt-PT.xml +292 -292
- package/assets/xsl/localizations/zh-HANS.xml +269 -269
- package/assets/xsl/pretext-assembly.xsl +4795 -4795
- package/assets/xsl/pretext-basic-html.xsl +86 -86
- package/assets/xsl/pretext-beamer.xsl +662 -662
- package/assets/xsl/pretext-braille-preprint.xsl +2249 -2249
- package/assets/xsl/pretext-common.xsl +12018 -12018
- package/assets/xsl/pretext-dynamic.xsl +65 -65
- package/assets/xsl/pretext-epub.xsl +1483 -1483
- package/assets/xsl/pretext-fo.xsl +4593 -4593
- package/assets/xsl/pretext-html.xsl +14791 -14791
- package/assets/xsl/pretext-json-manifest.xsl +150 -150
- package/assets/xsl/pretext-jupyter.xsl +868 -868
- package/assets/xsl/pretext-latex-classic.xsl +952 -952
- package/assets/xsl/pretext-latex-common.xsl +11563 -11563
- package/assets/xsl/pretext-latex.xsl +47 -47
- package/assets/xsl/pretext-litprog.xsl +105 -105
- package/assets/xsl/pretext-merge.xsl +41 -41
- package/assets/xsl/pretext-numbers.xsl +875 -875
- package/assets/xsl/pretext-revealjs.xsl +522 -522
- package/assets/xsl/pretext-runestone-fitb.xsl +1233 -1233
- package/assets/xsl/pretext-runestone-static.xsl +1438 -1438
- package/assets/xsl/pretext-runestone.xsl +3083 -3083
- package/assets/xsl/pretext-sage-doctest.xsl +289 -289
- package/assets/xsl/pretext-smc.xsl +492 -492
- package/assets/xsl/pretext-solution-manual-latex.xsl +323 -323
- package/assets/xsl/pretext-text-utilities.xsl +1217 -1217
- package/assets/xsl/pretext-text.xsl +392 -392
- package/assets/xsl/pretext-units.xsl +195 -195
- package/assets/xsl/pretext-view-source.xsl +157 -157
- package/assets/xsl/pretext-ww-problem-sets.xsl +391 -391
- package/assets/xsl/publisher-variables.xsl +4756 -4756
- package/assets/xsl/support/README.md +0 -0
- package/assets/xsl/support/extract-math.xsl +256 -256
- package/assets/xsl/support/package-math.xsl +141 -141
- package/assets/xsl/support/play-button/README.md +0 -0
- package/assets/xsl/support/play-button/play-button.png +0 -0
- package/assets/xsl/support/play-button/play-button.svg +3 -3
- package/assets/xsl/support/pretext-pg-macros.xsl +110 -110
- package/assets/xsl/support/webpack_static_imports.xml +14 -14
- package/assets/xsl/tests/README.md +0 -0
- package/assets/xsl/tests/null.xml +3 -3
- package/assets/xsl/tests/pretext-text-utilities-test.xsl +333 -333
- package/assets/xsl/utilities/README.md +0 -0
- package/assets/xsl/utilities/author-report.xsl +107 -107
- package/assets/xsl/utilities/deprecate-autoname.sed +18 -18
- package/assets/xsl/utilities/deprecate-index.sed +33 -33
- package/assets/xsl/utilities/fix-deprecations.xsl +663 -663
- package/assets/xsl/utilities/pretext-enhanced-source.xsl +112 -112
- package/assets/xsl/utilities/report-publisher-variables.xsl +162 -162
- package/assets/xsl/xml-to-json.xsl +326 -326
- package/assets/xsl/xml-to-string.xsl +328 -328
- package/dist/{cli-C6tfAVvi.js → cli-BQizBK0N.js} +74 -72
- package/dist/cli.d.ts +0 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +12 -6
- package/dist/mounts.d.ts +0 -0
- package/dist/publication.d.ts +0 -0
- package/dist/renderer.d.ts +10 -0
- package/dist/sourcemap.d.ts +0 -0
- package/dist/theme.d.ts +68 -0
- package/dist/theme.js +93 -0
- package/dist/xinclude.d.ts +0 -0
- package/package.json +14 -2
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
<?xml version='1.0'?>
|
|
2
|
-
|
|
3
|
-
<!--********************************************************************
|
|
4
|
-
Copyright 2018 Robert A. Beezer
|
|
5
|
-
|
|
6
|
-
This file is part of PreTeXt.
|
|
7
|
-
|
|
8
|
-
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
|
-
it under the terms of the GNU General Public License as published by
|
|
10
|
-
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
|
-
License (at your option).
|
|
12
|
-
|
|
13
|
-
PreTeXt is distributed in the hope that it will be useful,
|
|
14
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
GNU General Public License for more details.
|
|
17
|
-
|
|
18
|
-
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*********************************************************************-->
|
|
21
|
-
|
|
22
|
-
<!-- Conveniences for classes of similar elements -->
|
|
23
|
-
<!DOCTYPE xsl:stylesheet [
|
|
24
|
-
<!ENTITY % entities SYSTEM "../entities.ent">
|
|
25
|
-
%entities;
|
|
26
|
-
]>
|
|
27
|
-
|
|
28
|
-
<!-- Identify as a stylesheet -->
|
|
29
|
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
30
|
-
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
31
|
-
>
|
|
32
|
-
|
|
33
|
-
<!-- Override specific tenplates of the standard conversion -->
|
|
34
|
-
<xsl:import href="../pretext-latex.xsl" />
|
|
35
|
-
|
|
36
|
-
<!-- Intend output for rendering by pdflatex -->
|
|
37
|
-
<xsl:output method="text" />
|
|
38
|
-
|
|
39
|
-
<!-- "assemblage" -->
|
|
40
|
-
<!-- Boxed title -->
|
|
41
|
-
<xsl:template match="assemblage" mode="tcb-style">
|
|
42
|
-
<xsl:text>enhanced, arc=2ex, colback=blue!5, colframe=blue!75!black,
</xsl:text>
|
|
43
|
-
<xsl:text>colbacktitle=blue!20, coltitle=black, boxed title style={sharp corners, frame hidden},
</xsl:text>
|
|
44
|
-
<xsl:text>fonttitle=\bfseries, attach boxed title to top left={xshift=4mm,yshift=-3mm}, top=3mm,
</xsl:text>
|
|
45
|
-
</xsl:template>
|
|
46
|
-
|
|
47
|
-
<!-- ASIDE-LIKE: "aside", "historical", "biographical" -->
|
|
48
|
-
<!-- Square, drop shadow -->
|
|
49
|
-
<xsl:template match="&ASIDE-LIKE;" mode="tcb-style">
|
|
50
|
-
<xsl:text>enhanced, sharp corners, colback=blue!3, colframe=blue!50!black,
</xsl:text>
|
|
51
|
-
<xsl:text>add to width=-1ex, shadow={1ex}{-1ex}{0ex}{black!50!white},
</xsl:text>
|
|
52
|
-
<xsl:text>coltitle=black, fonttitle=\bfseries, attach title to upper, after title={\space},</xsl:text>
|
|
53
|
-
</xsl:template>
|
|
54
|
-
|
|
55
|
-
</xsl:stylesheet>
|
|
56
|
-
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright 2018 Robert A. Beezer
|
|
5
|
+
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
|
+
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
|
+
License (at your option).
|
|
12
|
+
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*********************************************************************-->
|
|
21
|
+
|
|
22
|
+
<!-- Conveniences for classes of similar elements -->
|
|
23
|
+
<!DOCTYPE xsl:stylesheet [
|
|
24
|
+
<!ENTITY % entities SYSTEM "../entities.ent">
|
|
25
|
+
%entities;
|
|
26
|
+
]>
|
|
27
|
+
|
|
28
|
+
<!-- Identify as a stylesheet -->
|
|
29
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
30
|
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
31
|
+
>
|
|
32
|
+
|
|
33
|
+
<!-- Override specific tenplates of the standard conversion -->
|
|
34
|
+
<xsl:import href="../pretext-latex.xsl" />
|
|
35
|
+
|
|
36
|
+
<!-- Intend output for rendering by pdflatex -->
|
|
37
|
+
<xsl:output method="text" />
|
|
38
|
+
|
|
39
|
+
<!-- "assemblage" -->
|
|
40
|
+
<!-- Boxed title -->
|
|
41
|
+
<xsl:template match="assemblage" mode="tcb-style">
|
|
42
|
+
<xsl:text>enhanced, arc=2ex, colback=blue!5, colframe=blue!75!black,
</xsl:text>
|
|
43
|
+
<xsl:text>colbacktitle=blue!20, coltitle=black, boxed title style={sharp corners, frame hidden},
</xsl:text>
|
|
44
|
+
<xsl:text>fonttitle=\bfseries, attach boxed title to top left={xshift=4mm,yshift=-3mm}, top=3mm,
</xsl:text>
|
|
45
|
+
</xsl:template>
|
|
46
|
+
|
|
47
|
+
<!-- ASIDE-LIKE: "aside", "historical", "biographical" -->
|
|
48
|
+
<!-- Square, drop shadow -->
|
|
49
|
+
<xsl:template match="&ASIDE-LIKE;" mode="tcb-style">
|
|
50
|
+
<xsl:text>enhanced, sharp corners, colback=blue!3, colframe=blue!50!black,
</xsl:text>
|
|
51
|
+
<xsl:text>add to width=-1ex, shadow={1ex}{-1ex}{0ex}{black!50!white},
</xsl:text>
|
|
52
|
+
<xsl:text>coltitle=black, fonttitle=\bfseries, attach title to upper, after title={\space},</xsl:text>
|
|
53
|
+
</xsl:template>
|
|
54
|
+
|
|
55
|
+
</xsl:stylesheet>
|
|
56
|
+
|
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
<?xml version='1.0'?>
|
|
2
|
-
|
|
3
|
-
<!--********************************************************************
|
|
4
|
-
Copyright 2018 Andrew Rechnitzer
|
|
5
|
-
|
|
6
|
-
This file is part of PreTeXt.
|
|
7
|
-
|
|
8
|
-
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
|
-
it under the terms of the GNU General Public License as published by
|
|
10
|
-
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
|
-
License (at your option).
|
|
12
|
-
|
|
13
|
-
PreTeXt is distributed in the hope that it will be useful,
|
|
14
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
GNU General Public License for more details.
|
|
17
|
-
|
|
18
|
-
You should have received a copy of the GNU General Public License
|
|
19
|
-
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*********************************************************************-->
|
|
21
|
-
|
|
22
|
-
<!-- Conveniences for classes of similar elements -->
|
|
23
|
-
<!DOCTYPE xsl:stylesheet [
|
|
24
|
-
<!ENTITY % entities SYSTEM "../entities.ent">
|
|
25
|
-
%entities;
|
|
26
|
-
]>
|
|
27
|
-
|
|
28
|
-
<!-- Identify as a stylesheet -->
|
|
29
|
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
30
|
-
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
31
|
-
>
|
|
32
|
-
|
|
33
|
-
<!-- Override specific tenplates of the standard conversion -->
|
|
34
|
-
<xsl:import href="../pretext-latex.xsl" />
|
|
35
|
-
|
|
36
|
-
<!-- Intend output for rendering by pdflatex -->
|
|
37
|
-
<xsl:output method="text" />
|
|
38
|
-
|
|
39
|
-
<!-- "objectives", "outcomes",etc. -->
|
|
40
|
-
<!-- Default tcb, identically -->
|
|
41
|
-
<xsl:template match="&GOAL-LIKE;" mode="tcb-style">
|
|
42
|
-
<xsl:text/>
|
|
43
|
-
</xsl:template>
|
|
44
|
-
|
|
45
|
-
<!-- EXAMPLE-LIKE: "example", "question", "problem" -->
|
|
46
|
-
<!-- Default tcolorbox, but with tricolor titles -->
|
|
47
|
-
<!-- Each just slightly different -->
|
|
48
|
-
|
|
49
|
-
<!-- Example styling from CLP -->
|
|
50
|
-
<xsl:template match="example" mode="tcb-style">
|
|
51
|
-
<xsl:text>colback=white, colframe=black, colbacktitle=white, coltitle=black,
|
|
52
|
-
enhanced,
|
|
53
|
-
breakable,
|
|
54
|
-
attach boxed title to top left={xshift=7mm, yshift*=-\tcboxedtitleheight/2},
|
|
55
|
-
frame hidden,
|
|
56
|
-
overlay unbroken={
|
|
57
|
-
\draw[thick, \lt-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
58
|
-
\draw[thick, -\gt, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
59
|
-
\draw[thick, \lt-\gt, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
60
|
-
},
|
|
61
|
-
overlay first={
|
|
62
|
-
\draw[thick, \lt-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
63
|
-
\draw[thick, -\gt, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
64
|
-
},
|
|
65
|
-
overlay middle={},
|
|
66
|
-
overlay last={
|
|
67
|
-
\node[draw, thick, rectangle, rounded corners] (repeatTitle) at ([xshift=-12ex]interior.south east) {\textbf{Example~\thetcbcounter}};
|
|
68
|
-
\draw[thick, \lt-, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(repeatTitle);
|
|
69
|
-
\draw[thick,-\gt,rounded corners] (repeatTitle)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
70
|
-
},
|
|
71
|
-
</xsl:text>
|
|
72
|
-
</xsl:template>
|
|
73
|
-
|
|
74
|
-
<xsl:template match="question" mode="tcb-style">
|
|
75
|
-
<xsl:text>
|
|
76
|
-
colback=white, colframe=blue, colbacktitle=white, coltitle=blue,
|
|
77
|
-
enhanced,
|
|
78
|
-
breakable,
|
|
79
|
-
attach boxed title to top left={xshift=7mm, yshift*=-\tcboxedtitleheight/2},
|
|
80
|
-
frame hidden,
|
|
81
|
-
overlay unbroken={
|
|
82
|
-
\draw[blue, thick, square-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
83
|
-
\draw[blue,thick, -square, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
84
|
-
\draw[blue,thick, square-square, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
85
|
-
},
|
|
86
|
-
overlay first={
|
|
87
|
-
\draw[blue,thick, square-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
88
|
-
\draw[blue,thick, -square, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
89
|
-
},
|
|
90
|
-
overlay middle={},
|
|
91
|
-
overlay last={
|
|
92
|
-
\node[blue, draw, thick, rectangle, rounded corners] (repeatTitle) at ([xshift=-12ex]interior.south east) {\textbf{Example~\thetcbcounter}};
|
|
93
|
-
\draw[blue, thick, square-, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(repeatTitle);
|
|
94
|
-
\draw[blue, thick, -square,rounded corners] (repeatTitle)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
95
|
-
},
|
|
96
|
-
</xsl:text>
|
|
97
|
-
</xsl:template>
|
|
98
|
-
|
|
99
|
-
<xsl:template match="problem" mode="tcb-style">
|
|
100
|
-
<xsl:text>
|
|
101
|
-
colback=white, colframe=red, colbacktitle=white, coltitle=red,
|
|
102
|
-
enhanced,
|
|
103
|
-
breakable,
|
|
104
|
-
attach boxed title to top left={xshift=7mm, yshift*=-\tcboxedtitleheight/2},
|
|
105
|
-
frame hidden,
|
|
106
|
-
overlay unbroken={
|
|
107
|
-
\draw[red, thick, |-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
108
|
-
\draw[red,thick, -|, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
109
|
-
\draw[red,thick, |-|, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
110
|
-
},
|
|
111
|
-
overlay first={
|
|
112
|
-
\draw[red,thick, |-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
113
|
-
\draw[red,thick, -|, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
114
|
-
},
|
|
115
|
-
overlay middle={},
|
|
116
|
-
overlay last={
|
|
117
|
-
\node[red, draw, thick, rectangle, rounded corners] (repeatTitle) at ([xshift=-12ex]interior.south east) {\textbf{Example~\thetcbcounter}};
|
|
118
|
-
\draw[red, thick, |-, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(repeatTitle);
|
|
119
|
-
\draw[red, thick, -|,rounded corners] (repeatTitle)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
120
|
-
},
|
|
121
|
-
</xsl:text>
|
|
122
|
-
</xsl:template>
|
|
123
|
-
|
|
124
|
-
<!-- DEFINITION-LIKE: "definition" -->
|
|
125
|
-
<!-- Various extreme choices from the tcolorbox documentation -->
|
|
126
|
-
<!-- Note: a trailing comma is OK, and maybe a good idea -->
|
|
127
|
-
<!-- Note: the style definition may split across several line -->
|
|
128
|
-
<!-- of the LaTeX source using the hex A (dec 10) character -->
|
|
129
|
-
<!-- Note: "enhanced" is necessary for boxed titles -->
|
|
130
|
-
<xsl:template match="&DEFINITION-LIKE;" mode="tcb-style">
|
|
131
|
-
breakable, colframe=MidnightBlue, colback=MidnightBlue!5, colbacktitle=MidnightBlue!70, coltitle=black, enhanced, attach boxed title to top left={xshift=7mm, yshift*=-2ex},sharp corners=northwest, arc=10pt,
|
|
132
|
-
</xsl:template>
|
|
133
|
-
|
|
134
|
-
<!-- REMARK-LIKE: "remark", "convention", "note", -->
|
|
135
|
-
<!-- "observation", "warning", "insight" -->
|
|
136
|
-
<!-- COMPUTATION-LIKE: "computation", "technology" -->
|
|
137
|
-
<!--White title text, but title backgounds vary -->
|
|
138
|
-
<!--by category, and remarks have sharp corners -->
|
|
139
|
-
<xsl:template match="&REMARK-LIKE;" mode="tcb-style">
|
|
140
|
-
<xsl:text>colbacktitle=red, sharp corners</xsl:text>
|
|
141
|
-
</xsl:template>
|
|
142
|
-
<xsl:template match="&COMPUTATION-LIKE;" mode="tcb-style">
|
|
143
|
-
<xsl:text>colbacktitle=blue</xsl:text>
|
|
144
|
-
</xsl:template>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
</xsl:stylesheet>
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright 2018 Andrew Rechnitzer
|
|
5
|
+
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
|
+
|
|
8
|
+
PreTeXt is free software: you can redistribute it and/or modify
|
|
9
|
+
it under the terms of the GNU General Public License as published by
|
|
10
|
+
the Free Software Foundation, either version 2 or version 3 of the
|
|
11
|
+
License (at your option).
|
|
12
|
+
|
|
13
|
+
PreTeXt is distributed in the hope that it will be useful,
|
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
GNU General Public License for more details.
|
|
17
|
+
|
|
18
|
+
You should have received a copy of the GNU General Public License
|
|
19
|
+
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*********************************************************************-->
|
|
21
|
+
|
|
22
|
+
<!-- Conveniences for classes of similar elements -->
|
|
23
|
+
<!DOCTYPE xsl:stylesheet [
|
|
24
|
+
<!ENTITY % entities SYSTEM "../entities.ent">
|
|
25
|
+
%entities;
|
|
26
|
+
]>
|
|
27
|
+
|
|
28
|
+
<!-- Identify as a stylesheet -->
|
|
29
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
|
30
|
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
31
|
+
>
|
|
32
|
+
|
|
33
|
+
<!-- Override specific tenplates of the standard conversion -->
|
|
34
|
+
<xsl:import href="../pretext-latex.xsl" />
|
|
35
|
+
|
|
36
|
+
<!-- Intend output for rendering by pdflatex -->
|
|
37
|
+
<xsl:output method="text" />
|
|
38
|
+
|
|
39
|
+
<!-- "objectives", "outcomes",etc. -->
|
|
40
|
+
<!-- Default tcb, identically -->
|
|
41
|
+
<xsl:template match="&GOAL-LIKE;" mode="tcb-style">
|
|
42
|
+
<xsl:text/>
|
|
43
|
+
</xsl:template>
|
|
44
|
+
|
|
45
|
+
<!-- EXAMPLE-LIKE: "example", "question", "problem" -->
|
|
46
|
+
<!-- Default tcolorbox, but with tricolor titles -->
|
|
47
|
+
<!-- Each just slightly different -->
|
|
48
|
+
|
|
49
|
+
<!-- Example styling from CLP -->
|
|
50
|
+
<xsl:template match="example" mode="tcb-style">
|
|
51
|
+
<xsl:text>colback=white, colframe=black, colbacktitle=white, coltitle=black,
|
|
52
|
+
enhanced,
|
|
53
|
+
breakable,
|
|
54
|
+
attach boxed title to top left={xshift=7mm, yshift*=-\tcboxedtitleheight/2},
|
|
55
|
+
frame hidden,
|
|
56
|
+
overlay unbroken={
|
|
57
|
+
\draw[thick, \lt-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
58
|
+
\draw[thick, -\gt, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
59
|
+
\draw[thick, \lt-\gt, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
60
|
+
},
|
|
61
|
+
overlay first={
|
|
62
|
+
\draw[thick, \lt-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
63
|
+
\draw[thick, -\gt, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
64
|
+
},
|
|
65
|
+
overlay middle={},
|
|
66
|
+
overlay last={
|
|
67
|
+
\node[draw, thick, rectangle, rounded corners] (repeatTitle) at ([xshift=-12ex]interior.south east) {\textbf{Example~\thetcbcounter}};
|
|
68
|
+
\draw[thick, \lt-, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(repeatTitle);
|
|
69
|
+
\draw[thick,-\gt,rounded corners] (repeatTitle)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
70
|
+
},
|
|
71
|
+
</xsl:text>
|
|
72
|
+
</xsl:template>
|
|
73
|
+
|
|
74
|
+
<xsl:template match="question" mode="tcb-style">
|
|
75
|
+
<xsl:text>
|
|
76
|
+
colback=white, colframe=blue, colbacktitle=white, coltitle=blue,
|
|
77
|
+
enhanced,
|
|
78
|
+
breakable,
|
|
79
|
+
attach boxed title to top left={xshift=7mm, yshift*=-\tcboxedtitleheight/2},
|
|
80
|
+
frame hidden,
|
|
81
|
+
overlay unbroken={
|
|
82
|
+
\draw[blue, thick, square-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
83
|
+
\draw[blue,thick, -square, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
84
|
+
\draw[blue,thick, square-square, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
85
|
+
},
|
|
86
|
+
overlay first={
|
|
87
|
+
\draw[blue,thick, square-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
88
|
+
\draw[blue,thick, -square, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
89
|
+
},
|
|
90
|
+
overlay middle={},
|
|
91
|
+
overlay last={
|
|
92
|
+
\node[blue, draw, thick, rectangle, rounded corners] (repeatTitle) at ([xshift=-12ex]interior.south east) {\textbf{Example~\thetcbcounter}};
|
|
93
|
+
\draw[blue, thick, square-, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(repeatTitle);
|
|
94
|
+
\draw[blue, thick, -square,rounded corners] (repeatTitle)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
95
|
+
},
|
|
96
|
+
</xsl:text>
|
|
97
|
+
</xsl:template>
|
|
98
|
+
|
|
99
|
+
<xsl:template match="problem" mode="tcb-style">
|
|
100
|
+
<xsl:text>
|
|
101
|
+
colback=white, colframe=red, colbacktitle=white, coltitle=red,
|
|
102
|
+
enhanced,
|
|
103
|
+
breakable,
|
|
104
|
+
attach boxed title to top left={xshift=7mm, yshift*=-\tcboxedtitleheight/2},
|
|
105
|
+
frame hidden,
|
|
106
|
+
overlay unbroken={
|
|
107
|
+
\draw[red, thick, |-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
108
|
+
\draw[red,thick, -|, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
109
|
+
\draw[red,thick, |-|, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
110
|
+
},
|
|
111
|
+
overlay first={
|
|
112
|
+
\draw[red,thick, |-, rounded corners] ([yshift=-3ex]interior.north west)--(interior.north west)--(title);
|
|
113
|
+
\draw[red,thick, -|, rounded corners] (title)--(interior.north east)--([yshift=-3ex]interior.north east);
|
|
114
|
+
},
|
|
115
|
+
overlay middle={},
|
|
116
|
+
overlay last={
|
|
117
|
+
\node[red, draw, thick, rectangle, rounded corners] (repeatTitle) at ([xshift=-12ex]interior.south east) {\textbf{Example~\thetcbcounter}};
|
|
118
|
+
\draw[red, thick, |-, rounded corners] ([yshift=3ex]interior.south west)--(interior.south west)--(repeatTitle);
|
|
119
|
+
\draw[red, thick, -|,rounded corners] (repeatTitle)--(interior.south east)--([yshift=3ex]interior.south east);
|
|
120
|
+
},
|
|
121
|
+
</xsl:text>
|
|
122
|
+
</xsl:template>
|
|
123
|
+
|
|
124
|
+
<!-- DEFINITION-LIKE: "definition" -->
|
|
125
|
+
<!-- Various extreme choices from the tcolorbox documentation -->
|
|
126
|
+
<!-- Note: a trailing comma is OK, and maybe a good idea -->
|
|
127
|
+
<!-- Note: the style definition may split across several line -->
|
|
128
|
+
<!-- of the LaTeX source using the hex A (dec 10) character -->
|
|
129
|
+
<!-- Note: "enhanced" is necessary for boxed titles -->
|
|
130
|
+
<xsl:template match="&DEFINITION-LIKE;" mode="tcb-style">
|
|
131
|
+
breakable, colframe=MidnightBlue, colback=MidnightBlue!5, colbacktitle=MidnightBlue!70, coltitle=black, enhanced, attach boxed title to top left={xshift=7mm, yshift*=-2ex},sharp corners=northwest, arc=10pt,
|
|
132
|
+
</xsl:template>
|
|
133
|
+
|
|
134
|
+
<!-- REMARK-LIKE: "remark", "convention", "note", -->
|
|
135
|
+
<!-- "observation", "warning", "insight" -->
|
|
136
|
+
<!-- COMPUTATION-LIKE: "computation", "technology" -->
|
|
137
|
+
<!--White title text, but title backgounds vary -->
|
|
138
|
+
<!--by category, and remarks have sharp corners -->
|
|
139
|
+
<xsl:template match="&REMARK-LIKE;" mode="tcb-style">
|
|
140
|
+
<xsl:text>colbacktitle=red, sharp corners</xsl:text>
|
|
141
|
+
</xsl:template>
|
|
142
|
+
<xsl:template match="&COMPUTATION-LIKE;" mode="tcb-style">
|
|
143
|
+
<xsl:text>colbacktitle=blue</xsl:text>
|
|
144
|
+
</xsl:template>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
</xsl:stylesheet>
|