@pretextbook/pretext-html 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +104 -4
  2. package/assets/preview-html.xsl +230 -230
  3. package/assets/upstream.json +7 -7
  4. package/assets/xsl/entities.ent +154 -154
  5. package/assets/xsl/extract-asymptote.xsl +68 -68
  6. package/assets/xsl/extract-biblio-csl.xsl +327 -327
  7. package/assets/xsl/extract-datafile.xsl +71 -71
  8. package/assets/xsl/extract-dynamic.xsl +139 -139
  9. package/assets/xsl/extract-identity.xsl +136 -136
  10. package/assets/xsl/extract-interactive.xsl +81 -81
  11. package/assets/xsl/extract-latex-image.xsl +118 -118
  12. package/assets/xsl/extract-mermaid.xsl +58 -58
  13. package/assets/xsl/extract-mom.xsl +63 -63
  14. package/assets/xsl/extract-pg.xsl +2897 -2897
  15. package/assets/xsl/extract-prefigure.xsl +157 -157
  16. package/assets/xsl/extract-qrcode.xsl +100 -100
  17. package/assets/xsl/extract-runestone-page-template.xsl +139 -139
  18. package/assets/xsl/extract-sageplot.xsl +166 -166
  19. package/assets/xsl/extract-stack.xsl +56 -56
  20. package/assets/xsl/extract-trace.xsl +134 -134
  21. package/assets/xsl/extract-youtube.xsl +63 -63
  22. package/assets/xsl/html-symbols.xsl +3344 -3344
  23. package/assets/xsl/latex/pretext-latex-AIM.xsl +56 -56
  24. package/assets/xsl/latex/pretext-latex-CLP.xsl +148 -148
  25. package/assets/xsl/latex/pretext-latex-chaos.xsl +317 -317
  26. package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +76 -76
  27. package/assets/xsl/latex/pretext-latex-guide.xsl +104 -104
  28. package/assets/xsl/latex/pretext-latex-texstyle.xsl +862 -862
  29. package/assets/xsl/localizations/af-ZA.xml +276 -276
  30. package/assets/xsl/localizations/bg-BG.xml +276 -276
  31. package/assets/xsl/localizations/ca-ES.xml +285 -285
  32. package/assets/xsl/localizations/cs-CZ.xml +280 -280
  33. package/assets/xsl/localizations/de-DE.xml +281 -281
  34. package/assets/xsl/localizations/en-US.xml +427 -427
  35. package/assets/xsl/localizations/es-ES.xml +287 -287
  36. package/assets/xsl/localizations/fi-FI.xml +275 -275
  37. package/assets/xsl/localizations/fr-CA.xml +276 -276
  38. package/assets/xsl/localizations/fr-FR.xml +280 -280
  39. package/assets/xsl/localizations/hu-HU.xml +280 -280
  40. package/assets/xsl/localizations/it-IT.xml +276 -276
  41. package/assets/xsl/localizations/ku-CKB.xml +275 -275
  42. package/assets/xsl/localizations/localizations.xml +48 -48
  43. package/assets/xsl/localizations/nl-NL.xml +275 -275
  44. package/assets/xsl/localizations/pt-BR.xml +288 -288
  45. package/assets/xsl/localizations/pt-PT.xml +292 -292
  46. package/assets/xsl/localizations/zh-HANS.xml +269 -269
  47. package/assets/xsl/pretext-assembly.xsl +4795 -4795
  48. package/assets/xsl/pretext-basic-html.xsl +86 -86
  49. package/assets/xsl/pretext-beamer.xsl +662 -662
  50. package/assets/xsl/pretext-braille-preprint.xsl +2249 -2249
  51. package/assets/xsl/pretext-common.xsl +12018 -12018
  52. package/assets/xsl/pretext-dynamic.xsl +65 -65
  53. package/assets/xsl/pretext-epub.xsl +1483 -1483
  54. package/assets/xsl/pretext-fo.xsl +4593 -4593
  55. package/assets/xsl/pretext-html.xsl +14791 -14791
  56. package/assets/xsl/pretext-json-manifest.xsl +150 -150
  57. package/assets/xsl/pretext-jupyter.xsl +868 -868
  58. package/assets/xsl/pretext-latex-classic.xsl +952 -952
  59. package/assets/xsl/pretext-latex-common.xsl +11563 -11563
  60. package/assets/xsl/pretext-latex.xsl +47 -47
  61. package/assets/xsl/pretext-litprog.xsl +105 -105
  62. package/assets/xsl/pretext-merge.xsl +41 -41
  63. package/assets/xsl/pretext-numbers.xsl +875 -875
  64. package/assets/xsl/pretext-revealjs.xsl +522 -522
  65. package/assets/xsl/pretext-runestone-fitb.xsl +1233 -1233
  66. package/assets/xsl/pretext-runestone-static.xsl +1438 -1438
  67. package/assets/xsl/pretext-runestone.xsl +3083 -3083
  68. package/assets/xsl/pretext-sage-doctest.xsl +289 -289
  69. package/assets/xsl/pretext-smc.xsl +492 -492
  70. package/assets/xsl/pretext-solution-manual-latex.xsl +323 -323
  71. package/assets/xsl/pretext-text-utilities.xsl +1217 -1217
  72. package/assets/xsl/pretext-text.xsl +392 -392
  73. package/assets/xsl/pretext-units.xsl +195 -195
  74. package/assets/xsl/pretext-view-source.xsl +157 -157
  75. package/assets/xsl/pretext-ww-problem-sets.xsl +391 -391
  76. package/assets/xsl/publisher-variables.xsl +4756 -4756
  77. package/assets/xsl/support/extract-math.xsl +256 -256
  78. package/assets/xsl/support/package-math.xsl +141 -141
  79. package/assets/xsl/support/play-button/play-button.svg +3 -3
  80. package/assets/xsl/support/pretext-pg-macros.xsl +110 -110
  81. package/assets/xsl/support/webpack_static_imports.xml +14 -14
  82. package/assets/xsl/tests/null.xml +3 -3
  83. package/assets/xsl/tests/pretext-text-utilities-test.xsl +333 -333
  84. package/assets/xsl/utilities/author-report.xsl +107 -107
  85. package/assets/xsl/utilities/deprecate-autoname.sed +18 -18
  86. package/assets/xsl/utilities/deprecate-index.sed +33 -33
  87. package/assets/xsl/utilities/fix-deprecations.xsl +663 -663
  88. package/assets/xsl/utilities/pretext-enhanced-source.xsl +112 -112
  89. package/assets/xsl/utilities/report-publisher-variables.xsl +162 -162
  90. package/assets/xsl/xml-to-json.xsl +326 -326
  91. package/assets/xsl/xml-to-string.xsl +328 -328
  92. package/assets/xsl-bundle.json +1 -0
  93. package/dist/{cli-C6tfAVvi.js → cli-B2LiKunq.js} +268 -233
  94. package/dist/cli.js +1 -1
  95. package/dist/host.browser.d.ts +29 -0
  96. package/dist/host.d.ts +41 -0
  97. package/dist/index.browser.d.ts +29 -0
  98. package/dist/index.browser.js +650 -0
  99. package/dist/index.d.ts +5 -0
  100. package/dist/index.js +16 -8
  101. package/dist/internal/posix-path.d.ts +59 -0
  102. package/dist/mounts.d.ts +18 -0
  103. package/dist/renderer.d.ts +14 -1
  104. package/dist/theme.d.ts +68 -0
  105. package/dist/theme.js +93 -0
  106. package/package.json +22 -4
@@ -1,317 +1,317 @@
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
- <!-- ################### -->
40
- <!-- Titles of Divisions -->
41
- <!-- ################### -->
42
-
43
- <xsl:template name="titlesec-chapter-style">
44
- <!-- should be a global style definitions -->
45
- <!-- MOVE ME!!!!!!!!!!!!!!!!!!!!!! -->
46
- <xsl:text>\usepackage[geometry]{ifsym} %to get nice triangles&#xa;</xsl:text>
47
- <!-- MOVE ME!!!!!!!!!!!!!!!!!!!!!! -->
48
- <xsl:text>\tikzset{weird fill/.style={append after command={
49
- \pgfextra
50
- \draw[sharp corners, fill=#1]%
51
- (\tikzlastnode.west)%
52
- [rounded corners=0pt] |- (\tikzlastnode.north)%
53
- [rounded corners=5pt] -| (\tikzlastnode.east)%
54
- [rounded corners=0pt] |- (\tikzlastnode.south)%
55
- [rounded corners=5pt] -| (\tikzlastnode.west)%
56
- ;
57
- \endpgfextra}}}&#xa;</xsl:text>
58
- <!-- NB: #1 used in chapter/numberless because we -->
59
- <!-- can't control the Table of Contents anyway other -->
60
- <!-- than redefining the actual name used elsewhere -->
61
- <xsl:text>\titleformat{name=\chapter}
62
- {\normalfont}
63
- {}
64
- {8pt}
65
- {
66
- \begin{center}\begin{tikzpicture}
67
- \draw node[
68
- inner sep=10pt, inner ysep=20pt, very thick,
69
- weird fill=Green, text=white, minimum width={0.9\textwidth},
70
- text width={0.9\textwidth}, align=center
71
- ](b) {\scshape\huge\filcenter\titleptx};
72
- \node[right=10pt, rounded corners=0pt, draw, fill=white] at (b.north west)
73
- {\divisionnameptx\space\thechapter};
74
- \end{tikzpicture}\end{center}
75
- }
76
- [\hfill{\Large\authorsptx}]
77
- %%
78
- \titleformat{name=\chapter,numberless}
79
- {\normalfont}
80
- {}
81
- {8pt}
82
- {
83
- \begin{center}\begin{tikzpicture}
84
- \draw node[
85
- inner sep=10pt, inner ysep=20pt, very thick,
86
- weird fill=Green, text=white, minimum width={0.9\textwidth},
87
- text width={0.9\textwidth}, align=center
88
- ](b) {\scshape\huge\filcenter#1};
89
- \end{tikzpicture}\end{center}
90
- }&#xa;</xsl:text>
91
- <!-- \begin{flushright}\epigraphptx\end{flushright} -->
92
- </xsl:template>
93
-
94
- <xsl:template name="titlesec-section-style">
95
- <xsl:text>\titleformat{\section}
96
- {\titlerule
97
- \vspace{.8ex}%
98
- \Large\bfseries}
99
- {\llap{\thesection}}{0.0em}{{\small\FilledSmallTriangleUp}\space\titleptx}
100
- [\hfill{\large\authorsptx}]&#xa;</xsl:text>
101
- <xsl:text>\titleformat{name=\section,numberless}
102
- {\titlerule
103
- \vspace{.8ex}%
104
- \Large\bfseries}
105
- {}{0.0em}{{\small\FilledSmallTriangleUp}\space#1}&#xa;</xsl:text>
106
- </xsl:template>
107
-
108
- <xsl:template name="titlesec-subsection-style">
109
- <xsl:text>\titleformat{\subsection}{\large\bfseries}
110
- {\llap{\thesubsection}}{0.0em}{ {\small\FilledSmallTriangleRight\!\!\!\FilledSmallTriangleRight}\space\titleptx}
111
- [\hfill{\normalsize\authorsptx}]&#xa;</xsl:text>
112
- </xsl:template>
113
-
114
- <xsl:template name="titlesec-subsubsection-style">
115
- <xsl:text>\titleformat{\subsubsection}{\bfseries}{\llap{\thesubsubsection}}{0.0em}{{\small\FilledSmallTriangleRight\!\!\!\FilledSmallTriangleRight\!\!\!\FilledSmallTriangleRight}\space\titleptx}
116
- [\hfill{\normalsize\authorsptx}]&#xa;</xsl:text>
117
- </xsl:template>
118
-
119
- <!-- "abbr", "acro", "init" -->
120
- <!-- Simply wild colors, for effect -->
121
- <!-- Opposite of "red" (?) -->
122
- <xsl:template match="abbr" mode="tex-macro-style">
123
- <xsl:text>\textcolor{-red}{#1}</xsl:text>
124
- </xsl:template>
125
- <!-- A "dvipsnames" color -->
126
- <xsl:template match="acro" mode="tex-macro-style">
127
- <xsl:text>\textcolor{JungleGreen}{#1}</xsl:text>
128
- </xsl:template>
129
- <!-- A "svgnames" color -->
130
- <xsl:template match="init" mode="tex-macro-style">
131
- <xsl:text>\textcolor{LightCoral}{#1}</xsl:text>
132
- </xsl:template>
133
-
134
- <!-- "proof" -->
135
- <!-- Changes: Bold upright font, abnormally large spacing after title, no tombstone. -->
136
- <!-- bwminimalstyle is part of the mathbook-latex.xsl file, uncertain -->
137
- <!-- if we are committed to making it universally available to be used -->
138
- <!-- like this by style writers. -->
139
- <xsl:template match="proof" mode="tcb-style">
140
- <xsl:text>bwminimalstyle, fonttitle=\normalfont\bfseries, attach title to upper, after title={\qquad}&#xa;</xsl:text>
141
- </xsl:template>
142
-
143
- <!-- "objectives", "outcomes", etc -->
144
- <!-- Green and ugly, plus identical, via the entity match -->
145
- <xsl:template match="&GOAL-LIKE;" mode="tcb-style">
146
- <xsl:text>size=minimal, attach title to upper, after title={\space}, fonttitle=\bfseries, coltitle=black, colback=green</xsl:text>
147
- </xsl:template>
148
-
149
- <!-- THEOREM-LIKE: "theorem", "corollary", "lemma", -->
150
- <!-- "algorithm", "proposition", -->
151
- <!-- "claim", "fact", "identity" -->
152
- <!-- AXIOM-LIKE: "axiom", "conjecture", "principle", -->
153
- <!-- "heuristic", "hypothesis", -->
154
- <!-- "assumption -->
155
- <!-- A "skin" example from the tcolorbox documentation -->
156
- <!-- Documentation suggests "title engine=path" -->
157
- <!-- is necessary, but it seems to not be -->
158
- <xsl:template match="&THEOREM-LIKE;|&AXIOM-LIKE;" mode="tcb-style">
159
- <xsl:text>enhanced, title engine=path, colback=red!5!white,&#xa;</xsl:text>
160
- <xsl:text>colframe=red!75!black, coltitle=blue!50!black,fonttitle=\bfseries,&#xa;</xsl:text>
161
- <xsl:text>title style={left color=blue!15!yellow, right color=red!85!black}, </xsl:text>
162
- </xsl:template>
163
-
164
- <!-- DEFINITION-LIKE: "definition" -->
165
- <!-- Various extreme choices from the tcolorbox documentation -->
166
- <!-- Note: a trailing comma is OK, and maybe a good idea -->
167
- <!-- Note: the style definition may split across several line -->
168
- <!-- of the LaTeX source using the hex A (dec 10) character -->
169
- <!-- Note: "enhanced" is necessary for boxed titles -->
170
- <xsl:template match="&DEFINITION-LIKE;" mode="tcb-style">
171
- <xsl:text>enhanced, arc=4mm,outer arc=1mm,colback=pink,&#xa;</xsl:text>
172
- <xsl:text>attach boxed title to top center={yshift=-\tcboxedtitleheight/2},&#xa;</xsl:text>
173
- <xsl:text>boxed title style={size=small,colback=blue},&#xa;</xsl:text>
174
- </xsl:template>
175
-
176
- <!-- REMARK-LIKE: "remark", "convention", "note", -->
177
- <!-- "observation", "warning", "insight" -->
178
- <!-- COMPUTATION-LIKE: "computation", "technology" -->
179
- <!--White title text, but title backgounds vary -->
180
- <!--by category, and remarks have sharp corners -->
181
- <xsl:template match="&REMARK-LIKE;" mode="tcb-style">
182
- <xsl:text>colbacktitle=red, sharp corners</xsl:text>
183
- </xsl:template>
184
- <xsl:template match="&COMPUTATION-LIKE;" mode="tcb-style">
185
- <xsl:text>colbacktitle=blue</xsl:text>
186
- </xsl:template>
187
-
188
- <!-- EXAMPLE-LIKE: "example", "question", "problem" -->
189
- <!-- Default tcolorbox, but with tricolor titles -->
190
- <!-- Each just slightly different -->
191
- <xsl:template match="example" mode="tcb-style">
192
- <xsl:text>coltitle=red</xsl:text>
193
- </xsl:template>
194
- <xsl:template match="question" mode="tcb-style">
195
- <xsl:text>coltitle=blue</xsl:text>
196
- </xsl:template>
197
- <xsl:template match="problem" mode="tcb-style">
198
- <xsl:text>coltitle=yellow</xsl:text>
199
- </xsl:template>
200
-
201
- <!-- PROJECT-LIKE: "activity", "exploration", -->
202
- <!-- "exploration", "investigation" -->
203
- <!-- This from the tcolorbox documentation of -->
204
- <!-- the "tcbinvclipframe" documentation -->
205
- <xsl:template match="&PROJECT-LIKE;" mode="tcb-style">
206
- <xsl:text>enhanced jigsaw,fonttitle=\bfseries,opacityback=0.35,colback=blue!5!white,</xsl:text>
207
- <xsl:text>frame style={left color=red!75!black,right color=red!10!yellow},</xsl:text>
208
- <xsl:text>overlay={\begin{tcbinvclipframe}</xsl:text>
209
- <xsl:text>\draw[red,line width=1cm] ([xshift=-2mm,yshift=2mm]frame.north west)</xsl:text>
210
- <xsl:text>--([xshift=2mm,yshift=-2mm]frame.south east);</xsl:text>
211
- <xsl:text>\draw[red,line width=1cm] ([xshift=-2mm,yshift=-2mm]frame.south west)</xsl:text>
212
- <xsl:text>--([xshift=2mm,yshift=2mm]frame.north east);</xsl:text>
213
- <xsl:text>\end{tcbinvclipframe}}</xsl:text>
214
- </xsl:template>
215
-
216
- <!-- "assemblage" -->
217
- <!-- Boxed title, borrowed from the AIM style -->
218
- <xsl:template match="assemblage" mode="tcb-style">
219
- <xsl:text>enhanced, arc=2ex, colback=blue!5, colframe=blue!75!black,&#xa;</xsl:text>
220
- <xsl:text>colbacktitle=blue!20, coltitle=black, boxed title style={sharp corners, frame hidden},&#xa;</xsl:text>
221
- <xsl:text>fonttitle=\bfseries, attach boxed title to top left={xshift=4mm,yshift=-3mm}, top=3mm,&#xa;</xsl:text>
222
- </xsl:template>
223
-
224
- <!-- ASIDE-LIKE: "aside", "historical", "biographical" -->
225
- <!-- Square, drop shadow, borrowed from the AIM style -->
226
- <xsl:template match="&ASIDE-LIKE;" mode="tcb-style">
227
- <xsl:text>enhanced, sharp corners, colback=blue!3, colframe=blue!50!black,&#xa;</xsl:text>
228
- <xsl:text>add to width=-1ex, shadow={1ex}{-1ex}{0ex}{black!50!white},&#xa;</xsl:text>
229
- <xsl:text>coltitle=black, fonttitle=\bfseries, attach title to upper, after title={\space},</xsl:text>
230
- </xsl:template>
231
-
232
- <!-- LaTeX uses four page styles, and we use the "titleps" package -->
233
- <!-- to redefine the "empty", "plain", and "headings" styles. The -->
234
- <!-- actual management of which style is used, and when, is -->
235
- <!-- controlled by LaTeX with help from PreTeXt. You can use the -->
236
- <!-- "titleps-global-style" template to change which style is the -->
237
- <!-- global default, optionally in concert with redefinitions of -->
238
- <!-- the style. -->
239
- <!-- -->
240
- <!-- We do limited demonstration with the head, and use the -->
241
- <!-- left-side of the foot to display information on which -->
242
- <!-- pagestyle is in effect, so you could experiment here before -->
243
- <!-- making your own style. -->
244
- <!-- -->
245
- <!-- Note: the templates will be placed after a "\renewpagestyle{}" -->
246
- <!-- command, so should be an optional argument, followed by a -->
247
- <!-- mandatory argument with commands like \setfoot, \sethead, -->
248
- <!-- \headrule, and \footrule. -->
249
- <!-- See titleps.pdf in the "titlesec" package for more -->
250
- <xsl:template match="book|article|letter|memo" mode="titleps-empty">
251
- <xsl:text>{
252
- \setfoot[foot/even/empty][][]
253
- {foot/odd or one-sided/empty}{}{}
254
- }</xsl:text>
255
- </xsl:template>
256
-
257
- <xsl:template match="book|article|letter|memo" mode="titleps-plain">
258
- <xsl:text>{
259
- \setfoot[foot/even/plain][\thepage][]
260
- {foot/odd or one-sided/plain}{\thepage}{}
261
- }</xsl:text>
262
- </xsl:template>
263
-
264
- <!-- This is based from Section 8 of "titleps.pdf" (2016-03-15) -->
265
- <!-- Modified to include \ifthechapter and \ifthesection -->
266
- <xsl:template match="book" mode="titleps-headings">
267
- <xsl:text>[\small\sffamily]{
268
- \sethead[\textbf{\thepage}]
269
- [\ifthechapter{\textsl{Chapter \thechapter: \chaptertitle}}{\textsl{\chaptertitle}}]
270
- [\ifthesection{\toptitlemarks\thesection--\bottitlemarks\thesection}{}]
271
- {\ifthesection{\toptitlemarks\thesection--\bottitlemarks\thesection}{}}
272
- {\ifthesection{\textsl{\sectiontitle}}{\chaptertitle}}
273
- {\textbf{\thepage}}
274
- \setfoot[foot/even/headings/book][][]
275
- {foot/odd or one-sided/headings/book}{}{}
276
- }</xsl:text>
277
- </xsl:template>
278
-
279
- <xsl:template match="article|letter|memo" mode="titleps-headings">
280
- <xsl:text>[\small\sffamily]{
281
- \headrule
282
- \sethead[\thepage][\sectiontitle][]
283
- {}{\sectiontitle}{\thepage}
284
- \setfoot[foot/even/headings/article][][]
285
- {foot/odd or one-sided/headings/article}{}{}
286
- }</xsl:text>
287
- </xsl:template>
288
-
289
- <!-- Experiment with "empty", "plain", and "headings" to -->
290
- <!-- see the effect of the above definitions (for "article") -->
291
- <!-- employed in the sample article -->
292
- <!-- DO NOT set this to return empty text, errors will result -->
293
- <!-- You can comment it out, and let base definition execute -->
294
- <xsl:template match="article" mode="titleps-global-style">
295
- <xsl:text>plain</xsl:text>
296
- </xsl:template>
297
-
298
- <!-- The Iwona font is just chosen from the LaTeX Font -->
299
- <!-- Catalogue as a font with math support. It is an -->
300
- <!-- alternative to the Kurier fonts and part of the -->
301
- <!-- GUST font project. -->
302
- <!-- http://www.gust.org.pl/projects/e-foundry/kurier-iwona -->
303
- <!-- -->
304
- <!-- Seems to be missing U+0060, "accent grave" -->
305
- <!-- Seems to be missing U+00B4, "accent acute" -->
306
- <!-- Seems to be missing superior numbers (1, 2, 3) -->
307
- <xsl:template name="font-pdflatex-main">
308
- <xsl:text>\usepackage[math]{iwona}&#xa;</xsl:text>
309
- <xsl:text>\usepackage[T1]{fontenc}&#xa;</xsl:text>
310
- </xsl:template>
311
-
312
- <!-- Iwona does not seem to have a monospace/typewriter face. -->
313
- <!-- Just as an illustration, we override the use of the Inconsolata -->
314
- <!-- font, so we probably get the default Computer Modern version. -->
315
- <xsl:template name="font-pdflatex-mono"/>
316
-
317
- </xsl:stylesheet>
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
+ <!-- ################### -->
40
+ <!-- Titles of Divisions -->
41
+ <!-- ################### -->
42
+
43
+ <xsl:template name="titlesec-chapter-style">
44
+ <!-- should be a global style definitions -->
45
+ <!-- MOVE ME!!!!!!!!!!!!!!!!!!!!!! -->
46
+ <xsl:text>\usepackage[geometry]{ifsym} %to get nice triangles&#xa;</xsl:text>
47
+ <!-- MOVE ME!!!!!!!!!!!!!!!!!!!!!! -->
48
+ <xsl:text>\tikzset{weird fill/.style={append after command={
49
+ \pgfextra
50
+ \draw[sharp corners, fill=#1]%
51
+ (\tikzlastnode.west)%
52
+ [rounded corners=0pt] |- (\tikzlastnode.north)%
53
+ [rounded corners=5pt] -| (\tikzlastnode.east)%
54
+ [rounded corners=0pt] |- (\tikzlastnode.south)%
55
+ [rounded corners=5pt] -| (\tikzlastnode.west)%
56
+ ;
57
+ \endpgfextra}}}&#xa;</xsl:text>
58
+ <!-- NB: #1 used in chapter/numberless because we -->
59
+ <!-- can't control the Table of Contents anyway other -->
60
+ <!-- than redefining the actual name used elsewhere -->
61
+ <xsl:text>\titleformat{name=\chapter}
62
+ {\normalfont}
63
+ {}
64
+ {8pt}
65
+ {
66
+ \begin{center}\begin{tikzpicture}
67
+ \draw node[
68
+ inner sep=10pt, inner ysep=20pt, very thick,
69
+ weird fill=Green, text=white, minimum width={0.9\textwidth},
70
+ text width={0.9\textwidth}, align=center
71
+ ](b) {\scshape\huge\filcenter\titleptx};
72
+ \node[right=10pt, rounded corners=0pt, draw, fill=white] at (b.north west)
73
+ {\divisionnameptx\space\thechapter};
74
+ \end{tikzpicture}\end{center}
75
+ }
76
+ [\hfill{\Large\authorsptx}]
77
+ %%
78
+ \titleformat{name=\chapter,numberless}
79
+ {\normalfont}
80
+ {}
81
+ {8pt}
82
+ {
83
+ \begin{center}\begin{tikzpicture}
84
+ \draw node[
85
+ inner sep=10pt, inner ysep=20pt, very thick,
86
+ weird fill=Green, text=white, minimum width={0.9\textwidth},
87
+ text width={0.9\textwidth}, align=center
88
+ ](b) {\scshape\huge\filcenter#1};
89
+ \end{tikzpicture}\end{center}
90
+ }&#xa;</xsl:text>
91
+ <!-- \begin{flushright}\epigraphptx\end{flushright} -->
92
+ </xsl:template>
93
+
94
+ <xsl:template name="titlesec-section-style">
95
+ <xsl:text>\titleformat{\section}
96
+ {\titlerule
97
+ \vspace{.8ex}%
98
+ \Large\bfseries}
99
+ {\llap{\thesection}}{0.0em}{{\small\FilledSmallTriangleUp}\space\titleptx}
100
+ [\hfill{\large\authorsptx}]&#xa;</xsl:text>
101
+ <xsl:text>\titleformat{name=\section,numberless}
102
+ {\titlerule
103
+ \vspace{.8ex}%
104
+ \Large\bfseries}
105
+ {}{0.0em}{{\small\FilledSmallTriangleUp}\space#1}&#xa;</xsl:text>
106
+ </xsl:template>
107
+
108
+ <xsl:template name="titlesec-subsection-style">
109
+ <xsl:text>\titleformat{\subsection}{\large\bfseries}
110
+ {\llap{\thesubsection}}{0.0em}{ {\small\FilledSmallTriangleRight\!\!\!\FilledSmallTriangleRight}\space\titleptx}
111
+ [\hfill{\normalsize\authorsptx}]&#xa;</xsl:text>
112
+ </xsl:template>
113
+
114
+ <xsl:template name="titlesec-subsubsection-style">
115
+ <xsl:text>\titleformat{\subsubsection}{\bfseries}{\llap{\thesubsubsection}}{0.0em}{{\small\FilledSmallTriangleRight\!\!\!\FilledSmallTriangleRight\!\!\!\FilledSmallTriangleRight}\space\titleptx}
116
+ [\hfill{\normalsize\authorsptx}]&#xa;</xsl:text>
117
+ </xsl:template>
118
+
119
+ <!-- "abbr", "acro", "init" -->
120
+ <!-- Simply wild colors, for effect -->
121
+ <!-- Opposite of "red" (?) -->
122
+ <xsl:template match="abbr" mode="tex-macro-style">
123
+ <xsl:text>\textcolor{-red}{#1}</xsl:text>
124
+ </xsl:template>
125
+ <!-- A "dvipsnames" color -->
126
+ <xsl:template match="acro" mode="tex-macro-style">
127
+ <xsl:text>\textcolor{JungleGreen}{#1}</xsl:text>
128
+ </xsl:template>
129
+ <!-- A "svgnames" color -->
130
+ <xsl:template match="init" mode="tex-macro-style">
131
+ <xsl:text>\textcolor{LightCoral}{#1}</xsl:text>
132
+ </xsl:template>
133
+
134
+ <!-- "proof" -->
135
+ <!-- Changes: Bold upright font, abnormally large spacing after title, no tombstone. -->
136
+ <!-- bwminimalstyle is part of the mathbook-latex.xsl file, uncertain -->
137
+ <!-- if we are committed to making it universally available to be used -->
138
+ <!-- like this by style writers. -->
139
+ <xsl:template match="proof" mode="tcb-style">
140
+ <xsl:text>bwminimalstyle, fonttitle=\normalfont\bfseries, attach title to upper, after title={\qquad}&#xa;</xsl:text>
141
+ </xsl:template>
142
+
143
+ <!-- "objectives", "outcomes", etc -->
144
+ <!-- Green and ugly, plus identical, via the entity match -->
145
+ <xsl:template match="&GOAL-LIKE;" mode="tcb-style">
146
+ <xsl:text>size=minimal, attach title to upper, after title={\space}, fonttitle=\bfseries, coltitle=black, colback=green</xsl:text>
147
+ </xsl:template>
148
+
149
+ <!-- THEOREM-LIKE: "theorem", "corollary", "lemma", -->
150
+ <!-- "algorithm", "proposition", -->
151
+ <!-- "claim", "fact", "identity" -->
152
+ <!-- AXIOM-LIKE: "axiom", "conjecture", "principle", -->
153
+ <!-- "heuristic", "hypothesis", -->
154
+ <!-- "assumption -->
155
+ <!-- A "skin" example from the tcolorbox documentation -->
156
+ <!-- Documentation suggests "title engine=path" -->
157
+ <!-- is necessary, but it seems to not be -->
158
+ <xsl:template match="&THEOREM-LIKE;|&AXIOM-LIKE;" mode="tcb-style">
159
+ <xsl:text>enhanced, title engine=path, colback=red!5!white,&#xa;</xsl:text>
160
+ <xsl:text>colframe=red!75!black, coltitle=blue!50!black,fonttitle=\bfseries,&#xa;</xsl:text>
161
+ <xsl:text>title style={left color=blue!15!yellow, right color=red!85!black}, </xsl:text>
162
+ </xsl:template>
163
+
164
+ <!-- DEFINITION-LIKE: "definition" -->
165
+ <!-- Various extreme choices from the tcolorbox documentation -->
166
+ <!-- Note: a trailing comma is OK, and maybe a good idea -->
167
+ <!-- Note: the style definition may split across several line -->
168
+ <!-- of the LaTeX source using the hex A (dec 10) character -->
169
+ <!-- Note: "enhanced" is necessary for boxed titles -->
170
+ <xsl:template match="&DEFINITION-LIKE;" mode="tcb-style">
171
+ <xsl:text>enhanced, arc=4mm,outer arc=1mm,colback=pink,&#xa;</xsl:text>
172
+ <xsl:text>attach boxed title to top center={yshift=-\tcboxedtitleheight/2},&#xa;</xsl:text>
173
+ <xsl:text>boxed title style={size=small,colback=blue},&#xa;</xsl:text>
174
+ </xsl:template>
175
+
176
+ <!-- REMARK-LIKE: "remark", "convention", "note", -->
177
+ <!-- "observation", "warning", "insight" -->
178
+ <!-- COMPUTATION-LIKE: "computation", "technology" -->
179
+ <!--White title text, but title backgounds vary -->
180
+ <!--by category, and remarks have sharp corners -->
181
+ <xsl:template match="&REMARK-LIKE;" mode="tcb-style">
182
+ <xsl:text>colbacktitle=red, sharp corners</xsl:text>
183
+ </xsl:template>
184
+ <xsl:template match="&COMPUTATION-LIKE;" mode="tcb-style">
185
+ <xsl:text>colbacktitle=blue</xsl:text>
186
+ </xsl:template>
187
+
188
+ <!-- EXAMPLE-LIKE: "example", "question", "problem" -->
189
+ <!-- Default tcolorbox, but with tricolor titles -->
190
+ <!-- Each just slightly different -->
191
+ <xsl:template match="example" mode="tcb-style">
192
+ <xsl:text>coltitle=red</xsl:text>
193
+ </xsl:template>
194
+ <xsl:template match="question" mode="tcb-style">
195
+ <xsl:text>coltitle=blue</xsl:text>
196
+ </xsl:template>
197
+ <xsl:template match="problem" mode="tcb-style">
198
+ <xsl:text>coltitle=yellow</xsl:text>
199
+ </xsl:template>
200
+
201
+ <!-- PROJECT-LIKE: "activity", "exploration", -->
202
+ <!-- "exploration", "investigation" -->
203
+ <!-- This from the tcolorbox documentation of -->
204
+ <!-- the "tcbinvclipframe" documentation -->
205
+ <xsl:template match="&PROJECT-LIKE;" mode="tcb-style">
206
+ <xsl:text>enhanced jigsaw,fonttitle=\bfseries,opacityback=0.35,colback=blue!5!white,</xsl:text>
207
+ <xsl:text>frame style={left color=red!75!black,right color=red!10!yellow},</xsl:text>
208
+ <xsl:text>overlay={\begin{tcbinvclipframe}</xsl:text>
209
+ <xsl:text>\draw[red,line width=1cm] ([xshift=-2mm,yshift=2mm]frame.north west)</xsl:text>
210
+ <xsl:text>--([xshift=2mm,yshift=-2mm]frame.south east);</xsl:text>
211
+ <xsl:text>\draw[red,line width=1cm] ([xshift=-2mm,yshift=-2mm]frame.south west)</xsl:text>
212
+ <xsl:text>--([xshift=2mm,yshift=2mm]frame.north east);</xsl:text>
213
+ <xsl:text>\end{tcbinvclipframe}}</xsl:text>
214
+ </xsl:template>
215
+
216
+ <!-- "assemblage" -->
217
+ <!-- Boxed title, borrowed from the AIM style -->
218
+ <xsl:template match="assemblage" mode="tcb-style">
219
+ <xsl:text>enhanced, arc=2ex, colback=blue!5, colframe=blue!75!black,&#xa;</xsl:text>
220
+ <xsl:text>colbacktitle=blue!20, coltitle=black, boxed title style={sharp corners, frame hidden},&#xa;</xsl:text>
221
+ <xsl:text>fonttitle=\bfseries, attach boxed title to top left={xshift=4mm,yshift=-3mm}, top=3mm,&#xa;</xsl:text>
222
+ </xsl:template>
223
+
224
+ <!-- ASIDE-LIKE: "aside", "historical", "biographical" -->
225
+ <!-- Square, drop shadow, borrowed from the AIM style -->
226
+ <xsl:template match="&ASIDE-LIKE;" mode="tcb-style">
227
+ <xsl:text>enhanced, sharp corners, colback=blue!3, colframe=blue!50!black,&#xa;</xsl:text>
228
+ <xsl:text>add to width=-1ex, shadow={1ex}{-1ex}{0ex}{black!50!white},&#xa;</xsl:text>
229
+ <xsl:text>coltitle=black, fonttitle=\bfseries, attach title to upper, after title={\space},</xsl:text>
230
+ </xsl:template>
231
+
232
+ <!-- LaTeX uses four page styles, and we use the "titleps" package -->
233
+ <!-- to redefine the "empty", "plain", and "headings" styles. The -->
234
+ <!-- actual management of which style is used, and when, is -->
235
+ <!-- controlled by LaTeX with help from PreTeXt. You can use the -->
236
+ <!-- "titleps-global-style" template to change which style is the -->
237
+ <!-- global default, optionally in concert with redefinitions of -->
238
+ <!-- the style. -->
239
+ <!-- -->
240
+ <!-- We do limited demonstration with the head, and use the -->
241
+ <!-- left-side of the foot to display information on which -->
242
+ <!-- pagestyle is in effect, so you could experiment here before -->
243
+ <!-- making your own style. -->
244
+ <!-- -->
245
+ <!-- Note: the templates will be placed after a "\renewpagestyle{}" -->
246
+ <!-- command, so should be an optional argument, followed by a -->
247
+ <!-- mandatory argument with commands like \setfoot, \sethead, -->
248
+ <!-- \headrule, and \footrule. -->
249
+ <!-- See titleps.pdf in the "titlesec" package for more -->
250
+ <xsl:template match="book|article|letter|memo" mode="titleps-empty">
251
+ <xsl:text>{
252
+ \setfoot[foot/even/empty][][]
253
+ {foot/odd or one-sided/empty}{}{}
254
+ }</xsl:text>
255
+ </xsl:template>
256
+
257
+ <xsl:template match="book|article|letter|memo" mode="titleps-plain">
258
+ <xsl:text>{
259
+ \setfoot[foot/even/plain][\thepage][]
260
+ {foot/odd or one-sided/plain}{\thepage}{}
261
+ }</xsl:text>
262
+ </xsl:template>
263
+
264
+ <!-- This is based from Section 8 of "titleps.pdf" (2016-03-15) -->
265
+ <!-- Modified to include \ifthechapter and \ifthesection -->
266
+ <xsl:template match="book" mode="titleps-headings">
267
+ <xsl:text>[\small\sffamily]{
268
+ \sethead[\textbf{\thepage}]
269
+ [\ifthechapter{\textsl{Chapter \thechapter: \chaptertitle}}{\textsl{\chaptertitle}}]
270
+ [\ifthesection{\toptitlemarks\thesection--\bottitlemarks\thesection}{}]
271
+ {\ifthesection{\toptitlemarks\thesection--\bottitlemarks\thesection}{}}
272
+ {\ifthesection{\textsl{\sectiontitle}}{\chaptertitle}}
273
+ {\textbf{\thepage}}
274
+ \setfoot[foot/even/headings/book][][]
275
+ {foot/odd or one-sided/headings/book}{}{}
276
+ }</xsl:text>
277
+ </xsl:template>
278
+
279
+ <xsl:template match="article|letter|memo" mode="titleps-headings">
280
+ <xsl:text>[\small\sffamily]{
281
+ \headrule
282
+ \sethead[\thepage][\sectiontitle][]
283
+ {}{\sectiontitle}{\thepage}
284
+ \setfoot[foot/even/headings/article][][]
285
+ {foot/odd or one-sided/headings/article}{}{}
286
+ }</xsl:text>
287
+ </xsl:template>
288
+
289
+ <!-- Experiment with "empty", "plain", and "headings" to -->
290
+ <!-- see the effect of the above definitions (for "article") -->
291
+ <!-- employed in the sample article -->
292
+ <!-- DO NOT set this to return empty text, errors will result -->
293
+ <!-- You can comment it out, and let base definition execute -->
294
+ <xsl:template match="article" mode="titleps-global-style">
295
+ <xsl:text>plain</xsl:text>
296
+ </xsl:template>
297
+
298
+ <!-- The Iwona font is just chosen from the LaTeX Font -->
299
+ <!-- Catalogue as a font with math support. It is an -->
300
+ <!-- alternative to the Kurier fonts and part of the -->
301
+ <!-- GUST font project. -->
302
+ <!-- http://www.gust.org.pl/projects/e-foundry/kurier-iwona -->
303
+ <!-- -->
304
+ <!-- Seems to be missing U+0060, "accent grave" -->
305
+ <!-- Seems to be missing U+00B4, "accent acute" -->
306
+ <!-- Seems to be missing superior numbers (1, 2, 3) -->
307
+ <xsl:template name="font-pdflatex-main">
308
+ <xsl:text>\usepackage[math]{iwona}&#xa;</xsl:text>
309
+ <xsl:text>\usepackage[T1]{fontenc}&#xa;</xsl:text>
310
+ </xsl:template>
311
+
312
+ <!-- Iwona does not seem to have a monospace/typewriter face. -->
313
+ <!-- Just as an illustration, we override the use of the Inconsolata -->
314
+ <!-- font, so we probably get the default Computer Modern version. -->
315
+ <xsl:template name="font-pdflatex-mono"/>
316
+
317
+ </xsl:stylesheet>