-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmake4ht_preamble.cfg
More file actions
41 lines (32 loc) · 1.46 KB
/
make4ht_preamble.cfg
File metadata and controls
41 lines (32 loc) · 1.46 KB
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
\Preamble{xhtml,mathjax}
% Capture algorithm environments in a Picture, which should save as SVG
\ConfigureEnv{algorithm}{\Picture*{}}{\EndPicture}{}{}
\Configure{Picture}{.svg}
% Convert double dollar math mode to \[ ... \] because $$ causes SVG output instead of
% the usual MathJax. This is temporary: https://tex.stackexchange.com/questions/661265
\catcode`\:=11
\Configure{$$}{\:HandleMathjaxCatcodes}{\:RestoreMathjaxCatcodes}{\expandafter\AltlDisplayDollars}
\long\def\AltlDisplayDollars#1$${\alteqtoks{\[#1\]}$$}
\catcode`\:=12
% Redefine \quad for non-math mode to preserve it better
\let\originalquad\quad
\renewcommand{\quad}{
\ifmmode % If in math mode, use the original definition
\originalquad
\else % Otherwise, redefine as 2em hspace that make4ht preserves as nbsp+nbsp
\hspace{2em}
\fi
}
\begin{document}
\providecommand{\checkmark}{}
\renewcommand{\checkmark}{\HCode{✓}}
\providecommand{\eqref}{}
\renewcommand\eqref[1]{\NoFonts\HChar{92}eqref\{\detokenize{#1}\}\EndNoFonts}
\providecommand{\adjustbox}{}
\renewcommand{\adjustbox}[2][]{#2}
% Redefine paragraph/subparagraph commands that seem completely ignored
\providecommand{\paragraph}{}
\renewcommand\paragraph[1]{\ifvmode\IgnorePar\fi\EndP\HCode{<span class="paragraph">}\NoFonts#1\EndNoFonts\HCode{</span>}\par}
\providecommand{\subparagraph}{}
\renewcommand\subparagraph[1]{\ifvmode\IgnorePar\fi\EndP\HCode{<span class="subparagraph">}\NoFonts#1\EndNoFonts\HCode{</span>}\par}
\EndPreamble