-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathximera.cfg
185 lines (163 loc) · 6.83 KB
/
ximera.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
%%
%% This is file `ximera.cfg',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ximera.dtx (with options: `cfgXimera')
%% src/pagesetup.dtx (with options: `cfgXimera')
%% src/packages.dtx (with options: `cfgXimera')
%% src/jax.dtx (with options: `cfgXimera')
%% src/sectioning.dtx (with options: `cfgXimera')
%% src/title.dtx (with options: `cfgXimera')
%% src/abstract.dtx (with options: `cfgXimera')
%% src/image.dtx (with options: `cfgXimera')
%% src/outcomes.dtx (with options: `cfgXimera')
%% src/textcolor.dtx (with options: `cfgXimera')
%% src/verbatim.dtx (with options: `cfgXimera')
%% src/html.dtx (with options: `cfgXimera')
%% src/ending.dtx (with options: `cfgXimera')
%% ------------:| ------------------------------------------------------------
%% ximera:| Simultaneously writing print and online interactive materials
%% Author:| Jim Fowler and Oscar Levin and Jason Nowell and Wim Obbels and Hans Parshall and Bart Snapp
%% E-mail:| [email protected]
%% License:| Released under the LaTeX Project Public License v1.3c or later
%% See:| http://www.latex-project.org/lppl.txt
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Preamble{xhtml}
\NoFonts
\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!doctype html>\Hnewline}}
\Configure{HTML}{\HCode{<html lang="en">\Hnewline}}{\HCode{\Hnewline</html>}}
\Configure{@HEAD}{\HCode{<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/\string~gurari/TeX4ht/)" />\Hnewline}}
\Configure{@HEAD}{\HCode{<meta name="ximera" content="version 0.0.1" />\Hnewline}}
\Configure{@HEAD}{\HCode{<link href="https://ximera.osu.edu/public/stylesheets/standalone.css" rel="stylesheet" media="screen"/>\Hnewline}}
\Configure{@HEAD}{\HCode{<script type="text/javascript" async src="https://ximera.osu.edu/public/javascripts/standalone.min.js"></script>\Hnewline}}
\immediate\write18{sed -i "/@/d" \jobname.jax}
\immediate\write18{sed -i "s/\string#\string#\string\\([0-9]\string\\)/\string#\string\\1/g" \jobname.jax}
\Configure{BVerbatimInput}{}{}{}{}
\Configure{verbatiminput}{}{}{}{}
\makeatletter
\def\FV@Space{\space}
\makeatother
\Configure{BODY}{%
\HCode{<body>\Hnewline}%
\Tg<div class="preamble">%
\Tg<script type="math/tex">%
\BVerbatimInput{\jobname.jax}%
\Tg</script>%
\IfFileExists{\jobname.ids}{\HCode{<script type="text/javascript">\Hnewline}%
\BVerbatimInput{\jobname.ids}%
\HCode{</script>\Hnewline}%
\Tg</div>%
}{}
}{%
\HCode{</body>\Hnewline}%
}
\newtoks\eqtoks
\def\AltMath#1${\eqtoks{#1}%
\HCode{<script type="math/tex">\the\eqtoks</script>}$}
\Configure{$}{}{}{\expandafter\AltMath}
\def\AltlMathI#1\){\eqtoks{#1}%
\HCode{<script type="math/tex">\the\eqtoks</script>}\)}
\Configure{()}{\AltlMathI}{}
\def\AltlDisplay#1\]{\eqtoks{#1}%
\HCode{<script type="math/tex; mode=display">\the\eqtoks</script>}\]}
\Configure{[]}{\AltlDisplay}{}
\def\AltlDisplayI#1$${\eqtoks{#1}%
\HCode{<script type="math/tex; mode=display">\the\eqtoks</script>}$$}
\Configure{$$}{}{}{\expandafter\AltlDisplayI}
\newcommand\VerbMath[1]{%
\renewenvironment{#1}{\NoFonts}{\EndNoFonts}
\ScriptEnv{#1}{\ifvmode \IgnorePar\fi \EndP\HCode{<script type="math/tex; mode=display"> \string\begin{#1}\Hnewline}\HtmlParOff}{\HtmlParOn\HCode{\string\end{#1}</script>}}
}
\ScriptEnv{matlabEquation}{\ifvmode \IgnorePar\fi \EndP\HCode{<script type="math/tex; mode=display"> \string\begin{equation}\Hnewline}\HtmlParOff}{\HtmlParOn\HCode{\string\end{equation}</script>}}
\VerbMath{equation}
\VerbMath{equation*}
\VerbMath{align}
\VerbMath{align*}
\VerbMath{alignat}
\VerbMath{alignat*}
\VerbMath{eqnarray}
\VerbMath{eqnarray*}
\renewcommand{\paragraph}[1]{%
\HCode{<span class="paragraphHead">}%
#1%
\HCode{</span>}\par\IgnorePar}
\renewcommand{\subparagraph}[1]{%
\HCode{<span class="subparagraphHead">}%
#1%
\HCode{</span>}\par\IgnorePar}
\let\abstract\relax
\let\endabstract\relax
\DeclareGraphicsExtensions{.jpg,.png,.gif,.svg}
\Configure{graphics*}
{svg}{
{\Configure{Needs}{File: \[email protected]}\Needs{}}
\Picture[]{\csname Gin@base\endcsname.svg \csname a:Gin-dim\endcsname}%
}
\ifcsname ifstandalone\endcsname
\ifstandalone
\renewcommand\includegraphics[2][]{}
\fi
\renewcommand{\outcome}[1]{
\Configure{@HEAD}{\HCode{<meta name="learning-outcome" content="#1"/>\Hnewline}}
}
\IfFileExists{\jobname.oc}{\input{\jobname.oc}}{}
\renewcommand{\outcome}[1]{%
\HCode{<span class="learning-outcome">#1</span>}
}
\makeatletter
\Configure{textcolor}{\HCode{<span style="color:\#\tsf@color;">}}{\HCode{</span>}}
\let\oldtextcolor\textcolor
\renewcommand\textcolor[2]{%
% we need to convert the current color to hexadecimal form usable in the style attribute
% the \tsf@color macro is used in the \Configure{textcolor} configuration to insert the
% CSS color
\extractcolorspec{#1}{\tsf@color}%
\expandafter\convertcolorspec\tsf@color{HTML}\tsf@color%
% call the original command
\oldtextcolor{#1}{#2}%
}%
\makeatother
\renewenvironment{javascriptCode}{\NoFonts}{\EndNoFonts}
\ScriptEnv{javascriptCode}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="javascript-code" id="javascript\arabic{identification}"><script type="text/text">}\HtmlParOff}{\HtmlParOn\HCode{\Hnewline</script></div>}}
\ConfigureEnv{verbatim}{\HCode{<pre>}}{\HCode{</pre>}}{}{}
\ConfigureEnv{lstlisting}{\HCode{<pre>}}{\HCode{</pre>}}{}{}
\Configure{textbf}{\ifvmode\ShowPar\fi\HCode{<strong>}}{\HCode{</strong>}}
\Configure{textit}{\ifvmode\ShowPar\fi\HCode{<em>}}{\HCode{</em>}}
\Configure{emph}{\ifvmode\ShowPar\fi\HCode{<em>}}{\HCode{</em>}}
\Configure{texttt}{\ifvmode\ShowPar\fi\HCode{<code>}}{\HCode{</code>}}
\begin{document}
\EndPreamble
%%
%% Copyright (C) 2024 by Bart Snapp <[email protected]> and Jim Fowler <[email protected]>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
%% version 1.3c of this license or (at your option) any later
%% version. The latest version of this license is in the file:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% This work is "maintained" (as per LPPL maintenance status) by
%% Bart Snapp. The source code can be found at:
%%
%% https://github.com/XimeraProject/ximeraLatex
%%
%% This work consists of the file ximera.dtx, the associated files
%% under src/, and a Makefile.
%%
%% Running "make" generates the derived files README, ximera.pdf, ximera.cls, xourse.cls.
%%
%% Running "make inst" installs the files in the user's TeX tree.
%%
%% Running "make install" installs the files in the local TeX tree.
%%
%%
%% End of file `ximera.cfg'.