% $Id: tex4ht-mathml.tex 1495 2024-03-21 16:39:31Z michal_h21 $$ % compile 3 times: latex tex4ht-mathltx % or xhlatex tex4ht-mathltx "html,3,sections+" % % Copyright 2009-2023 TeX Users Group % Copyright 1999-2009 Eitan M. Gurari % Released under LPPL 1.3c+. % See tex4ht-cpright.tex for license text. \ifx \HTML\UnDef \def\HTML{mathml,html-mml} \def\CONFIG{\jobname} \def\MAKETITLE{\author{Eitan M. Gurari}} \def\next{\input mktex4ht.4ht \endinput} \expandafter\next \fi \input{common-code} \input{common} \input{tex4ht-cpright} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Constructs} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{The equation Environment} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{LaTeX} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \let\A:equation|=\a:equation \let\B:equation|=\b:equation \let\C:equation|=\c:equation \Configure{equation} {\A:equation|} {\B:equation}{\C:equation} >>> \<<< \Configure{equation} {\IgnorePar|\EndP \HCode{
}\IgnorePar |} {\ifvmode \IgnorePar\fi\EndP\HCode{}} {\HCode{
}|} \Css{.equation td{text-align:center; vertical-align:middle; }} \Css{td.eq-no{ width:5\%; }} \Css{table.equation { width:100\%; } } >>> \<<< \Configure{$$} {\Configure{@math}{|% \mml:class="equation"}\IgnorePar\EndP\DviMath} {\EndDviMath\EndP} {\DisplayMathtrue}% >>> \<<< %\a:mathml display="block" >>> \<<< %\a:mathml display="inline" >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{AmsMath} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{equation} {\Configure{gather} {\HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \mml:class="equation"><\a:mathml mtr><\a:mathml mtd>}\IgnorePar } {\HCode{}} {} {} {\ifnum\HCol=2 \IgnorePar \HCode{<\a:mathml mtd>}\fi } {} }{}{} \Css{.equation-star td{text-align:center; vertical-align:middle; }} \Css{table.equation-star { width:100\%; } } >>> \<<< % pre 2000 \Configure{equation} {\ifvmode \IgnorePar\fi \EndP \HCode{
}% |% \IgnorePar } {\ifvmode \IgnorePar\fi\EndP \HCode{}} {\ifvmode \IgnorePar\fi\EndP \HCode{
}% \IgnoreIndent\par} \Configure{equation*} {\ifvmode \IgnorePar\fi \EndP \HCode{
}% |% \IgnorePar } {\ifvmode \IgnorePar\fi\EndP \HCode{
}% \IgnoreIndent\par} >>> \<<< % jan 2000 \Configure{equation} {\ifvmode \IgnorePar\fi \EndP \HCode{
}% |% \IgnorePar } {\ifvmode \IgnorePar\fi\EndP \HCode{}% } {\ifvmode \IgnorePar\fi\EndP \HCode{
}% \IgnoreIndent\par} \Configure{equation*} {\ifvmode \IgnorePar\fi \EndP \HCode{
}% |% \IgnorePar } {\ifvmode \IgnorePar\fi\EndP \HCode{
}% \IgnoreIndent\par} >>> \<<< % and here it should be | \Configure{equation} {\ifvmode \IgnorePar\fi\EndP \HCode{
}% |% |% | } {\ifvmode \IgnorePar\fi\EndP \HCode{}% } {\ifvmode \IgnorePar\fi\EndP \HCode{
}% \ShowPar\IgnoreIndent\par} \Configure{equation*} {\ifvmode \IgnorePar\fi\EndP \HCode{
}% |% |% } {\ifvmode \IgnorePar\fi\EndP \HCode{
}% \ShowPar\IgnoreIndent\par} >>> % <\a:mathml math\Hnewline % \csname a:math-xmlns\endcsname \Hnewline display="inline"> % \HCode{}% \<<< |% >>> Current AMSMath uses empty mathopen at the beginning of an equation, which results in missing markup for subsequent numbers and characters. We check for empty parameter, and don't execute configurations when it is empty. \<<< \def\eq:mathopen#1{\ifx\relax#1\relax\else\a:mathopen\fi\o:mathopen:{#1}} >>> \<<< \let\mathopen\eq:mathopen% >>> \<<< \Configure{gather} {\HCode{<\a:mathml mtable\Hnewline \mml:class="equation"><\a:mathml mtr><\a:mathml mtd>}\IgnorePar |} {\HCode{}} {} {} {\ifnum\HCol=2 \IgnorePar \HCode{<\a:mathml mtd>}\fi } {} >>> \<<< \Configure{$$}{}{}{}% \Configure{gather} {\Configure{$$} {\Configure{@math}{\mml:class="equation"}\IgnorePar\EndP\DviMath} {\EndDviMath\EndP}% {}% \IgnorePar }{}{}{}{}{} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{MathML} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% \section{Front Matters} %%%%%%%%%%%%%%%%% %%%%%%%%%%%%% \subsection{DTD} %%%%%%%%%%%%% \<<< \Configure{PROLOG}{VERSION,DOCTYPE,*XML-STYLESHEET} \:CheckOption{no-DOCTYPE} \if:Option \Configure{PROLOG}{VERSION,*XML-STYLESHEET} \fi >>> % \def\mathml:DOCTYPE{|} \<<< \:CheckOption{frames} \if:Option \Configure{frames-altDOCTYPE}{|} \else | \fi >>> \<<< \def\:temp{xhtml} \ifx \:DTD\:temp | \fi >>> % \<<< PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//|"\Hnewline "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" >>> \<<< \Configure{DOCTYPE}{\HCode {% >\Hnewline }} >>> \<<< \Configure{DOCTYPE} {\HCode{" \Hnewline "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">\Hnewline}} >>> DTD to be used. \begin{description} \item [http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd] Declares a FPI (Formal Public Identifier) ``-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN'' for XHTML+MathML. The DTD is problematic since it contains a processing instruction \verb!! with a colon in the name. XML parsers don't allow it when namespaces are enabled. It carries revision id `xhtml-1,v 1.1 2000/10/31 19:52:09 davidc Exp'. \item[http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd] Suggested by the MathML specification http://www.w3.org/TR/2003/REC-MathML2-20031021/appendixa.html. However, the DTD incorporates also SVG. It shows revision id `xhtml-math11-f.dtd,v 1.16 2003/11/04 13:14:35 davidc Exp' \item [others] See SVG specifications \end{description} The DTD a "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" is claimed: \<<< \expandafter \ifx \csname a:dtd-lang\endcsname\relax EN\else \csname a:dtd-lang\endcsname \fi >>> \<<< xmlns="http://www.w3.org/1999/xhtml" >>> %%%%%%%%%%%%% \subsection{???????????} %%%%%%%%%%%%% \<<< \ifx \a:mathml\:UnDef \NewConfigure{mathml}{1} \Configure{mathml}{} \fi \def\mml:class{\a:mathml class} >>> \<<< | | >>> \<\><<< \def\mml:prefix#1{% \Configure{mathop}{*}{<\a:mathml mo #1\Hnewline>}{}% {\Configure{mathop}{*}{<\a:mathml mo>}{}{}}} \def\mml:prefix#1{} \def\limit:csname{|%form="prefix" |%\mml:class="csname-limit"} \def\nolimit:csname{|%form="prefix" |%\mml:class="csname-nolimit"} >>> \<<< \def\:tempb#1{% \def\:tempc##11->##2///{\if :##2:% \pend:def#1{\mml:prefix \nolimit:csname}\fi}% \expandafter\:tempc\meaning#11->///% } \:tempb\arccos \:tempb\arcsin \:tempb\arctan \:tempb\arg \:tempb\cosh \:tempb\cos \:tempb\coth \:tempb\cot \:tempb\csc \:tempb\deg \:tempb\dim \:tempb\exp \:tempb\hom \:tempb\ker \:tempb\lg \:tempb\ln \:tempb\log \:tempb\sec \:tempb\sinh \:tempb\sin \:tempb\tanh \:tempb\tan | >>> This should provide correct formatting for built-in log function. By default, it is printed in italic and without space that would separate it from the following element. \<<< \def\:tempa#1#2{% \def\:tempb{\mathop{\PauseMathClass% \HCode{<\a:mathml mi \mml:class="loglike">} #2\HCode{% <\a:mathml mo>&\#x2061;}\EndPauseMathClass% }\nolimits } \HLet#1\:tempb \MakeRobust#1 } \:tempa\log{log} % it seems that the other functions work correctly, % so we don't need to redefine them, but I will keep % them here if we want to do that in the future. % \:tempa\lg{lg} % \:tempa\ln{ln} % \:tempa\sin{sin} % \:tempa\arcsin{arcsin} % \:tempa\sinh{sinh} % \:tempa\cos{cos} % \:tempa\arccos{arccos} % \:tempa\cosh{cosh} % \:tempa\tan{tan} % \:tempa\arctan{arctan} % \:tempa\tanh{tanh} % \:tempa\cot{cot} % \:tempa\coth{coth} % \:tempa\sec{sec} % \:tempa\csc{csc} % \:tempa\arg{arg} % \:tempa\ker{ker} % \:tempa\dim{dim} % \:tempa\hom{hom} % \:tempa\exp{exp} % \:tempa\deg{deg} >>> \<<< \def\:tempb#1{% \def\:tempc##11->##2///{\if :##2:% \pend:def#1{\mml:prefix \limit:csname}\fi}% \expandafter\:tempc\meaning#11->///% } \:tempb\Pr \:tempb\det \:tempb\gcd \:tempb\inf \:tempb\lim \:tempb\max \:tempb\min \:tempb\sup >>> \<<< \def\:tempc{\mml:prefix\limit:csname \mathop{\operator@font lim inf}} \HLet\liminf\:tempc \def\:tempc{\mml:prefix\limit:csname \mathop{\operator@font lim sup}} \HLet\limsup\:tempc >>> \<<< \let\A:displaylines|=\a:displaylines \let\B:displaylines|=\b:displaylines \let\C:displaylines|=\c:displaylines \let\D:displaylines|=\d:displaylines \Configure{displaylines} {\ifmmode \def\A:displaylines{\HCode{<\a:mathml mtable \mml:class="displaylines">}}% \def\B:displaylines{\HCode{}}% \def\C:displaylines{\HCode{<\a:mathml mtr\Hnewline \mml:class="displaylines"><\a:mathml mtd>}}% \def\D:displaylines{\HCode{}}% \fi \A:displaylines} {\B:displaylines} {\C:displaylines}{\D:displaylines} >>> \<<< \def\m:env#1{\HCode{<\a:mathml mtable \mml:class="#1"><\a:mathml mtr><\a:mathml mtd>}% \def\endm:env{\HCode {}}} >>> \<<< \Configure{pmatrix} {\bgroup\m:env{pmatrix}} {\endm:env\egroup} \Configure{multline} {\HCode{<\a:mathml mtable\mml:class="multline">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline\mml:class="multline"><\a:mathml mtd>}} {\HCode{}} \Configure{smallmatrix} {\HCode{<\a:mathml mtable\mml:class="smallmatrix">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline\mml:class="smallmatrix">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline\mml:class="smallmatrix">}} {\HCode{}} \Configure{bmatrix} {\bgroup\m:env{bmatrix}} {\endm:env\egroup} \Configure{vmatrix}{\bgroup\m:env{vmatrix}}{\endm:env\egroup} \Configure{Vmatrix}{\bgroup\m:env{Vmatrix}}{\endm:env\egroup} \Configure{aligned} {\HCode{<\a:mathml mtable\mml:class="aligned">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline\mml:class="aligned">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline\mml:class="aligned">}} {\HCode{}} \Configure{xalignat} {\HCode{<\a:mathml mtable\mml:class="xalignat">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="xalignat">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline \mml:class="xalignat">}} {\HCode{}} \Configure{xxalignat} {\HCode{<\a:mathml mtable \mml:class="xxalignat">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="xxalignat">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline \mml:class="xxalignat">}} {\HCode{}} \Configure{alignedat} {\HCode{<\a:mathml mtable \mml:class="alignedat">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="alignedat">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline \mml:class="alignedat">}} {\HCode{}} \Configure{gathered} {\HCode{<\a:mathml mtable \mml:class="gathered">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="gathered">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline \mml:class="gathered">}} {\HCode{}} >>> \<<< % mathml.4ht (|version), generated from |jobname.tex % Copyright 2009-2024 TeX Users Group % Copyright |CopyYear.1999. Eitan M. Gurari | >>> \<<< % html-mml.4ht (|version), generated from |jobname.tex % Copyright 2009-2022 TeX Users Group % Copyright |CopyYear.1999. Eitan M. Gurari | >>> \<<< | | | >>> \<<< \Configure{htf}{0}{+}{}{}% \Configure{htf}{1}{+}{}% \Configure{htf}{3}{+}{}% \Configure{htf}{4}{+}{}{}% \Configure{htf}{6}{+}{}{}% \Configure{htf}{8}{+} {}{}{}{}{}{}{}% \Configure{htf}{10}{+} {}{}{}{}{}{}{}% \Configure{htf}{12}{+} {}{}{}{}{}{}{}% >>> \<<< \Configure{htf}{0}{+}{}{}{}{}{}{}{}% \Configure{htf}{1}{+}{}{}{}{}{}{}{}% \Configure{htf}{3}{+}{}{}{}{}{}{}{}% \Configure{htf}{4}{+}{}{}{}{}{}{}{}% \Configure{htf}{6}{+}{}{}{}{}{}{}{}% \Configure{htf}{8}{+}{}{}{}{}{}{}{}% \Configure{htf}{10}{+}{}{}{}{}{}{}{}% \Configure{htf}{12}{+}{}{}{}{}{}{}{}% >>> \<<< \def\mml:htfsym{\Configure {htf}{254}{+}{<\a:mathml mglyph\Hnewline fontfamily="}{\%s"}{ index="\%s"}{ mathsize="\%d\%\%"}{}{ alt="}{"/>}} \def\ext:htfsym{\Configure{htf}{254}{+}{}{}{}{}{}{}{}} >>> \<<< \append:def\mml:htfsym{|} \append:def\ext:htfsym{|} >>> We reserve code 254 (and 255) for unknown symbols. \<<< \:CheckOption{core}\if:Option \expandafter\endinput \fi | | >>> \<<< | | | | | >>> \<<< \:CheckOption{core}\if:Option \expandafter\endinput \fi | | | >>> \<<< | | >>> \<<< | | | >>> \<<< \Configure{intertext} {\IgnorePar \ifinalign@ \HCode{\ifnum \HRow>0 \fi <\a:mathml mtr><\a:mathml mtd columnspan="\ifnum \HRow=0 15\else \HCol\fi" \mml:class="intertext">}% \else \ifingather@ \HCode{<\a:mathml mtr><\a:mathml mtd columnspan="\HCol" \mml:class="intertext">}% \fi\fi \AA:text{intertext}% } {\BB:text \ifvmode \IgnorePar \fi \EndP\ifinalign@ \HCode{% \ifnum \HRow>0 <\a:mathml mtr><\a:mathml mtd>\fi}% \else \ifingather@ \HCode{}% \fi\fi } >>> \<<< \Configure{boldsymbol}{\bgroup\HCode{<\a:mathml mstyle mathvariant="bold-italic">}}{\HCode{}\egroup} >>> \<<< \Configure{maketag} {\ifmathml \ifmtext \expandafter\expandafter\expandafter\no:maketag\fi \else \expandafter\no:maketag\fi \AA:text{maketag}\hbox\bgroup\:gobbleIII :@:} {\egroup\BB:text\ } \def\no:maketag#1:@:#2\b:maketag{\hbox{#2}} >>> \<<< \Configure{text}{\AA:text{text}}{\BB:text} >>> \<<< \def\:tempc{\DOTSI\protect\:idotsint} \HLet\idotsint|=\:tempc \def\:idotsint{% \mathop{\intop\cdotp\cdotp\cdotp\intop }\ilimits@ } >>> \<<< | >>> \<<< % amstex.sty | | | >>> \<<< % amstex.tex | | >>> \<<< | >>> I've calculated the space widths according to \Link[https://chenfuture.wordpress.com/2008/03/22/math-spacing-and-length-units/]{}{}Math Spacing and Length Units\EndLink\ blog post. \<<< \let\mathml:on|=\relax \Configure{ } {\ifmathml \ifmtext \space \else\Tg<\a:mathml mspace width="0.33em" \mml:class="nbsp" />\fi \else \:nbsp\fi} >>> \<<< \Configure{hspace} {\ifmathml\ifmtext\else \Tg<\a:mathml mspace width="\the\tmp:dim"/>\fi\fi}{}{ } >>> \<<< \Configure{romannumeral} {\ifmathml\ifmtext\else \HCode{<\a:mathml mrow \mml:class="romannumeral">}\fi\fi} {\ifmathml\ifmtext\else \HCode{}\fi\fi} >>> \<<< \Configure{romannumeral} {\ifmtext\else \HCode{<\ifmathml \a:mathml mrow \else span \fi \mml:class="romannumeral">}\fi } {\ifmtext\else \HCode{}\fi } >>> \<<< \Configure{hspace} {\ifmathml \ifmtext \else \Tg<\a:mathml mspace width="\the\tmp:dim"/>\fi\fi} {}{\ifmathml \else \:nbsp\fi} >>> \<<< | >>> \<<< | >>> \<<< % redefine macro from unicode.4ht to produce better accents \def\unicode:mathop#1{\PauseMathClass\HCode{<\a:mathml mo accent="true">}#1\HCode{}\EndPauseMathClass} \:CheckOption{new-accents} \if:Option \else \Configure{accent}\widetilde\widetilde{{}{}} {} {\HCode{<\a:mathml mover\Hnewline accent="true"><\a:mathml mrow\Hnewline>}#2\HCode{}% \:widetilde:over \HCode{}} \Configure{accent}\tilde\tilde{{}{}} {} {\HCode{<\a:mathml mover\Hnewline accent="true"><\a:mathml mrow\Hnewline>}#2\HCode{}% \:tilde:over \HCode{}} \Configure{accent}\widehat\widehat{{}{}} {} {\HCode{<\a:mathml mover\Hnewline accent="true"><\a:mathml mrow\Hnewline>}#2\HCode{}% \:widehat:over \HCode{}} \fi >>> \<<< \:CheckOption{new-accents} \if:Option \else \ifx \mathml:on\:UnDef \Configure{accents} {\ifmmode \expandafter\mathord\fi {|% \ht:special{t4ht@[}\if!#1!x\else#2\fi\ht:special{t4ht@]}}} {\ifmmode \Tg<\a:mathml mrow \mml:class="accent#1">\mathord{#3}\Tg% \else \HCode{}#3\HCode{}% \fi }% \fi \fi >>> \<<< \:CheckOption{new-accents} \if:Option \else \ifx \mathml:on\:UnDef \Configure{accents} {\ifmmode \expandafter\mathord\fi {|% \ht:special{t4ht@[}\if!#1!x\else#2\fi\ht:special{t4ht@]}}} {\Tg<\a:mathml mrow \mml:class="accent#1">\mathord{#3}\Tg% }% \fi \fi >>> \<<< \leavevmode \if !#1!\ht:special{t4ht@+\string&{35}x#2;}% \else \expandafter \ifx\csname U#2#1\endcsname\relax \ht:special{t4ht@+\string&{35}x#2;}% \else \ht:special{t4ht@+\string&{35}x\csname U#2#1\endcsname;}% \fi \fi x% >>> The special replaces the `x' character. \<<< \let\mml:TeX|=\TeX \def\TeX{\ifmathml\ifmtext TeX\else \HCode{<\a:mathml mtext \mml:class="TeX">TeX}\fi\else \mml:TeX\fi} >>> %%%%%%%%%%%%%%%%%%%%%%%%% \subsection{TeX Engine} %%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{SUB} {\Send{BACK} {<\a:mathml msub><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>\trap:base} {\Tg\TG} \Configure{SUP} {\Send{BACK} {<\a:mathml msup><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>\trap:base} {\Tg\TG} \Configure{SUBSUP} {\Send{BACK} {<\a:mathml msubsup><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>\trap:base} {\Tg\Tg<\a:mathml mrow\Hnewline>\trap:base} {\Tg\TG} \def\trap:base{{\HCode{}}} >>> The \verb'\trap:base' is to catch empty bases of exponents like, e.g., in \verb'$a^{^b}$'. \<<< \LinkCommand\mtxt:link{\a:mathml mtext,% xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href, id, \mml:class="label",,} \LinkCommand\msp:link{\a:mathml mstyle,% xlink:type="simple" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href, id, \mml:class="label",,} \let\M:Link|=\Link \def\Link{\ifmathml \ifmtext |\HCode{}% \expandafter\expandafter\expandafter\mtxt:link \else \expandafter\expandafter\expandafter\msp:link\fi \else \expandafter\M:Link\fi} \let\M:EndLink|=\EndLink \edef\:temp{\catcode`\#=\the\catcode`\#} \catcode`\#=12 \def\EndLink{\ifmathml \ifmtext |% \Endmtxt:link \HCode{<\a:mathml mtext\Hnewline \mml:class="endlabel">}|% \else \HCode{}\fi \else \expandafter\M:EndLink\fi} \:temp >>> For some unclear reasom Mozilla requests mtext the link. \begin{verbatim} ... \end{verbatim} \<<< \Configure{DviMath} {\a:DviMathML \mathmltrue \ifOption{mml-fonts}{}{|%\mml:htfsym|%\NoFonts}% \IgnoreRule \HCode{}\Tg<\a:mathml math\Hnewline \csname a:math-xmlns\endcsname \Hnewline \a:@math>\a:math |\IgnorePar} {\Tg\EndIgnoreRule \ifOption{mml-fonts}{}{|%\ext:htfsym|%\EndNoFonts}% \mathmlfalse \b:DviMathML |} \NewConfigure{DviMathML}{2} \NewConfigure{math-xmlns}{1} \Configure{math-xmlns} { xmlns="http://www.w3.org/1998/Math/MathML" } >>> \<<< \Configure{DviMath} {\a:DviMathML \mathmltrue \ifOption{mml-fonts}{|}{|%\mml:htfsym|%\NoFonts}% \IgnoreRule \HCode{}\Tg<\a:mathml math\Hnewline \csname a:math-xmlns\endcsname \Hnewline \a:@math>\a:math |\IgnorePar} {\Tg\EndIgnoreRule \ifOption{mml-fonts}{|}{|%\ext:htfsym|%\EndNoFonts}% \mathmlfalse \b:DviMathML |} \Css{\a:mathml math { text-indent: 0em; }} >>> \<<< \Configure{htf}{0}{+}{}{}% >>> \<<< \Configure{htf}{0}{+}{<\a:mathml mstyle\Hnewline class="}{\%s}{-\%s}{x-x-\%d}{}{">}{}% >>> \<<< \newif\ifmathml \mathmlfalse \newif\ifmtext \mtextfalse | \NewConfigure{math}{1} \NewConfigure{@math}{1} \def\IgnoreRule{\ht:special{t4ht@\string_}} \def\EndIgnoreRule{\ht:special{t4ht@\string_\string_}} \Configure{$$} {\Configure{@math}{|}\IgnorePar |\EndP\DviMath} {\EndDviMath\ShowPar\par{\csname HCondtrue\endcsname\noindent}} {\DisplayMathtrue} \Configure{$} {\Configure{@math}{|}\DviMath} {\EndDviMath}{} \newif\ifDisplayMath \DisplayMathfalse >>> The \verb+\sqrt+ fanction produces a structure of the following form. \begin{verbatim} PUSH PUSH ......sqrt et al symbols, possibly with PUSH-POP...... POP PUSH W3: 655361 DOWN3: -1020474 PUT_RULE: height: 26213 length: 1091179 DOWN3: 1020474 PUSH .....body......... POP POP POP \end{verbatim} \<<< \Configure{radical} {\Tg<\a:mathml msqrt>% \special{t4ht\string~!e<<\a:mathml mrow>}% \special{t4ht\string~!e>}% \special{t4ht\string~!ee/}% \special{t4ht\string~!ese-}% } >>> The following fails when the root symbol is made up from multiple characters. \begin{verbatim} \Configure{radical}{\Tg<\a:mathml msqrt>% \Send{EndGROUP}{2}{}% \Send{GROUP}{3}{<\a:mathml mrow>}% \Send{EndGROUP}{3}% {\tg\tg}\special{t4ht@+}} \end{verbatim} \<<< \ifvmode\else \HCode{}\fi >>> \<<< \def\MathRow#1{% \Configure{\expandafter\:gobble\string#1*}{*}% {<\a:mathml mrow\Hnewline \mml:class="\expandafter\:gobble\string#1">}{}% {\Configure{\expandafter\:gobble\string#1}{}{}{}{}}#1}% >>> \<<< \sv:ignore >>> \<<< \edef\sv:ignore{\if:nopar \noexpand\IgnorePar\else \noexpand\ShowPar\fi}% >>> The \verb'\MathRow' requests a \verb'<\a:mathml mrow\Hnewline>...', instead of the contributions of \verb'\mathop', \verb'\mathrel',...., for the next parameter. \<<< \def\:MT{\ifmathml \a:mathml m\fi} \Configure{halignTB}{\HCode{<\:MT table }\halignTBL}{\HCode{>}} \Configure{halignTBL} {t}{} {b}{} {c}{} {} \def\t:HA{\HCode{}} \def\R:HA{\HCode{<\:MT tr \Hnewline style="vertical-align:baseline">}} \def\r:HA{\HCode{}} \def\D:HA{|\HCode{<\:MT td \ifnum \HMultispan>1 colspan="\HMultispan"\fi}% \halignTD \HCode{\Hnewline>}} \def\d:HA{\HCode{}|} >>> \<<< \Configure{halignTBL} {t}{\ifmathml \HCode{ align="baseline 1" style="|" }\fi} {b}{\ifmathml \HCode{ align="baseline -1" style="|" }\fi} {c}{\ifmathml \HCode{ align="axis" style="|" }\fi} {} >>> %%%%%%%%%%%%%%%%%%%%%%%% \subsection{latex.ltx} %%%%%%%%%%%%%%%% MathML: \begin{verbatim} Authors wishing to encode whitespace characters at the start or end of the content of a token, or in sequences other than a single space, without having them ignored, must use   or other `whitespace' non-marking entities as described in Section 6.2.4 [Non-Marking Characters]. \end{verbatim} \<<< \ht:special{t4ht@,&\#x00A0;}% >>> \<<< \ht:special{t4ht@, }% >>> \<<< \ht:special{t4ht@,}% >>> \<<< \Configure{newline} {\ifmtext |\HCode{<\a:mathml mtext \mml:class="newline">}% |% \else \Tg\fi} >>> \<<< \Configure{newline} {|\HCode{<\a:mathml mtext \mml:class="newline">}|} >>> \<<< \Configure{[]} {\Configure{@math}{|}\csname a:mathml[]\endcsname \DviMath\Tg<\a:mathml mrow\Hnewline>$$\DisplayMathtrue } {$$\Tg\EndDviMath\csname b:mathml[]\endcsname} \Configure{()} {\Configure{@math}{|}\csname a:mathml()\endcsname \DviMath\Tg<\a:mathml mrow\Hnewline>$} {$\Tg\EndDviMath\csname b:mathml()\endcsname} \NewConfigure{mathml[]}{2} \NewConfigure{mathml()}{2} | >>> \<<< \Configure{mathml[]} {\edef\MathPar{\ifvmode par-\fi}\IgnorePar\endgraf\EndP \HCode{
}} {\HCode{
}|} \Css{div.math-display, div.par-math-display{text-align:center;}} >>> \<<< \Configure{[]} {\Configure{@math}{|}\csname a:mathml[]\endcsname \DviMath\Tg<\a:mathml mrow\Hnewline>$$\DisplayMathtrue } {$$\Tg\EndDviMath\csname b:mathml[]\endcsname \if@rl\else\beginR\fi } >>> \<<< | >>> \<<< \let\columnlines\empty \Configure{halignTB<>}{array}{\HCode{\Hnewline \a:mathml equalrows="false" \ifx\columnlines\empty\else\a:mathml columnlines="\columnlines" \fi \a:mathml equalcolumns="false" \a:mathml class="array" \a:mathml displaystyle="true"}<>\HAlign} \Configure{array} {\halignTB{array}} {\ifvmode \IgnorePar\fi |\Tg} {\Tg<\a:mathml mtr \mml:class="array-row">}{\Tg} {|} {\Tg} \ConfigureEnv{array} {\bgroup\Configure{$}{}{}{}} {\egroup} {}{} >>> \<<< \ConfigureEnv{array} {\PushStack\Col:Marg\AllColMargins \bgroup\Configure{$}{}{}{}} {\egroup \PopStack\Col:Marg\AllColMargins} {}{} >>> \<<< \ConfigureEnv{array} {\PushStack\Col:Marg\AllColMargins \bgroup\Configure{$}{}{}{}} {\egroup \PopStack\Col:Marg\AllColMargins} {}{} >>> \<<< \HCode{<\a:mathml mtd\Hnewline \mml:class="array-td" \ifnum 1<\HMultispan columnspan="\HMultispan"\fi}% \halignTD \HCode{>}% >>> \<<< \HCode{<\a:mathml mtd\Hnewline \mml:class="matrix" \ifnum 1<\HMultispan columnspan="\HMultispan"\fi}% \halignTD \HCode{>}% >>> \<<< \expandafter\tmp:toks\expandafter{\Clr}% \HCode{}% >>> \<<< \def\:MM{m} \def\mathml:hborder{% \Configure{HBorder} {<\a:mathml mtr\Hnewline \mml:class="array-hline">} {|} {} {<\a:mathml mtr\Hnewline \mml:class="array-cline">} {<\a:mathml mtd>} {|} {} {<\a:mathml mtr\Hnewline \mml:class="array-vspace" style="font-size:\HBorderspace">} {} {} } \mathml:hborder >>> \<<< \def\:MM{\ifmathml \a:mathml m\fi} \Configure{HBorder} {<\:MM tr\Hnewline \ifmathml \expandafter\mml:class\else class\fi="array-hline">} {\ifmathml|\else \fi} {} {<\:MM tr\Hnewline \ifmathml \expandafter\mml:class\else class\fi ="array-cline">} {<\:MM td>} {\ifmathml|\else \fi} {} {<\:MM tr\Hnewline \ifmathml \expandafter\mml:class\else class\fi="array-vspace" style="font-size:\HBorderspace">} {<\:MM td\Hnewline>\ifmathml\else\string&\#x00A0;\fi } {} \Configure{halign} {\EndP \PushStack\Table:Stck\TableNo \gHAdvance\Next:TableNo by 1 \global\let\TableNo=\Next:TableNo \halignTB{halign}} {\HCode{}\PopStack\Table:Stck\TableNo} {\HCode{<\:MT tr \Hnewline}\halignTR \HCode{ id="TBL-\TableNo-\HRow-">}} {\HCode{}} {| \HCode{1 colspan="\HMultispan"\fi}% \halignTD \HCode{\Hnewline id="TBL-\TableNo-\HRow-\HCol">}\ShowPar\par} {\ifvmode \IgnorePar \fi \EndP \HCode{}|} >>> It seems that Firefox doesn't support MathML styling using element names, but classes works. We need to hide rows produced by hline. \<<< \Css{.array-hline,.array-cline{ border-top: 1px solid black; height:0px; }} \Css{.array-hline + .array-vspace:last-child{display:none;}} \Css{.hline-mtd, .array-hline td{ display:none }} \Css{.array-hline + .array-row:last-child{display:none;}} \Css{.array-hline:first-child{border-bottom:1px solid black;border-top:none;}} >>> \<<< \SaveEndP >>> \<<< \RecallEndP >>> \<<< <\a:mathml mtd \mml:class="hline-mtd"> >>> \<<< | \let\A:fbox=\a:fbox \let\B:fbox=\b:fbox \let\OLDn:fbox:\n:fbox: \def\OLDf:box{\ifx \EndPicture \:UnDef \expandafter \OLDn:fbox: \else\expandafter \o:fbox: \fi} \def\:temp{\relax\ifmmode \Configure{fbox}{\leavevmode\Configure{HtmlPar}{}{}{}{}\IgnoreRule \AA:text{fbox}}{\BB:text\EndIgnoreRule}\else \Configure{fbox}{\IgnoreRule\A:fbox}{\B:fbox\EndIgnoreRule}\fi \OLDf:box} \HLet\fbox\:temp \let\A:mbox|=\a:mbox \let\B:mbox|=\b:mbox \let\OLD:mbox|=\mbox \def\mbox{\relax\ifmmode \Configure{mbox}{\AA:text{mbox}}{\BB:text}\else \Configure{mbox}{\A:mbox}{\B:mbox}\fi\OLD:mbox} | >>> \<<< \NewConfigure{@mtext}{1} \Configure{@mtext}{ } \def\AA:text#1{|} \def\BB:text{|} >>> \<<< \mtexttrue \HCode{<\a:mathml mstyle\Hnewline \mml:class="#1"><\a:mathml mtext \a:@mtext>}|\PauseMathClass \ifmmode\else |% \fi >>> \<<< \mtextfalse\EndPauseMathClass|\HCode {}% >>> \<<< \Configure{$}% {\EndPauseMathClass \mtextfalse |\HCode{<\a:mathml mstyle\Hnewline \mml:class="math">}}% {\HCode{<\a:mathml mtext \a:@mtext>}|\PauseMathClass \mtexttrue}% {}% >>> \<<< \Configure{()}% {\EndPauseMathClass \mtextfalse |\HCode{<\a:mathml mstyle\Hnewline \mml:class="math">}$}% {$\HCode{<\a:mathml mtext \a:@mtext>}|\PauseMathClass \mtexttrue}% {}% >>> % \Configure{$} % {\Configure{@math}{|}\DviMath} % {\EndDviMath}{} % % \Configure{()} % {\Configure{@math}{|}\csname a:mathml()\endcsname % \DviMath % \Tg<\a:mathml mrow\Hnewline>$} % {$\Tg% % \EndDviMath\csname b:mathml()\endcsname} \begin{verbatim} \documentclass{article} \begin{document} $ \mbox{is right-continuous at } -r $ \end{document} I see the problematic space between is right-continuous at and -r but I don't understand it. The mathml code currently has there <\a:mathml mrow><\a:mathml mtext>is right-continuous at <\a:mathml mo>−<\a:mathml mi>r Replacing mrow with mstyle doesn't make a difference. Removing the mrow solves the problem of the extra space. I introduced the above changes to the mathml and mozilla-mathml configurations, respectively. \end{verbatim} \<<< | \Configure{text}{\AA:text{text}}{\BB:text} \Configure{format} {\HCode{<\a:mathml mtable \mml:class="format">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="format">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline \mml:class="format">}} {\HCode{}} >>> \<<< \Configure{above} {\Send{GROUP}{0}{<\a:mathml mfrac linethickness="\the\tmp:dim"><\a:mathml mrow>}% \HCode{}\o:@@over:\:gobbleII} {\HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{}} \def\overwithdelims:III#1#2#3{% \def\:temp{#2#3}\def\:tempa{..}\ifx \:temp\:tempa \Send{GROUP}{0}{<\a:mathml mfrac linethickness="0"><\a:mathml mrow>}% \HCode{}\o:over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \else \Send{GROUP}{0}{<\a:mathml mfenced \a:mathml separators=""\Hnewline \a:mathml open="|" \a:mathml close="|"><\a:mathml mfrac \a:mathml linethickness="0"><\a:mathml mrow>}% \HCode{}\o:@@over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \fi } >>> \<<< \Configure{over} {\Send{GROUP}{0} {<\a:mathml mfrac><\a:mathml mrow>}\HCode{}} {\HCode{<\a:mathml mrow>}\Send{EndGROUP}{0} {}} \Configure{atop} {\Send{GROUP}{0}{<\a:mathml mfrac linethickness="0"><\a:mathml mrow>}\HCode{}} {\HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{}} \Configure{above} {\Send{GROUP}{0}{<\a:mathml mfrac linethickness="\the\tmp:dim"><\a:mathml mrow>}% \HCode{}\o:over:\:gobbleII} {\HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{}} >>> \<<< \Configure{abovewithdelims} {\abovewithdelims:III} {} \def\abovewithdelims:III#1#2#3{% \def\:temp{#2#3}\def\:tempa{..}\ifx \:temp\:tempa \Send{GROUP}{0}{<\a:mathml mfrac linethickness="\the\tmp:dim"><\a:mathml mrow>}% \HCode{}\o:over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \else \Send{GROUP}{0}{<\a:mathml mfenced \a:mathml separators=""\Hnewline \a:mathml open="|" \a:mathml close="|"><\a:mathml mfrac \a:mathml linethickness="\the\tmp:dim"><\a:mathml mrow>}% \HCode{}\o:over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \fi \tmp:dim } \Configure{atopwithdelims} {\atopwithdelims:III} {} \def\atopwithdelims:III#1#2#3{% \def\:temp{#2#3}\def\:tempa{..}\ifx \:temp\:tempa \Send{GROUP}{0}{<\a:mathml mfrac linethickness="0"><\a:mathml mrow>}% \HCode{}\o:atop: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \else \Send{GROUP}{0}{<\a:mathml mfenced \a:mathml separators=""\Hnewline \a:mathml open="|" \a:mathml close="|"><\a:mathml mfrac \a:mathml linethickness="0"><\a:mathml mrow>}% \HCode{}\o:atop: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \fi } \Configure{overwithdelims} {\overwithdelims:III} {} \def\overwithdelims:III#1#2#3{% \def\:temp{#2#3}\def\:tempa{..}\ifx \:temp\:tempa \Send{GROUP}{0}{<\a:mathml mfrac><\a:mathml mrow>}% \HCode{}\o:over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \else \Send{GROUP}{0}{<\a:mathml mfenced \a:mathml separators=""\Hnewline \a:mathml open="|" \a:mathml close="|"><\a:mathml mfrac><\a:mathml mrow>}% \HCode{}\o:over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \fi } >>> \<<< \Configure{abovewithdelims} {\abovewithdelims:III} {} \def\abovewithdelims:III#1#2#3{% \def\:temp{#2#3}\def\:tempa{..}\ifx \:temp\:tempa \Send{GROUP}{0}{<\a:mathml mfrac linethickness="\the\tmp:dim"><\a:mathml mrow>}% \HCode{}\o:@@over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \else \Send{GROUP}{0}{<\a:mathml mfenced \a:mathml separators=""\Hnewline \a:mathml open="|" \a:mathml close="|"><\a:mathml mfrac \a:mathml linethickness="\the\tmp:dim"><\a:mathml mrow>}% \HCode{}\o:@@over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \fi \tmp:dim } \Configure{atopwithdelims} {\atopwithdelims:III} {} \def\atopwithdelims:III#1#2#3{% \def\:temp{#2#3}\def\:tempa{..}\ifx \:temp\:tempa \Send{GROUP}{0}{<\a:mathml mfrac \a:mathml linethickness="0"><\a:mathml mrow>}% \HCode{}\o:@@atop: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \else \Send{GROUP}{0}{<\a:mathml mfenced \a:mathml separators=""\Hnewline \a:mathml open="|" \a:mathml close="|"><\a:mathml mfrac \a:mathml linethickness="0"><\a:mathml mrow>}% \HCode{}\o:@@atop: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \fi } \Configure{overwithdelims} {\overwithdelims:III} {} \def\overwithdelims:III#1#2#3{% \def\:temp{#2#3}\def\:tempa{..}\ifx \:temp\:tempa \Send{GROUP}{0}{<\a:mathml mfrac><\a:mathml mrow>}% \HCode{}\o:@@over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \else \Send{GROUP}{0}{<\a:mathml mfenced \a:mathml separators=""\Hnewline \a:mathml open="|" \a:mathml close="|"><\a:mathml mfrac><\a:mathml mrow>}% \HCode{}\o:@@over: \HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}{} \fi } >>> Use correct math style for Amsmath's variants of inline fractions. We also need to add fractions markup in tfrac and dfrac to support their use \Link[https://github.com/michal-h21/make4ht/issues/129]{}{}inside of fractions\EndLink. \<<< \pend:def\dfrac{\Configure{genfrac}{\HCode{<\a:mathml mstyle \a:mathml displaystyle="true">} \Configure{over}{}{}}{}{}{\HCode{} } {}{\HCode{}}} \pend:def\tfrac{\Configure{genfrac}{\HCode{<\a:mathml mstyle \a:mathml displaystyle="false">} \Configure{over}{}{}}{}{}{\HCode{} }{}{\HCode{}}} \pend:def\dbinom{\Configure{genfrac}{\HCode{<\a:mathml mstyle \a:mathml displaystyle="true">}}{}{}{}{}{\HCode{}}} \pend:def\tbinom{\Configure{genfrac}{\HCode{<\a:mathml mstyle \a:mathml displaystyle="false">}}{}{}{}{}{\HCode{}}} >>> \<<< \Configure{frac} {\Tg<\a:mathml mfrac>\Tg<\a:mathml mrow\Hnewline>} {\Tg\Configure{over}{}{}} {\Tg<\a:mathml mrow\Hnewline>} {\Tg\Tg} >>> \<<< \ifx \mathdisplay@@pop\:UnDef \ifx \emdf@La\:UnDef | \else | \fi \else | \fi >>> % \Configure{quad}{{\ifmathml \ifmtext \o:quad:\else % \fi\else \o:quad: \fi}} % \<<< \Configure{tmspace} {\ifdim \textspace>0.2em \HCode{<\a:mathml mspace width="\textspace" \mml:class="tmspace"/>}% \else \HCode{<\a:mathml mspace width="0.3em" \mml:class="thinspace"/>}\fi } >>> Use variant of original LaTeX macro used in \textunderscore \<<< \def\mathunderscore{\nfss@text{\HChar{95}}} >>> \<<< \ShowPar\par{\HCondtrue\noindent}% >>> % \Configure{math}{} % this used to be in \providemtextclass. Why? It produces totally invalid % MathML. Where is opened? % \HCode{}\ht:special{t4ht@,}\HCode{}\ht:special{t4ht@,&\#x00A0;}% \<<< \def\providemtextclass#1{% \Configure{@mtext}{#1}% } \Configure{texttt} {\ifmathml \providemtextclass{\mml:class="texttt" mathvariant="monospace" }\fi} {}% \Configure{textit} {\ifmathml \providemtextclass{\mml:class="textit" mathvariant="italic" }\fi} {}% \Configure{textrm} {\ifmathml \providemtextclass{\mml:class="textrm" mathvariant="normal" }\fi} {}% \Configure{textup} {\ifmathml \providemtextclass{\mml:class="textup" mathvariant="normal" }\fi} {}% \Configure{textsl} {\ifmathml \providemtextclass{\mml:class="textsl" mathvariant="italic" }\fi} {}% \Configure{textsf} {\ifmathml \providemtextclass{\mml:class="textsf" mathvariant="sans-serif" }\fi} {}% \Configure{textbf} {\ifmathml \providemtextclass{\mml:class="textbf" mathvariant="bold" }\fi} {}% \Configure{textsc} {\ifmathml \providemtextclass{\mml:class="textsc" mathvariant="normal" }\fi} {}% \Configure{emph} {\ifmathml \providemtextclass{\mml:class="emph" mathvariant="italic" }\fi} {}% >>> The bf command should work in math. The following definition is a bit fragile, it expects that it is used inside a group for a small chunk of text. \<<< \def\:closebf{\HCode{}\EndPauseMathClass} \def\:tempa{\ifmmode\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi{\PauseMathClass\HCode{<\a:mathml mi mathvariant="bold">}\aftergroup\:closebf}{\o:bf:}} \HLet\bf\:tempa >>> \<<< \:CheckOption{fonts} \if:Option \Configure{texttt} {\ifmathml \providemtextclass{\mml:class="texttt" mathvariant="monospace" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else \EndNoFonts\HCode{}\fi} \Configure{textit} {\ifmathml \providemtextclass{\mml:class="textit" mathvariant="italic" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else \EndNoFonts\HCode{}\fi} \Configure{textrm} {\ifmathml \providemtextclass{ \mml:class="textrm" mathvariant="normal" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else \EndNoFonts\HCode{}\fi} \Configure{textup} {\ifmathml \providemtextclass{ \mml:class="textup" mathvariant="normal" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else \EndNoFonts\HCode{}\fi} \Configure{textsl} {\ifmathml \providemtextclass{ \mml:class="textst" mathvariant="italic" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else \EndNoFonts\HCode{}\fi} \Configure{textsf} {\ifmathml \providemtextclass{ \mml:class="textsf" mathvariant="sans-serif" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else \EndNoFonts\HCode{}\fi} \Configure{textbf} {\ifmathml \providemtextclass{ \mml:class="textbf" mathvariant="bold" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else \EndNoFonts\HCode{}\fi} \Configure{textsc} {\ifmathml \providemtextclass{ \mml:class="textsc" mathvariant="normal" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else \EndNoFonts\HCode{}\fi} \Configure{emph} {\ifmathml \providemtextclass{ \mml:class="emph" mathvariant="italic" }% \else \HCode{}\NoFonts\fi} {\ifmathml\else\EndNoFonts \HCode{}\fi} \fi >>> The \verb+\bgroup...\egroup+ is to handle cases like \verb+\nathbf{a}^x+. \<<< \def\bold:version{bold} \Configure{mathbf}% {\bgroup\Tg<\a:mathml mstyle mathvariant="bold">}% {\Tg\egroup}% \Configure{mathit}% {\bgroup\Tg<\a:mathml mstyle mathvariant="\ifx \bold:version\math@version bold-\fi italic">}% {\Tg\egroup}% \Configure{mathrm}% {\bgroup\Tg<\a:mathml mstyle mathvariant="\ifx \bold:version\math@version bold\else normal\fi">}% {\Tg\egroup}% \Configure{mathsf}% {\bgroup\Tg<\a:mathml mstyle mathvariant="\ifx \bold:version\math@version bold-\fi sans-serif">}% {\Tg\egroup}% \Configure{mathtt}% {\bgroup\Tg<\a:mathml mstyle mathvariant="monospace">}% {\Tg\egroup}% >>> \<<< \Css{ math mstyle[mathvariant="bold"] { font-weight: bold; font-style: normal; } } \Css{ math mstyle[mathvariant="normal"] { font-weight: normal; font-style: normal; } } >>> \<<< \Configure{mathbb}{}{} \Configure{mathfrak}{}{} >>> Used to be \begin{verbatim} \Configure{mathrm}{\Tg<\a:mathml mi \mml:class="mathrm">\PauseMathClass}% {\EndPauseMathClass\Tg}% \Configure{mathbf}{\Tg<\a:mathml mi \mml:class="mathbf" mathvariant="bold">\PauseMathClass}% {\EndPauseMathClass\Tg}% \end{verbatim} \<<< \Css{math .texttt { font-family: monospace; }} \Css{math .textit { font-style: italic; }} \Css{math .textsl { font-style: oblique; }} \Css{math .textsf { font-family: sans-serif; }} \Css{math .textbf { font-weight: bold; }} >>> Support for the \verb'\mathversion' command. Thanks to Linas Stonys for the report and additional testing. \<<< | >>> We can configure attributes that will be added to the \verb'' element using \verb'\Configure{mathversion-style}' ideally, use something like \verb'mathvariant="xxx"'. \<<< \NewConfigure{mathversion-style}[2]{\expandafter\gdef\csname :mathversion-#1\endcsname{#2}} % ToDo: Add support for other mathversions \Configure{mathversion-style}{bold}{\a:mathml mathvariant="bold-italic"} >>> Now we can append code to \verb'\mathversion'. It will add the mathvariant tag to the \verb'' element. \<<< \append:defI\mathversion{% % \a:DviMathML is executed at the beginning of math \a:@math is hook for attributes. we need to append out tags to it \Configure{DviMathML}{\append:def\a:@math{\ifcsname :mathversion-\math@version\endcsname\expandafter\csname :mathversion-\math@version\endcsname\fi}}{}% } >>> \<<< \Configure{afterSUB}{'}{\def\SUB:prime{\SUB:SUP}} \Configure{'} {\let\:primes=\empty} {\relax \csname SUB:prime\endcsname\sp{% \global\let\SUB:prime=\:UnDef \def\:tempa{\prime\prime}\ifx \:tempa\:primes \mathop{\HCode{<\a:mathml mi>\string&\#x2033;}}\else \def\:tempa{\prime\prime\prime}\ifx \:tempa\:primes \mathop{\HCode{<\a:mathml mi>\string&\#x2034;}}\else \:primes \fi\fi}% } {\let\prime=\relax \xdef\:primes{\:primes\prime}} >>> LaTeX places the primes within superscript, and mathml seems to follow suit (maybe because of the use of latex fonts in mozilla). However, unicode maps already seem to assume raised representation for the primes. \<<< \:CheckOption{mathjax}\if:Option \Configure{MathjaxSource}{https://cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js} \Configure{@HEAD}{\HCode{ \Hnewline}} \fi >>> %%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{plain.sty} %%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{eqalign} {\HCode{<\a:mathml mtable \mml:class="eqalign">}} {\HCode{}} {\HCode{<\a:mathml mtr \Hnewline \mml:class="eqalign">}} {\IgnorePar\HCode{}} {\HCode{\ifnum \HCol=3 <\a:mathml mtd\Hnewline \mml:class="eqalign3">\fi <\a:mathml mtd \Hnewline \mml:class="eqalign\HCol">}} {\HCode{}} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Palin + LaTeX} %%%%%%%%%%%%%%%%%%%%%%%%%%%% The default \verb'\left' and \verb'\right' in their default definition with tex produce multi-part delimiters, from cmex, on large subformulas. Hence, the `'.' below is needed. \<<< \def\:temp#1{\a:left{#1}\o:left:.\b:left{#1}} \HLet\left|=\:temp \def\:temp#1{\a:right{#1}\o:right:.\b:right{#1}}\HLet\right|=\:temp \Configure{left} {} {\HCode{<\a:mathml mrow><\a:mathml mo \a:mathml fence="true" \a:mathml form="prefix"> |}\bgroup \HCode{<\a:mathml mrow>}\bgroup} \Configure{right} {\egroup\egroup}%{\egroup\Send{GROUP}{0}{ \a:mathml close=""\space}\egroup} {\HCode{<\a:mathml mo \a:mathml fence="true" \a:mathml form="postfix">|}} \def\def:DEL#1{\def\:DEL{#1}} \def\check:DEL#1#2{\def\:tempa{#1}\ifx \:tempa\:DEL \def\:DEL{#2}\fi} \NewConfigure{mfenced}[2]{\append:defI\def:DEL{\check:DEL{#1}{#2}}} | \:CheckOption{new-accents} \if:Option \else | \fi \def\mathinner#1{\Tg<\a:mathml mrow \mml:class="mathinner">#1\Tg} >>> \<<< \def\:tempc#1{\a:middle\mathrel{\left:right#1\:EMPTY}\b:middle} \HLet\middle=\:tempc \NewConfigure{middle}{2} \Configure{middle} {\bgroup \Configure{mathrel}{*} {} {} {\Configure{mathrel}{}{}{}{}}% } {\egroup} >>> The \verb+\root ...\of {...}+ creates the following structure. \begin{verbatim} PUSH ...root value... POP PUSH PUSH PUSH ...root sign characters with PUSH-POP... POP PUSH RIGHT4: 15213546 DOWN3: -1553322 PUT_RULE: height: 26213 length: 1197667 DOWN3: 1553322 PUSH ...root content... POP POP POP POP \end{verbatim} \<<< \Configure{root}{\rev:root}{}{} \def\rev:root #1\b:root#2\c:root{ \Tg<\a:mathml mroot>{\Tg<\a:mathml mrow\Hnewline>#2\Tg}% {\Tg<\a:mathml mrow\Hnewline>#1\Tg}\Tg} \def\AccentMath#1{\relax\ifmmode #1\else $#1$\fi} >>> \<<< \expandafter \ifx \csname \string#1:lr del\endcsname\relax #1\else \csname \string#1:lr del\endcsname\fi >>> \<<< \expandafter \ifx \csname \string#2:lr del\endcsname\relax #2\else \csname \string#2:lr del\endcsname\fi >>> \<<< \expandafter \ifx \csname \string#3:lr del\endcsname\relax #3\else \csname \string#3:lr del\endcsname\fi >>> \<<< \NewConfigure{mfenced}[2]{\expandafter \def\csname \string#1:lr del\endcsname{#2}} | >>> \<<< \Configure{mfenced}{\lvert}{\string&\#x007C;} |%vertical line|% \Configure{mfenced}{\rvert}{\string&\#x007C;} |%double vertical line|% \Configure{mfenced}{\lVert}{\string&\#x2016;} \Configure{mfenced}{\rVert}{\string&\#x2016;} >>> \<<< \Configure{mfenced}{\lvert}{\string&\#x007C;} \Configure{mfenced}{\rvert}{\string&\#x007C;} \Configure{mfenced}{\lVert}{\string&\#x2016;} \Configure{mfenced}{\rVert}{\string&\#x2016;} >>> \<<< \Configure{mfenced}{\||}{\string&\#x2225;} \Configure{mfenced}{.}{} \Configure{mfenced}{\langle}{\string&\#x27E8;} |%lang|% \Configure{mfenced}{\rangle}{\string&\#x27E9;} |%rang|% \Configure{mfenced}{\vert}{||} \edef\:temp{\noexpand\Configure{mfenced}{\noexpand\{}{\string{}}\:temp \edef\:temp{\noexpand\Configure{mfenced}{\noexpand\}}{\string}}}\:temp \edef\:temp{\noexpand \Configure{mfenced}{\noexpand\lbrace}{\string{}}\:temp \edef\:temp{\noexpand \Configure{mfenced}{\noexpand\rbrace}{\string}}}\:temp \Configure{mfenced}{<}{\string&\#x003C;} |%lt|% \Configure{mfenced}{>}{\string&\#x003E;} |%gt|% \Configure{mfenced}{\lceil}{\string&\#x2308;} \Configure{mfenced}{\rceil}{\string&\#x2309;} \Configure{mfenced}{\lfloor}{\string&\#x230A;} \Configure{mfenced}{\rfloor}{\string&\#x230B;} \Configure{mfenced}{\Vert}{\string&\#x2225;} \Configure{mfenced}{\rgroup}{)} \Configure{mfenced}{\lgroup}{(} \Configure{mfenced}{\bracevert}{||} \Configure{mfenced}{\bracevert}{||} \Configure{mfenced}{\downarrow}{\string&\#x2193;} \Configure{mfenced}{\uparrow}{\string&\#x2191;} \Configure{mfenced}{\Uparrow}{\string&\#x21D1;} \Configure{mfenced}{\updownarrow}{\string&\#x2195;} \Configure{mfenced}{\Updownarrow}{\string&\#x21D5;} \Configure{mfenced}{\Downarrow}{\string&\#x21D3;} \Configure{mfenced}{\backslash}{\string&\#x2216;} \Configure{mfenced}{\rmoustache}{\string&\#x25DD;} \Configure{mfenced}{\lmoustache}{\string&\#x25DC;} \Configure{mfenced}{\Arrowvert}{\string&\#x2225;} \Configure{mfenced}{\arrowvert}{\string&\#x007C;} >>> % \def\:tempa{\{}\ifx \:tempa\:DEL \let\:DEL\lbrc: \else % \def\:tempa{\}}\ifx \:tempa\:DEL \let\:DEL\rbrc: \else % \def\:tempa{<}\ifx \:tempa\:DEL \def\:DEL{\string<}\else % \def\:tempa{>}\ifx \:tempa\:DEL \def\:DEL{\string>}% % \fi\fi\fi\fi } % \edef\lbrc:{\string{} \edef\rbrc:{\string}} % \HCode{\string#1;}% %%%%%%%%%%%%%%%%%%%%% \subsection{Amsmath} %%%%%%%%%%%%%%%%%%%%% \<<< \Configure{@begin} {split} {\let\tagform@=\:gobble } >>> \<<< \Configure{split} {\HCode{<\a:mathml mtable \Hnewline \a:mathml columnalign="right left" \mml:class="split">}} {\ifvmode\IgnorePar\fi \HCode{}} {\HCode{<\a:mathml mtr \mml:class="split-mtr">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline \mml:class="split-mtd">}} {\HCode{}} >>> \<<< \Configure{multline} {\HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \mml:class="multline">}} {\HCode{}} {\HCode{<\a:mathml mtr>% <\a:mathml mtd\Hnewline \mml:class="multline">}} {\HCode{}} {\HCode{<\a:mathml mtd>}} {} \Configure{multline*} {\HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \mml:class="multline-star">}} {\HCode{}} {\HCode{<\a:mathml mtr><\a:mathml mtd\Hnewline \mml:class="multline-star">}} {\HCode{}} \Configure{gather} {\HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \mml:class="gather">}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}} \Configure{gather*} {\HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \mml:class="gather-star">}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}} \Configure{subarray} {\HCode{<\a:mathml mtable \mml:class="subarray\if c\Hlcr-c\fi" \a:mathml rowspacing="0" \if c\Hlcr \a:mathml columnalign="center"\fi>}} {\HCode{}} {\HCode{<\a:mathml mtr><\a:mathml mtd>}} {\HCode{}} \Configure{smallmatrix} {\HCode{<\a:mathml mtable>}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="smallmatrix">}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}} \def\:tempc#1#2{% \ConfigureEnv{#1} {\def\end:al:env{}\ifmmode\else \ifvmode\else \def\end:al:env{\par\ShowPar\IgnoreIndent}\fi\fi} {\end:al:env } {}{}% \Configure{#1} {\IgnorePar \ifvmode \EndP \else \EndP \HCode{}\fi \ifmathml \Tg<\a:mathml mrow>\def\end:mathalign{\Tg}% \else \Configure{@math}{|}\DviMath \def\end:mathalign{\EndDviMath \DisplayMathfalse}% \DisplayMathtrue \fi \HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \a:mathml columnalign="left" \mml:class="#2">}} {\HCode{}\end:mathalign } {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline |% \mml:class="align-\ifnum \HCol>\maxfields@ label\else \ifodd\HCol\space odd\else even\fi \fi">}} {\HCode{|}}} \:tempc{align}{align} \:tempc{alignat}{alignat} \:tempc{xalignat}{xalignat} \:tempc{xxalignat}{xxalignat} \:tempc{flalign}{flalign} \:tempc{align*}{align-star} \:tempc{alignat*}{alignat-star} \:tempc{xalignat*}{xalignat-star} \:tempc{flalign*}{flalign-star} >>> \<<< \Configure{gathered} {\HCode{<\a:mathml mtable\Hnewline \mml:class="gathered">}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}} >>> \<<< \Css{mtd.align-odd{margin-left:2em; text-align:right;}} \Css{mtd.align-even{margin-right:2em; text-align:left;}} >>> \<<< \ifodd\HCol\space\else <\a:mathml mspace width="2em"/>\fi >>> \<<< \ifodd\HCol \a:mathml columnalign="right" \fi >>> Setting \verb+#1+ below within mrow is problematic in the sense that arrows don't stretch over multi-characters content \verb+#2+. A \verb+accent="true"+ move the arrow lower, but also distribute the characters further apart. \<<< \Tg<\a:mathml munder>% \Tg<\a:mathml mrow\Hnewline>#2\Tg% #1% \Tg% >>> \<<< \Tg<\a:mathml mover class="overarrow">% \Tg<\a:mathml mrow\Hnewline>{#2#3}\Tg% #1% \Tg% >>> % \Tg<\a:mathml mrow\Hnewline>#1\Tg% % \Tg<\a:mathml mrow>#1\Tg% \<<< \Configure{underarrow@} {\Tg<\a:mathml munder>\Tg<\a:mathml mrow\Hnewline>} {\Tg\Tg<\a:mathml mrow\Hnewline>} {\Tg\Tg} \Configure{overarrow@} {\Tg<\a:mathml mover accent="true">\Tg<\a:mathml mrow\Hnewline>} {\Tg\Tg<\a:mathml mrow>} {\Tg\Tg} \def\:tempc#1#2#3{\a:overarrow@ \hbox{$\m@th#2#3$}\b:overarrow@ \hbox{#1#2}\c:overarrow@ } \HLet\overarrow@\:tempc >>> \<<< \ifx \o:overrightarrow:\:UnDef\else \HRestore\overrightarrow \HRestore\overleftarrow \HRestore\overleftrightarrow \fi >>> \<<< \HRestore\overrightarrow \HRestore\overleftarrow \HRestore\overleftrightarrow >>> \<<< \HRestore\overrightarrow \HRestore\overleftarrow \HRestore\overleftrightarrow >>> % \HRestore\underrightarrow % \HRestore\underleftarrow % \HRestore\underleftrightarrow \<\><<< \def\:tempc{\mathpalette{\overarrow@\rightarrow}} \HLet\overrightarrow=\:tempc \def\:tempc{\mathpalette{\overarrow@\leftarrow}} \HLet\overleftarrow=\:tempc \def\:tempc{\mathpalette{\overarrow@\leftrightarrow}} \HLet\overleftrightarrow=\:tempc \def\:tempc{\mathpalette{\underarrow@\rightarrow}} \HLet\underrightarrow=\:tempc \def\:tempc{\mathpalette{\underarrow@\leftarrow}} \HLet\underleftarrow=\:tempc \def\:tempc{\mathpalette{\underarrow@\leftrightarrow}} \HLet\underleftrightarrow=\:tempc >>> Replace with \Link[http://www.unicode.org/charts/PDF/U27F0.pdf]{}{}stretching arrows\EndLink{} once they work. It was \verb+\rightarrow+ (U-2192) before going to \verb+\HCode{&\#x20D7;}+. (... suggested to replace it with the diacritical one: \verb+⃗+. I t solves two problems. The arrow is lower and the spacing between a subscript and a vector is reduced.) \<<< \Configure{overrightarrow} {\leavevmode\hbox\bgroup$\Tg<\a:mathml mover accent="true" class="overrightarrow">% \Tg<\a:mathml mrow\Hnewline>\:gobble} {\Tg\HCode{<\a:mathml mo>&\#x2192;}% \Tg$\egroup} \Configure{overleftarrow} {\leavevmode\hbox\bgroup$\Tg<\a:mathml mover accent="true" class="overleftarrow">% \Tg<\a:mathml mrow\Hnewline>\:gobble} {\Tg\HCode{<\a:mathml mo>&\#x2190;}% \Tg$\egroup} >>> \<<< \Configure{[]}{\begin{equation*}}{\end{equation*}} >>> \<<< \Configure{underrightarrow} {\Tg<\a:mathml munder>\Tg<\a:mathml mrow\Hnewline>\:gobble} {\Tg\mathop{\rightarrow}\Tg} \Configure{underleftarrow} {\Tg<\a:mathml munder>\Tg<\a:mathml mrow\Hnewline>\:gobble} {\Tg\mathop{\leftarrow}\Tg} >>> \<<< \Configure{overleftrightarrow} {\Tg<\a:mathml mover class="overleftrightarrow">\Tg<\a:mathml mrow\Hnewline>\:gobble} {\Tg\mathop{\HCode{&\#x20E1;}}\Tg} \Configure{underleftrightarrow} {\Tg<\a:mathml munder>\Tg<\a:mathml mrow\Hnewline>\:gobble} {\Tg\mathop{\leftrightarrow}\Tg} >>> \<\><<< \def\underarrow:#1#2#3{|} \def\overarrow:#1#2#3{|} \def\:tempc{\mathpalette{\overarrow:\rightarrow}} \HLet\overrightarrow=\:tempc \def\:tempc{\mathpalette{\overarrow:\leftarrow}} \HLet\overleftarrow=\:tempc \def\:tempc{\mathpalette{\overarrow:\leftrightarrow}} \HLet\overleftrightarrow=\:tempc >>> \<\><<< \def\:tempc{\mathpalette{\underarrow:\rightarrow}} \HLet\underrightarrow=\:tempc \def\:tempc{\mathpalette{\underarrow:\leftarrow}} \HLet\underleftarrow=\:tempc \def\:tempc{\mathpalette{\underarrow:\leftrightarrow}} \HLet\underleftrightarrow=\:tempc >>> \<<< | \renewcommand{\xrightarrow}[2][]{% \Tg<\a:mathml munderover>% \rightarrow \Tg<\a:mathml mrow\Hnewline>#1\Tg% \Tg<\a:mathml mrow\Hnewline>#2\Tg% \Tg}% \renewcommand{\xleftarrow}[2][]{% \Tg<\a:mathml munderover>% \leftarrow \Tg<\a:mathml mrow\Hnewline>#1\Tg% \Tg<\a:mathml mrow\Hnewline>#2\Tg% \Tg}% \def\overset#1#2{{% \Tg<\a:mathml mover class="overset">\Tg<\a:mathml mrow\Hnewline>#2\Tg% \Tg<\a:mathml mrow\Hnewline>#1\Tg% \Tg}}% \def\underset#1#2{{% \Tg<\a:mathml munder>\Tg<\a:mathml mrow\Hnewline>#2\Tg% \Tg<\a:mathml mrow\Hnewline>#1\Tg% \Tg}}% \def\sideset#1#2#3{{\Tg<\a:mathml mrow \mml:class="sideset"\Hnewline >{\HCode{}}#1{\HCode{}#3}#2\Tg}} \ConfigureEnv{eqxample}{}{}{}{} \ConfigureEnv{gather*}{}{}{}{} \ConfigureEnv{gathered}{}{}{}{} \ConfigureEnv{matrix}{}{}{}{} >>> The \verb'\HCode{}' in \verb'\sideset' is for catching superscripts and subscripts % \renewcommand{\hdotsfor}[1]{% % \ifx[#1\@xp\shdots@for\else\hdots@for\@ne{#1}\fi} % \def\shdots@for#1]{\hdots@for{#1}} % \def\hdots@for#1#2{\multicolumn{#2}c% % {\m@th\dotsspace@1.5mu\mkern-#1\dotsspace@ % \xleaders\hbox{$\m@th\mkern#1\dotsspace@.\mkern#1\dotsspace@$}% % \hfill % \mkern-#1\dotsspace@}% % } \<<< \def\:tempc{\HCode{<\a:mathml mspace width="0.2em"/>}\mathbin {mod}\HCode{<\a:mathml mspace width="0.2em"/>}} \HLet\bmod\:tempc \def\:tempc#1{\allowbreak \HCode{<\a:mathml mspace width="0.3em"/>}(#1)} \HLet\pod=\:tempc \def\:tempc#1{\pod{\mathop{mod}\HCode{<\a:mathml mspace width="0.3em"/>}#1}} \HLet\pmod=\:tempc \def\:tempc#1{\allowbreak \HCode{<\a:mathml mspace width="0.3em"/>}\mathop {mod}\HCode{<\a:mathml mspace width="0.3em"/>}#1} \HLet\mod=\:tempc >>> %%%%%%%%%%%%%%%%%%%% \subsection{amsopn} %%%%%%%%%%%%%%%%%%%% \marginpar{remove the following def in liu of xtpipes} \<<< \def\:tempc{{\underrightarrow\lim}} \HLet\varinjlim\:tempc \def\:tempc{{\underleftarrow\lim}} \HLet\varprojlim\:tempc \def\:tempc{{\overline\lim}} \HLet\varlimsup\:tempc \def\:tempc{{\underline\lim}} \HLet\varliminf\:tempc >>> \<<< \def\:tempc#1#2#3{\hbox{{\mtexttrue \HCode{<\a:mathml mrow\Hnewline \mml:class="text"><\a:mathml mtext \a:@mtext>}|\PauseMathClass \Configure{$}{\EndPauseMathClass\mtextfalse |\HCode{<\a:mathml mrow\Hnewline \mml:class="math">}} {\HCode{<\a:mathml mtext \a:@mtext>}|\mtexttrue\PauseMathClass}{#1} \let\f@size#2\selectfont #3}% \mtextfalse \EndPauseMathClass |\HCode {}}} \HLet\textdef@\:tempc >>> The original definitions for the following macros contain small spaces \verb+\,+ in the names, we need to use explicit tags to support them correctly. See \Link{https://github.com/michal-h21/make4ht/issues/133}{}this report\EndLink for more details. \<<< \def\:tempc{\qopname\relax m{\:limspaces{lim}{inf}}} \HLet\liminf=\:tempc \def\:tempc{\qopname\relax m{\:limspaces{lim}{sup}}} \HLet\limsup=\:tempc \def\:tempc{\qopname\relax m{\:limspaces{proj}{lim}}} \HLet\projlim=\:tempc \def\:tempc{\qopname\relax m{\:limspaces{inj}{lim}}} \HLet\injlim=\:tempc >>> \<<< \Configure{qopname} {\Configure{mathop}{*} {<\a:mathml mi \mml:class="qopname">} {<\a:mathml mo> &\#x2061; } {}} >>> Why originally the accents are defined within a group? (knuth answer this in the texbook.) \<<< \let\A:oalign|=\a:oalign \let\B:oalign|=\b:oalign \Configure{oalign} {\ifmmode \Configure{$}{\Tg<\a:mathml mrow\Hnewline>}% {\Tg}{}% \let\halign|=\TeXhalign \Tg<\a:mathml mrow\Hnewline \mml:class="oalign">\else\A:oalign \fi} {\ifmmode \Tg\else\B:oalign\fi} >>> The following CSS caused too large whitespace around functions %\Css{mi.qopname + mo{margin-left:0.3em}} %\Css{mi + mi.qopname{margin-left:0.3em}} %%%%%%%%%%%%%%%%% \subsection{mathtools} %%%%%%%%%%%%%%%%%% \<<< \Configure{MT_gathered_env} {\HCode{<\a:mathml mtable\Hnewline \mml:class="MT-gathered-env">}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}} \ConfigureEnv{MT_gathered_env}{}{}{}{} >>> \<<< \ConfigureEnv{gathered} {% \Configure{MT_gathered_env} {\HCode{<\a:mathml mtable\Hnewline \mml:class="gathered" columnalign="center" >}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}}% } {}{}{} >>> \<<< \ConfigureEnv{lgathered} {% \Configure{MT_gathered_env} {\HCode{<\a:mathml mtable\Hnewline \mml:class="lgathered" columnalign="left" >}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}}% } {}{}{} >>> \<<< \ConfigureEnv{rgathered} {% \Configure{MT_gathered_env} {\HCode{<\a:mathml mtable\Hnewline \mml:class="rgathered" columnalign="right" >}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}}% } {}{}{} >>> \<<< \ConfigureEnv{cases} {\HCode{<\a:mathml mrow \mml:class="cases" >}} {\HCode{}} {}{} \Configure{dcases} {\HCode{<\a:mathml mtable\Hnewline \mml:class="dcases">}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd columnalign="left">}} {\HCode{}} \Configure{dcases*} {\HCode{<\a:mathml mtable\Hnewline \mml:class="dcases-star">}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd columnalign="left">}% \ifnum\HCol=2 \PauseMathClass \HCode{<\a:mathml mtext>}% % the content of this environment is displayed as text, we must switch back to the normal math processing % in inline math \Configure{$}{\EndPauseMathClass\HCode{}}{\PauseMathClass\HCode{<\a:mathml mtext>}}{}% \Configure{()}{\HCode{}\EndPauseMathClass$}{$\PauseMathClass\HCode{<\a:mathml mtext>}}{}% \fi } {\ifnum\HCol=2 \EndPauseMathClass \HCode{}% \fi \HCode{}} >>> %%%%%%%%%%%%%%%%%% \section{Gaus} %%%%%%%%%%%%%%%%%% \<<< \Configure{gmatrix} {\HCode{<\a:mathml mtable \mml:class="gmatrix-\g@environment">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="gmatrix">}} {\HCode{}} {\HCode{\Hnewline<\a:mathml mtd>}} {\HCode{}} >>> \<<< \Css{mtr.gmatrix mtd {margin-left:0em; margin-right:0em; padding-left:0em; padding-right:0em; text-indent:0pt; }} \Css{mfenced mtable {margin-left:0em; margin-right:0em; padding-left:0em; padding-right:0em; text-indent:0pt; }} >>> \<<< \Configure{rowops} {\HCode{ Row ops: }} {\HCode{}} \Configure{colops} {\HCode{ Col ops: }} {\HCode{}} \Css{mtable.rowops, mtable.colops { margin-left:0.2em; margin-right:0.2em; font-size:75\%; }} \Css{mtable.rowops mtr, mtable.colops mtr, mtable.rowops mtd, mtable.colops mtd { margin:0em; padding:0em; }} \Configure{add} {\HCode{}\mbox{add }\HCode{}} {,\HCode{}} {\HCode{}} \Configure{mult} {\HCode{}\mbox{mult }\HCode{}} {,\HCode{}} {\HCode{}} \Configure{swap} {\HCode{}\mbox{swap }\HCode{}} {,\HCode{}} {\HCode{}} >>> %%%%%%%%%%%%%%%%%%%% \section{Eqnarray} %%%%%%%%%%%%%%%%%%%% Had `BASELINE' before `MIDDLE', but changed to conform with math in page 252-- in intro to theory book. \<<< \ConfigureEnv{eqnarray} {\ifvmode \IgnorePar \fi \EndP} {\ifvmode \IgnorePar \fi \EndP \ShowPar \par} {}{} \Configure{eqnarray} {\HCode{<\a:mathml mtable\Hnewline \a:mathml displaystyle="true" \mml:class="eqnarray\ifx \@seqncr\@eqncr\else-star\fi" \a:mathml columnalign="right center left" >}}% {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\Tg<\a:mathml mtd\Hnewline \mml:class="eqnarray-\HCol"> \ifnum \HCol=4 \Tg<\a:mathml mtext \mml:class="eqnarray">|\PauseMathClass \mtexttrue |% \fi} {\ifnum \HCol=4 \mtextfalse \EndPauseMathClass|\Tg\fi \Tg} >>> \<<< | >>> \<<< | >>> \<<< \Configure{multicolumn} {\let\sv:VBorder\VBorder \let\VBorder\empty \Configure{VBorder}{}{}{}{}% } {\let\VBorder\sv:VBorder} {\ifmmode \HCode{<\a:mathml mrow\Hnewline \mml:class="multicolumn}% {|\HColAlign}\HCode{">}\else \ifvmode\IgnorePar\fi \HCode{
}\fi } {\ifmmode \HCode{}\else \ifvmode\IgnorePar\fi \EndP\HCode{
}\fi } \def\gob:sp#1{#1} >>> \<<< \Configure{halignTD} {}{} {<}{\HCode{-left}} {-}{\HCode{-center}} {>}{\HCode{-right}} {p}{\HCode{-left}} {}% >>> \<<< \Configure{halignTD} {}{} {<}{\ifmathml \HCode{ \a:mathml columnalign="left"}\else \HCode{ style="text-align:left; white-space:nowrap;"}\fi} {-}{\ifmathml \HCode{ \a:mathml columnalign="center"}\else \HCode{ style="text-align:center; white-space:nowrap;"}\fi} {>}{\ifmathml \HCode{ \a:mathml columnalign="right"}\else \HCode{ style="text-align:right; white-space:nowrap;"}\fi} {^}{\ifmathml \HCode{ \a:mathml rowalign="top"}\else \HCode{ style="vertical-align:top; white-space:nowrap;"}\fi} {=}{\ifmathml \HCode{ \a:mathml rowalign="baseline"}\else \HCode{ style="vertical-align:baseline; white-space:nowrap;"}\fi} {||}{\ifmathml \HCode{ \a:mathml rowalign="center"}\else \HCode{ style="vertical-align:middle; white-space:nowrap;"}\fi} {_}{\ifmathml \HCode{ \a:mathml rowalign="bottom"}\else \HCode{ style="vertical-align:bottom; white-space:nowrap;"}\fi} {p}{\ifmathml \HCode{ \a:mathml columnalign="left"}\else \HCode{ style="text-align:left;"}\fi} {} >>> \<<< \Configure{halignTD} {}{} {<}{\HCode{ \a:mathml columnalign="left"}} {-}{\HCode{ \a:mathml columnalign="center"}} {>}{\HCode{ \a:mathml columnalign="right"}} {^}{\HCode{ \a:mathml rowalign="top"}} {=}{\HCode{ \a:mathml rowalign="baseline"}} {||}{\HCode{ \a:mathml rowalign="center"}} {_}{\HCode{ \a:mathml rowalign="bottom"}} {p}{\HCode{ \a:mathml columnalign="left"}} {} >>> %%%%%%%%%%%%%%%%%%%%%%%%%% \section{Big, BIG, ....} %%%%%%%%%%%%%%%%%%%%%%%%% The \verb'\special{t4ht@[}...\special{t4ht@]}' gobble the enclosed stuff. The external pair is provided as grouping mechanism for sub/super-scripts cases like \verb'\bigl(...\bigr)^x' within dvimath mode. The \verb'{\HCode{}}' is neded for creating content delimiters \verb'.' delimiters like in \verb'$\bigl. a_b \bigr)$'; without that mathml gets something wrong there. \begin{verbatim} > There are some minor problems wit \bigl | corresponding to #x2223 in > Mozilla encoding > but I eliminted it by using \left | which turned to be a right solution. The \big... macros decide the dimensions of the delimiters. As is the case with \sum, also here I don't know how to transport the dimensions to mozilla. The \left...\right macros ask latex/mozilla to determine the dimensions. \end{verbatim} \<<< \NewConfigure{Biggl}{2} \NewConfigure{Biggm}{2} \NewConfigure{Biggr}{2} \NewConfigure{Bigl}{2} \NewConfigure{Bigm}{2} \NewConfigure{Bigr}{2} \NewConfigure{biggl}{2} \NewConfigure{biggm}{2} \NewConfigure{biggr}{2} \NewConfigure{bigl}{2} \NewConfigure{bigm}{2} \NewConfigure{bigr}{2} | \:CheckOption{mathml-} \if:Option | \else | \fi >>> \<<< \Configure{Biggl} {\bgroup \Configure{Bigg}{}{}{}{}% \Configure{mathopen}{*} {} {} {\Configure{mathopen}{}{}{}{}}% } {\egroup} \Configure{Biggr} {\bgroup \Configure{Bigg}{}{}{}{}% \Configure{mathclose}{*} {} {} {\Configure{mathclose}{}{}{}{}}% } {\egroup} \Configure{Bigl} {\bgroup \Configure{Big}{}{}{}{}% \Configure{mathopen}{*} {} {} {\Configure{mathopen}{}{}{}{}}% } {\egroup} \Configure{Bigr} {\bgroup \Configure{Big}{}{}{}{}% \Configure{mathclose}{*} {} {} {\Configure{mathclose}{}{}{}{}}% } {\egroup} \Configure{biggl} {\bgroup \Configure{bigg}{}{}{}{}% \Configure{mathopen}{*} {} {} {\Configure{mathopen}{}{}{}{}}% } {\egroup} \Configure{biggr} {\bgroup \Configure{bigg}{}{}{}{}% \Configure{mathclose}{*} {} {} {\Configure{mathclose}{}{}{}{}}% } {\egroup} \Configure{bigl} {\bgroup \Configure{big}{}{}{}{}% \Configure{mathopen}{*} {} {} {\Configure{mathopen}{}{}{}{}}% } {\egroup} \Configure{bigr} {\bgroup \Configure{big}{}{}{}{}% \Configure{mathclose}{*} {} {} {\Configure{mathclose}{}{}{}{}}% } {\egroup} >>> \<<< \Configure{Biggl} {\bgroup \Configure{Bigg}{}{}{}{}% \Configure{mathopen}{*} {} {} {\Configure{mathopen}{}{}{}{}}% } {\egroup} \Configure{Biggr} {\bgroup \Configure{Bigg}{}{}{}{}% \Configure{mathclose}{*} {} {} {\Configure{mathclose}{}{}{}{}}% } {\egroup} \Configure{Bigl} {\bgroup \Configure{Big}{}{}{}{}% \Configure{mathopen}{*} {} {} {\Configure{mathopen}{}{}{}{}}% } {\egroup} \Configure{Bigr} {\bgroup \Configure{Big}{}{}{}{}% \Configure{mathclose}{*} {} {} {\Configure{mathclose}{}{}{}{}}% } {\egroup} \Configure{biggl} {\bgroup \Configure{bigg}{}{}{}{}% \Configure{mathopen}{*} {} {} {\Configure{mathopen}{}{}{}{}}% } {\egroup} \Configure{biggr} {\bgroup \Configure{bigg}{}{}{}{}% \Configure{mathclose}{*} {} {} {\Configure{mathclose}{}{}{}{}}% } {\egroup} \Configure{bigl} {\bgroup \Configure{big}{}{}{}{}% \Configure{mathopen}{*} {} {} {\Configure{mathopen}{}{}{}{}}% } {\egroup} \Configure{bigr} {\bgroup \Configure{big}{}{}{}{}% \Configure{mathclose}{*} {} {} {\Configure{mathclose}{}{}{}{}}% } {\egroup} >>> \<<< \Configure{Biggm} {\bgroup \Configure{Bigg}{}{}{}{}% \Configure{mathrel}{*} {} {} {\Configure{mathrel}{}{}{}{}}% } {\egroup} \Configure{Bigm} {\bgroup \Configure{Big}{}{}{}{}% \Configure{mathrel}{*} {} {} {\Configure{mathrel}{}{}{}{}}% } {\egroup} \Configure{biggm} {\bgroup \Configure{bigg}{}{}{}{}% \Configure{mathrel}{*} {} {} {\Configure{mathrel}{}{}{}{}}% } {\egroup} \Configure{bigm} {\bgroup \Configure{big}{}{}{}{}% \Configure{mathrel}{*} {} {} {\Configure{mathrel}{}{}{}{}}% } {\egroup} >>> \<<< \def\:tempc#1{\ht:special{t4ht@[}(\ht:special{t4ht@]}% \a:bigl\mathopen{\left:right\big{#1\:EMPTY}}\b:bigl\:EMPTY} \HLet\bigl=\:tempc \def\:tempc#1{\a:bigm\mathrel{\left:right\big{#1\:EMPTY}}\b:bigm} \HLet\bigm=\:tempc \def\:tempc#1{\:EMPTY \a:bigr\mathclose{\left:right\big{#1\:EMPTY}}\b:bigr% \ht:special{t4ht@[})\ht:special{t4ht@]}} \HLet\bigr=\:tempc \def\:tempc#1{\ht:special{t4ht@[}(\ht:special{t4ht@]}% \a:Bigl\mathopen{\left:right\Big{#1}\:EMPTY}\b:Bigl\:EMPTY} \HLet\Bigl=\:tempc \def\:tempc#1{\a:Bigm\mathrel{\left:right\Big{#1\:EMPTY}}\b:Bigm} \HLet\Bigm=\:tempc \def\:tempc#1{\:EMPTY \a:Bigr\mathclose{\left:right\Big{#1\:EMPTY}}\b:Bigr% \ht:special{t4ht@[})\ht:special{t4ht@]}} \HLet\Bigr=\:tempc \def\:tempc#1{\ht:special{t4ht@[}(\ht:special{t4ht@]}% \a:biggl\mathopen{\left:right\bigg{#1\:EMPTY}}\b:biggl\:EMPTY} \HLet\biggl=\:tempc \def\:tempc#1{\a:biggm\mathrel{\left:right\bigg{#1\:EMPTY}}\b:biggm} \HLet\biggm=\:tempc \def\:tempc#1{\:EMPTY \a:biggr\mathclose{\left:right\bigg{#1\:EMPTY}}\b:biggr% \ht:special{t4ht@[})\ht:special{t4ht@]}} \HLet\biggr=\:tempc \def\:tempc#1{\ht:special{t4ht@[}(\ht:special{t4ht@]}% \a:Biggl\mathopen{\left:right\Bigg{#1\:EMPTY}}\b:Biggl\:EMPTY} \HLet\Biggl=\:tempc \def\:tempc#1{\a:Biggm\mathrel{\left:right\Bigg{#1\:EMPTY}}\b:Biggm} \HLet\Biggm=\:tempc \def\:tempc#1{\:EMPTY \a:Biggr\mathclose{\left:right\Bigg{#1}\:EMPTY}\b:Biggr \ht:special{t4ht@[})\ht:special{t4ht@]}} \HLet\Biggr=\:tempc \def\:EMPTY{{\HCode{}}} \def\left:right{% \let\left|=\o:left: \let\right|=\o:right: \Configure{left}{}{}\Configure{right}{}{}} >>> \verb+\bigl{.}+ et al produce empty para,etr , hence the \verb+\:EMPTY+ is a ompensation for such cases. \<<< \Configure{big} {}{} {\HCode{<\a:mathml mstyle mathsize="1.19em">}} {\HCode{}} \Configure{Big} {}{} {\HCode{<\a:mathml mstyle mathsize="1.61em">}} {\HCode{}} \Configure{bigg} {}{} {\HCode{<\a:mathml mstyle mathsize="2.03em">}} {\HCode{}} \Configure{Bigg} {}{} {\HCode{<\a:mathml mstyle mathsize="2.45em">}} {\HCode{}} >>> % \R=8.5; \R*1.4; \WriteVal\R % \R=11.5; \R*1.4; \WriteVal\R % \R=14.5; \R*1.4; \WriteVal\R % \R=17.5; \R*1.4; \WriteVal\R \<<< \def\:tempc#1{{\hbox{\a:big$\c:big \left#1\hbox{}\right.\n@space\d:big$\b:big}}} \HLet\big=\:tempc \def\:tempc#1{{\hbox{\a:Big$\c:Big \left#1\hbox{}\right.\n@space\d:Big$\b:Big}}} \HLet\Big=\:tempc \def\:tempc#1{{\hbox{\a:bigg$\c:bigg \left#1\hbox{}\right.\n@space\d:bigg$\b:bigg}}} \HLet\bigg=\:tempc \def\:tempc#1{{\hbox{\a:Bigg$\c:Bigg \left#1\hbox{}\right.\n@space\d:Bigg$\b:Bigg}}} \HLet\Bigg=\:tempc >>> \<<< \Configure{pmb} {\ifmmode \HCode{}\fi} {\ifmmode \HCode{}\fi} >>> %%%%%%%%%%%%%%%%%%%%%%%%% \section{stackrel} %%%%%%%%%%%%%%%%%%%%%%%%% \<<< \def\:temp#1#2{{\a:stackrel{#1}\b:stackrel {#2}\c:stackrel}} \HLet\stackrel|=\:temp \:CheckOption{stackrel-} \if:Option \Configure{stackrel} {\mathrel\bgroup \HCode{<\a:mathml mglyph\Hnewline alt="\string\stackrel}\afterassignment\put:arg\tmp:toks} {\afterassignment\put:arg\tmp:toks} {\HCode{" />}\egroup} \def\put:arg{\HCode{{\the\tmp:toks}}} \else \Configure{stackrel} {\HCode{<\a:mathml mover\Hnewline \mml:class="stackrel"><\a:mathml mrow\Hnewline>}\inv:i:iii} {\HCode{<\a:mathml mrow\Hnewline>}|\mathop} {\HCode{}} \def\inv:i:iii#1#2#3{{#3}#2{#1}} \fi >>> \<<< \Configure{mathop*}{*} {<\a:mathml mrow>} {} {\Configure{mathop}{}{}{}{}}% >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{fontmath.ltx} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Accent versus underscript: \verb=\underbrace{x+y+z}= versus \verb=\underbrace{\strut x+y+z}= \<<< \Configure{overbrace} {\Configure{mathop*}{*} {<\a:mathml mover \a:mathml accent="false"><\a:mathml mrow>} {<\a:mathml mo>\string &\#xFE37;} {\Configure{mathop}{}{}{}{}}% } {\let\o:overbrace:=\displaystyle} {} \Configure{underbrace} {\Configure{mathop*}{*} {<\a:mathml munder \a:mathml accentunder="false"><\a:mathml mrow>} {<\a:mathml mo>\string &\#x23DF;} {\Configure{mathop}{}{}{}{}}% } {\let\o:underbrace:=\displaystyle} {} >>> \<\><<< \def\:temp#1{% \Configure{mathop*}{*}{<\a:mathml mrow \mml:class="underbrace">} {}% {\Configure{mathop}{}{}{}{}}% \mathop{\hbox{$\displaystyle{#1}$}}\limits} \HLet\underbrace|=\:temp \def\:temp#1{% \Configure{mathop*}{*}{<\a:mathml mrow \mml:class="overbrace">} {}% {\Configure{mathop}{}{}{}{}}% \mathop{\hbox{$\displaystyle{#1}$}}\limits} \HLet\overbrace|=\:temp >>> \<<< \def\:temp#1{% \Configure{mathop*}{*}{<\a:mathml mrow \mml:class="underbrace">} {}% {\Configure{mathop}{}{}{}{}}% \mathop{\vtop{$\displaystyle{#1}$}}\limits} \HLet\underbrace|=\:temp >>> \<<< \Configure{MathClass}{0}{*}{<\a:mathml mi\Hnewline>}{}{} \Configure{MathClass}{1}{*}{<\a:mathml mi\Hnewline \mml:class="MathClass-op">}{<\a:mathml mo> &\#x2061;}{} \Configure{MathClass}{2}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-bin" \a:mathml stretchy="false">}{}{} \Configure{MathClass}{3}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-rel" \a:mathml stretchy="false">}{}{} \Configure{MathClass}{4}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-open" \a:mathml stretchy="false">} {}{} \Configure{MathClass}{5}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-close" \a:mathml stretchy="false">} {}{} \Configure{MathClass}{6}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-punc" \a:mathml stretchy="false">}{}{} \Configure{MathClass}{7}{*}{<\a:mathml mn>}{} {0123456789} \ifx \mathordMathClass\:UnDef \NewMathClass\mathordMathClass \fi \Configure{MathClass}{\mathordMathClass}{*}{<\a:mathml mo\Hnewline \mml:class="MathClass-ord">}{}{} \Configure{FormulaClass}{0}{}{}{} \Configure{FormulaClass}{1}{}{}{} \Configure{FormulaClass}{2}{}{}{} \Configure{FormulaClass}{3}{}{}{} \Configure{FormulaClass}{4}{}{}{} \Configure{FormulaClass}{5}{}{}{} \Configure{FormulaClass}{6}{}{}{} >>> The following code is to insert spaces for casses like \verb=$a \mathop{div} b$= but not \verb=$\mathop{div} (\mathbf{F})$= \<<< \Css{mo.MathClass-op + mi{margin-left:0.3em}} \Css{mi + mo.MathClass-op{margin-left:0.3em}} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Limits of Sub- snd Super- Scripts} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Outline} %%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{nolimits}{\HCode{}} \Configure{limits} {|} >>> \<<< \let|=\:UnDef \let|=\:UnDef \ifx \:temp\sp |\else \ifx \:temp\sb |\fi \fi |% >>> \<<< \Configure{displaylimits} {\ifDisplayMath \expandafter\disp:limits\fi} \def\disp:limits{|} >>> %%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Simultaneously Sub- and Super- Scripts} %%%%%%%%%%%%%%%%%%%%%%%%% \<<< |% \Configure{SUBSUP} {\ifx |\:UnDef\else |\fi \ifx |\:UnDef\else |\fi |% \Send{BACK} {<\a:mathml munderover \a:mathml accentunder="false" \a:mathml accent="false"><\a:mathml mrow \Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>\trap:base } {\Tg\Tg<\a:mathml mrow\Hnewline>\trap:base} {\Tg\TG} >>> \<<< \let|=\SUBSUP: >>> \<<< \ifx |\:UnDef \else \let\SUBSUP:=|% \fi >>> \<<< \ifx \a:putSUB\:UnDef \else \pend:def\a:putSUB{\ifx |\:UnDef\else \let\SUBSUP:=|% \let|=\:UnDef \fi}% \fi \ifx \a:putSUP\:UnDef \else \pend:def\a:putSUP{\ifx |\:UnDef\else \let\SUBSUP:=|% \let|=\:UnDef \fi}% \fi >>> \<<< \pl:SUBSUP >>> %%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Superscripts} %%%%%%%%%%%%%%%%%%%%%%%%% \<<< |% \Configure{SUP} {|\bgroup |% |\trap:base} {}% >>> \<<< \def\pl:SUP{\Configure{SUP}}% \expandafter\append:def \expandafter\pl:SUP\expandafter{\expandafter{\a:SUP}}% \expandafter\append:def \expandafter\pl:SUP\expandafter{\expandafter{\b:SUP}}% >>> \<<< \Configure{SUP} {|\bgroup |\trap:base} {\egroup|}% >>> \<<< \Configure{SUP} {|\bgroup \trap:base} {\egroup |}% >>> \<<< \Send{BACK}{<\a:mathml mover \mml:class="msup"><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>% >>> \<<< \Tg\TG\aftergroup|% >>> \<<< \pl:SUP >>> \<<< \Send{BACK}{<\a:mathml msup><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>% >>> \<<< \Send{BACK}{<\a:mathml msup><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>% >>> \<<< \Tg\TG% >>> %%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Subscripts} %%%%%%%%%%%%%%%%%%%%%%%%% \<<< |% \Configure{SUB} {|\bgroup |% |\trap:base} {}% >>> \<<< \def\pl:SUB{\Configure{SUB}}% \expandafter\append:def \expandafter\pl:SUB\expandafter{\expandafter{\a:SUB}}% \expandafter\append:def \expandafter\pl:SUB\expandafter{\expandafter{\b:SUB}}% >>> \<<< \Configure{SUB} {|\bgroup |\trap:base} {\egroup|}% >>> \<<< \Configure{SUB} {|\bgroup \trap:base} {\egroup |}% >>> \<<< \Send{BACK}{<\a:mathml munder \mml:class="msub"><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>% >>> \<<< \Tg\TG\aftergroup|% >>> \<<< \pl:SUB >>> \<<< \Send{BACK}{<\a:mathml msub><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>% >>> \<<< \Send{BACK}{<\a:mathml msub><\a:mathml mrow\Hnewline>}% \Tg\Tg<\a:mathml mrow\Hnewline>% >>> \<<< \Tg\TG% >>> %%%%%%%%%%%%% \subsection{Limits on Operators} %%%%%%%%%%%%% \<<< \def\:tempb#1{% \expandafter\let\expandafter\:tempc\csname #1\endcsname \append:def\:tempc{\limits}% \expandafter\HLet\csname #1\endcsname\:tempc } \:tempb{lim} % \:tempb{limsup} % \:tempb{liminf} \:tempb{max} \:tempb{min} \:tempb{sup} \:tempb{inf} \:tempb{det} \:tempb{Pr} \:tempb{gcd} >>> We need a special configuration for these two word operators, in order to get a good spacing. \<<< \def\:limspaces#1#2{\HCode{<\a:mathml mi>#1<\a:mathml mspace class="thinspace" width="0.17em"><\a:mathml mi>#2<\a:mathml mspace class="thinspace" width="0.17em">}} \def\:tempa{\mathop{\:limspaces{lim}{sup}}\limits} \HLet\limsup\:tempa \def\:tempa{\mathop{\:limspaces{lim}{inf}}\limits} \HLet\liminf\:tempa >>> %%%%%%%%%%%%%%% \subsection{Upright letters} %%%%%%%%%%%%%%% The following commands should produce upright characters. So we redefine them to produce mi elements with mathvariant attribute, that hold their Unicode charactes. Extra brackets are used in order to support subscripts and superscripts. \<<< \def\:temp#1#2{\def#1{\PauseMathClass{\HCode{}\ht:special{t4ht@+\string&{35}x#2{59}}\a:HChar\HCode{}}\EndPauseMathClass}} \:temp\Psi{03A8} \:temp\Delta{0394} \:temp\Xi{039E} \:temp\Pi{03A0} \:temp\Sigma{03A3} \:temp\Upsilon{03A5} \:temp\Omega{03A9} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Sized Operations} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This code tries to prevent discarding of math formatting inside of mathop. See \Link{https://tug.org/pipermail/tex4ht/2016q4/001631.html}{}this bug report\EndLink. I use AtBeginDocument because it doesn't seem to have any effect otherwise. The code comes from tex4ht-info.tex. \<<< \AtBeginDocument{% \Configure{mathop*}{*}{}{}{\Configure{mathop}{*}{<\a:mathml mo>}{}{}} } >>> \<<< \def\mathop:prefix#1{% \Configure{mathop}{*}{<\a:mathml mo #1\Hnewline>}{}% {\Configure{mathop}{*}{<\a:mathml mo>}{}{}}} >>> \<<< \def\:tempc{\ifDisplayMath\mathop:prefix{}\fi\o:n:iint::} \HLet\n:iint:\:tempc \def\:tempc{\ifDisplayMath\mathop:prefix{}\fi\o:n:iiint::} \HLet\n:iiint:\:tempc \def\:tempc{\ifDisplayMath\mathop:prefix{}\fi\o:n:idotsint::} \HLet\n:idotsint:\:tempc >>> \<<< \def\:tempd#1#2{% \expandafter\def\csname #1\endcsname{\mathchar"13#2\relax}% \MathSymbol\mathop{#1}% \expandafter\def\csname #1:limits\endcsname{\expandafter \:same \math:sym\mathop{#1}\limits}% \expandafter\ProvideDocumentCommand\csname #1:nolimits\endcsname{}{\expandafter \:same \math:sym\mathop{#1}\nolimits}% \expandafter\edef\csname n:#1:\endcsname{\noexpand\ifDisplayMath \noexpand\expandafter \expandafter\noexpand \csname #1:limits\endcsname \noexpand\else \noexpand\expandafter \expandafter\noexpand \csname #1:nolimits\endcsname\noexpand\fi}% \expandafter\pend:def\csname n:#1:\endcsname{\ifDisplayMath \mathop:prefix{}\fi}% } \:tempd{bigcap}{54} \:tempd{bigcup}{53} \:tempd{bigodot}{4A} \:tempd{bigoplus}{4C} \:tempd{bigotimes}{4E} \:tempd{bigsqcup}{46} \:tempd{biguplus}{55} \:tempd{bigvee}{57} \:tempd{bigwedge}{56} \:tempd{coprod}{60} \:tempd{intop}{52} \:tempd{ointop}{48} \:tempd{prod}{51} \:tempd{sum}{50} >>> Fix the \verb|\int| command -- it should produce the \verb|| element. \<<< \def\:tempc{\ifDisplayMath\mathop:prefix{}\fi\o:n:int::} \HLet\n:int:\:tempc >>> \<<< \ifx \ilimits@\o:nolimits: \let\ilimits@\nolimits \fi \ifx \ilimits@\o:nolimits: \let\slimits@\nolimits \fi >>> \begin{description} \item[sumlimits] (default) Place the subscripts and superscripts of summation symbols above and below, in displayed equations. This option also affects other symbols of the same type---, , , , and so forth---but excluding integrals (see below). \item[nosumlimits] Always place the subscripts and superscripts of summation-type symbols to the side, even in displayed equations. \item[intlimits] Like sumlimits, but for integral symbols. \<<< \ifx \ilimits@\o:displaylimits: \let\ilimits@\nolimits \fi >>> We currently ignore cases of the following kinds. \begin{verbatim} \documentclass{article} \usepackage[intlimits]{amsmath} \begin{document} $\int_{0}$ \end{document} \end{verbatim} \item[nointlimits] (default) Opposite of intlimits. \item[namelimits] (default) Like sumlimits, but for certain `operator names' such as , , , , , that traditionally have subscripts placed underneath when they occur in a displayed equation. \item[nonamelimits] Opposite of namelimits. \end{description} \<\><<< \pend:def\n:int:{\ifDisplayMath\mathop:prefix{mathsize="big"}\fi} \def\sum{\mathchar"1350} \MathSymbol\mathop{sum} \def\sum:limits{\expandafter\:same \math:sym\mathop{sum}\limits} \def\sum:nolimits{\expandafter\:same \math:sym\mathop{sum}\nolimits} \def\n:sum:{\ifDisplayMath \expandafter\sum:limits\else \expandafter\sum:nolimits\fi} \pend:def\n:sum:{\ifDisplayMath\mathop:prefix{mathsize="big"}\fi} >>> % % \def\n:sum:{\expandafter\:same \math:sym\mathop{sum}\nolimits} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Accent through `accents' Configurations} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Should rename `accents' to `combining' (characters). Test file for accents \begin{verbatim} \documentclass{article} \begin{document} \def\showaccents#1#2#3#4#5#6{\cr\hline {\tt \ifx #1\relax\else \string#1\fi{} \string#2} & \if !#3!\else $\ifx #1\relax\else#1{#3}\fi \mbox{#2{#3}}$ {\bf #2{#3}}\fi & \if !#4!\else $\ifx #1\relax\else#1{#4}\fi \mbox{#2{#4}}$ {\bf #2{#4}}\fi & \if !#5!\else $\ifx #1\relax\else#1{#5}\fi \mbox{#2{#5}}$ {\bf #2{#5}}\fi \if !#6!\else \if !#6!\else $\ifx #1\relax\else#1{#6}\fi \mbox{#2{#6}}$ {\bf #2{#6}}\fi \fi } \begin{tabular}{l|c|c|c} & low unicode & high unicode & text combining accent \& mathml \showaccents\dot\.{c}{a}{q}{X} \showaccents\breve\u{a}{}{c}{F} \showaccents\check\v{a}{h}{m}{F} \showaccents\bar\={a}{y}{c}{F} \showaccents\grave\`{a}{n}{c}{F} \showaccents\acute\'{a}{}{m}{F} \showaccents\hat\^{a}{z}{m}{F} \showaccents\tilde\~{a}{v}{m}{F} \showaccents\ddot\"{a}{h}{m}{C} \showaccents\mathring\r{a}{}{m}{F} \showaccents\relax\b{}{b}{c}{j} \showaccents\relax\c{c}{d}{a}{j} \showaccents\relax\d{a}{b}{c}{j} \showaccents\relax\H{o}{}{c}{F} \end{tabular} \end{document} \end{verbatim} | \<<< \Configure{accents} {\ifmmode \expandafter\mathord\fi {|% \ht:special{t4ht@[}\if!#1!x\else#2\fi \ht:special{t4ht@]}}} {\ifmathml \ifmtext |% \else \AccentMath{|}\fi \else |\fi } >>> \<<< \expandafter\ifx \csname :#1:over\endcsname\relax \expandafter\ifx \csname :#1:under\endcsname\relax \AccentMath{|}% \else #3\csname :#1:under\endcsname \fi \else #3\csname :#1:over\endcsname \fi >>> \<<< \expandafter\ifx \csname :#1:over\endcsname\relax |% \else \expandafter\ifx \csname :#1:under\endcsname\relax |% \else |% \fi \fi >>> \<<< \HCode{<\a:mathml munder\Hnewline accent="true"><\a:mathml mrow\Hnewline>}#3\HCode{}% \csname :#1:under\endcsname \HCode{}% >>> \<<< \HCode{<\a:mathml mover\Hnewline accent="true"><\a:mathml mrow\Hnewline>}#3\HCode{}% \csname :#1:over\endcsname \HCode{}% >>> \<<< \HCode{<\a:mathml munderover\Hnewline accent="true"><\a:mathml mrow\Hnewline>}#3\HCode{}% \csname :#1:under\endcsname \csname :#1:over\endcsname \HCode{}% >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Underline and Overline} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{overline} {\bgroup\ifmathml |\else \HCode{}\fi} {\ifmathml |\else \HCode{}\fi\egroup} \Configure{underline} {\bgroup \ifmathml |% \else |\HCode{}\fi} {\ifmathml |\else \HCode{}\fi \egroup} >>> \<<< \Configure{ushort} {\bgroup \expandafter\ushort:data } {\egroup} \Configure{ushortw} {\bgroup \expandafter\ushort:data } {\egroup} \Configure{ushortd} {\bgroup \expandafter\ushortd:data } {\egroup} \Configure{ushortdw} {\bgroup \expandafter\ushortd:data } {\egroup} \Configure{ushortdline} {\bgroup\expandafter\ushortdline:data } {\egroup} \def\ushort:data#1#2{\underline{\:gobbleIII #2}} \def\ushortd:data#1#2{\underline{\underline{\:gobbleIII #2}}} \def\ushortdline:data#1#2{#1{#1{\:gobble #2}}} >>> \<<< | >>> \<<< | >>> \<<< \Configure{overline} {\bgroup |} {|\egroup} \Configure{underline} {\bgroup \ifmmode |\else |\fi} {|\egroup} >>> \<<< \expandafter\everymath \expandafter{\expandafter\everymath \expandafter{\the\everymath}}% \let\o::@underline:\o:@@underline: \def\o:@@underline:{\let\o:@@underline:\o::@underline:}% >>> \<<< \HCode{<\a:mathml mover accent="false"\Hnewline \mml:class="mml-overline"><\a:mathml mrow>}% >>> \<<< \HCode{<\a:mathml mo\Hnewline accent="true">&\#x00AF;% }% >>> \verb'¯' is the code of \verb'‾' \<<< \HCode{<\a:mathml munder \a:mathml accentunder="false"\Hnewline \mml:class="mml-underline"><\a:mathml mrow>}% >>> \<<< \HCode{<\a:mathml mo\Hnewline accent="true">&\#x0332;}% >>> \verb'̲' is the code of \verb'_' \<<< | >>> \<<< \Configure{accentset} {\HCode{}} {\HCode{ }} {\HCode{}} \Configure{underaccent} {\HCode{}} {\HCode{ }} {\HCode{}} >>> Support for the Ulem package in MathML. It seems that text-decoration CSS property doesn't work in browsers for Mathml, so we need to use various tricks to emulate effects, especially double, dotted and dashed lines. \<<< \Configure{uline-math} {\HCode{<\a:mathml menclose class="uline-math" notation="bottom">}\NoFonts} {\EndNoFonts\HCode{}} \Configure{uuline-math} {\HCode{<\a:mathml menclose class="uuline-math" notation="bottom">}\NoFonts} {\EndNoFonts\HCode{}} \Css{.uuline-math{ border-bottom:3px double black; }} \Configure{sout-math} {\HCode{<\a:mathml menclose class="sout-math" notation="horizontalstrike">}\NoFonts} {\EndNoFonts\HCode{}} \Configure{xout-math} {\HCode{<\a:mathml menclose class="xout-math" notation="horizontalstrike bottom">}\NoFonts} {\EndNoFonts\HCode{}} \Configure{uwave-math} {\HCode{<\a:mathml menclose class="uwave-math" notation="bottom">}\NoFonts} {\EndNoFonts\HCode{}} \Configure{dashuline-math} {\HCode{<\a:mathml mstyle class="dashuline-math" notation="bottom">}\NoFonts} {\EndNoFonts\HCode{}} \Css{.dashuline-math {border-bottom: 1px dashed black;}} \Configure{dotuline-math} {\HCode{<\a:mathml mstyle class="dotuline-math" notation="bottom">}\NoFonts} {\EndNoFonts\HCode{}} \Css{.dotuline-math {border-bottom: 1px dotted black;}} >>> Support for the Cancel package \<<< \Configure{cancel-math}{\HCode{<\a:mathml menclose notation="updiagonalstrike">}}{\HCode{}} \Configure{bcancel-math}{\HCode{<\a:mathml menclose notation="downdiagonalstrike">}}{\HCode{}} \Configure{xcancel-math}{\HCode{<\a:mathml menclose notation="updiagonalstrike downdiagonalstrike">}}{\HCode{}} \Configure{cancelto} {\HCode{<\a:mathml msup><\a:mathml menclose notation="updiagonalarrow"><\a:mathml mrow>}} {\HCode{<\a:mathml mrow>}} {\HCode{}} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Choose} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{choose} {\Send{GROUP}{0}{<\a:mathml mfrac linethickness="0" \mml:class="choose">\Hnewline <\a:mathml mrow \mml:class="choose-1">}\HCode{}} {\HCode{\Hnewline<\a:mathml mrow \mml:class="choose-2">} \Send{EndGROUP}{0}{}} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Footnotes} %%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{footnote-mark} {\ifmathml \ifmtext \else \HCode{<\a:mathml mrow \mml:class="footnote-mark">}\fi \else \HCode{}\fi } {\ifmathml \ifmtext \else \HCode{}\fi \else \HCode{}\fi } \Configure{thank-mark} {\HCode{<\ifmathml \a:mathml mrow \expandafter\mml:class\else span class\fi ="thank-mark">}} {\HCode{}} >>> The following code segments handle the different listed cases, with possible exception of the last. \begin{verbatim} a\footnote{b c} $a\footnote{b c}$ $a\footnote{\hbox{b c}}$ $a\footnote{\mbox{b c}}$ $a\mbox{\footnote{b c}}$ \end{verbatim} We have the following hooks \begin{verbatim} \def\@footnotemark{...\a:@makefnmark\@makefnmark \b:@makefnmark...} \long\def\@footnotetext#1{...\a:footnote-text\a:@makefntext \@makefntext{\b:@makefntext \a:@makefnbody #1\b:@makefnbody }\c:@makefntext\b:footnote-text...} \end{verbatim} \<<< \:CheckOption{fn-in}\if:Option \else \expandafter\let\csname A:footnote-text\expandafter\endcsname \csname a:footnote-text\endcsname \expandafter\let\csname B:footnote-text\expandafter\endcsname \csname b:footnote-text\endcsname \NewConfigure{footnote-text}[2]{% \expandafter\def\csname a:footnote-text\endcsname{% #1% \ifmathml \HCode{<\a:mathml math\Hnewline \csname a:math-xmlns\endcsname \Hnewline \a:@math>% \ifmtext <\a:mathml mtext>\fi} \fi \ifmathml \fi }% \expandafter\def\csname b:footnote-text\endcsname{% \ifmathml \HCode{\ifmtext\fi }% \fi #2% }% } \Configure{footnote-text} {\csname A:footnote-text\endcsname} {\csname B:footnote-text\endcsname} \fi >>> \<<< \let\A:footnotetext=\a:footnotetext \let\B:footnotetext=\b:footnotetext \let\C:footnotetext=\c:footnotetext \NewConfigure{footnotetext}[3]{% \def\a:footnotetext{% \ifmathml \ifmtext |\fi\fi #1% \ifmathml \ifmtext |\fi\fi }% \def\b:footnotetext{% \ifmathml \ifmtext |\fi\fi #2% \ifmathml \ifmtext |\fi\fi }% \def\c:footnotetext{% \ifmathml \ifmtext |\fi\fi #3% \ifmathml \ifmtext |\fi\fi }% } \Configure{footnotetext} {\A:footnotetext} {\B:footnotetext} {\C:footnotetext} >>> \<<< \Configure{footnotebody} {\tmp:toks=} {\ifmathml \ifmmode $\mbox{$\the\tmp:toks$}$ \else $\mbox{\the\tmp:toks}$\fi \else \the\tmp:toks\fi} >>> \<<< \:CheckOption{mouseover} \if:Option \pend:def\js:on{\ifmathml \ifmtext |\fi\fi} \append:def\js:on{\ifmathml \ifmtext |\fi\fi} \fi >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Space Characters} %%%%%%%%%%%%%%%%%%%%%%%%%%%% We must use \`'\protect' with LaTeX in order to support TOC etc. \<<< \ifdefined\protect% \def\:unicodespace{\protect\leavevmode\special{t4ht@+\string&{35}x00A0{59}}x}% \def\:unicodenspace{\protect\leavevmode\special{t4ht@+\string&{35}x2002{59}}x}% \else% \def\:unicodespace{\leavevmode\special{t4ht@+\string&{35}x00A0{59}}x}% \def\:unicodenspace{\leavevmode\special{t4ht@+\string&{35}x2002{59}}x}% \fi \def\:nbsp{\ifmtext |\else\ifmathml \Tg<\a:mathml mspace />\else |\fi\fi} \def\:ensp{\ifmtext |\else\ifmathml \Tg<\a:mathml mspace />\else |\fi\fi} >>> \<<< \:unicodespace% >>> \<<< \:unicodenspace% >>> % \HCode{\string&}\HChar{-35}\HCode{x00A0;}% \<<< \Configure{frenchb-nbsp} {\ifmtext |\else\ifmathml \Tg<\a:mathml mspace class="frenchb-nbsp" />% \else \ht:special{t4ht@?unhskip}\HCode{}% |\HCode{}% \fi\fi \setbox\tmp:bx=\hbox\bgroup} {\egroup} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Matrices} %%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%% \subsection{Aligned} %%%%%%%%%%%%% \<<< \Configure{aligned} {\HCode{<\a:mathml mtable\Hnewline \mml:class="aligned">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{}} {\HCode{<\a:mathml mtd \a:mathml columnalign="\ifodd\HCol right\else left\fi" >}} {\HCode{}} \Configure{alignedat} {\HCode{<\a:mathml mtable\Hnewline \mml:class="alignedat">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{}} {\HCode{<\a:mathml mtd \a:mathml columnalign="\ifodd\HCol right\else left\fi" >}} {\HCode{}} >>> %%%%%%%%%%%%%%%%%%%% \subsection{Cases} %%%%%%%%%%%%%%%%% \<<< \Configure{cases} {}{} {\Tg<\a:mathml mtable>}{\Tg} {\Tg<\a:mathml mtr>}{\Tg} {\Tg<\a:mathml mtd \mml:class="cases">}{\Tg} >>> %%%%%%%%%%%%%%%%%%%% \subsection{matrix} %%%%%%%%%%%%%%%%%%%% \<<< \Configure{matrix} {\Tg<\a:mathml mtable \a:mathml equalrows="false" \a:mathml equalcolumns="false"\Hnewline \mml:class="matrix">} {\Tg} {\Tg<\a:mathml mtr>}{\Tg} {|}{\Tg} >>> %%%%%%%%%%%%%%%%%%%% \subsection{pmatrix} %%%%%%%%%%%%%%%%%%%% The grouping below is handle the case that the matrix is a base of an exponent. \<<< \Configure{pmatrix} {\bgroup\Tg<\a:mathml mrow\Hnewline \mml:class="pmatrix">} {\Tg\egroup} >>> The grouping below is handle the case that the matrix is a base of an exponent. The \verb|\,| configurations is for facilitating the catching of left subscripts and superscripts. \<<< \Configure{quad}{{\ifmathml \ifmtext \o:quad:\else {\HCode{<\a:mathml mspace width="1em" \mml:class="quad"/>}}\fi \else \o:quad: \fi}} \Configure{qquad}{{\ifmathml \ifmtext \o:qquad:\else {\HCode{<\a:mathml mspace width="2em" \mml:class="qquad"/>}}\fi \else \o:qquad: \fi}} \Configure{,} {{\HCode{<\a:mathml mspace width="0.17em" \mml:class="thinspace"/>}}} \Configure{:} {{\HCode{<\a:mathml mspace width="0.22em" \mml:class="thinspace"/>}}} \Configure{;} {{\HCode{<\a:mathml mspace width="0.28em" \mml:class="thickpace"/>}}} \Configure{>} {{\HCode{<\a:mathml mspace width="0.30em" \mml:class="medspace"/>}}} \Configure{!} {{\HCode{<\a:mathml mspace width="-0.17em" \mml:class="negthinspace"/>}}} >>> %%%%%%%%%%%%% \subsection{Array Border Lines} %%%%%%%%%%%%% \<<< \border:lines >>> \<<< \def\border:lines{% \ifnum \borderlines>0 \ifnum \borderlines>1 border-right:solid 1px black;\fi \ifodd \borderlines border-left:solid 1px black;\fi \fi } >>> \<<< \Configure{VBorder} {\HAssign\NewGroup = 0 |} {|% \HAssign\NewGroup = 0} {\Advance:\NewGroup by 1 |} {} >>> \<<< \Configure{VBorder} {\let\VBorder=\empty \let\AllColMargins=\empty \global\let\GROUPS=\empty \HAssign\NewGroup = 0 \gHAdvance\Next:TableNo by 1 \global\let\TableNo=\Next:TableNo |% } {|% \xdef\VBorder{\VBorder\ifnum \NewGroup> 0 \fi} \HAssign\NewGroup = 0 \gdef\GROUPS{rules="groups"}} {\Advance:\NewGroup by 1 |% \ifnum \NewGroup=1 \xdef\VBorder{\VBorder}\fi \xdef\VBorder{\VBorder}\xdef\AllColMargins{\AllColMargins1}} {\xdef\AllColMargins{\AllColMargins 0}} \Configure{putHBorder}{\bgroup\ifmathml\mathml:hborder\fi\HCode{\HBorder}\egroup} >>> \<<< \HAssign\borderlines = 0 \global\let\columnlines=\relax >>> \<<< \ifx \columnlines\relax \gHAssign\borderlines = 1 \else \gHAdvance\borderlines by 2 \fi >>> \<<< \ifnum \borderlines>1 \gHAdvance\borderlines by -2 \fi \ifx \columnlines\relax \global\let\columnlines\empty \else \ifnum \NewGroup=1 \xdef\columnlines{\columnlines\ifx\columnlines\empty \else \space\fi solid}% \else \xdef\columnlines{\columnlines\ifx\columnlines\empty \else \space\fi none}% \fi \fi >>> \<<< | >>> \<<< | >>> %%%%%%%%%%%%%%%%%%%% \section{TeX} %%%%%%%%%%%%%%%%%%%% \<<< \Configure{eqalignno} {\HCode{<\a:mathml mtable \mml:class="eqalignno">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="eqalignno">}} {\HCode{}} {\HCode{<\a:mathml mtd \Hnewline \mml:class="eqalignno-\HCol">}} {\HCode{}} \def\:eqalignno:{\Configure{noalign} {\HCode{<\a:mathml mtr><\a:mathml mtd \mml:class="noalign" colspan="2">}}% {\HCode{}}} >>> \<<< \Configure{leqalignno} {\HCode{<\a:mathml mtable \mml:class="leqalignno">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="leqalignno">}} {\HCode{}} {\HCode{<\a:mathml mtd \Hnewline \mml:class="leqalignno-\HCol">}} {\HCode{}} \def\:leqalignno:{\Configure{noalign} {\HCode{<\a:mathml mtr><\a:mathml mtd \mml:class="noalign" colspan="2">}}% {\HCode{}}} >>> \section{Fractions} \<<< | >>> \<<< \ConfigureEnv{aligned}{}{}{}{} \Configure{aligned} {\HCode{<\a:mathml mtable\Hnewline \mml:class="aligned">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{}} {\HCode{<\a:mathml mtd>}} {\HCode{}} >>> \<<< \Configure{multilimits} {\HCode{<\a:mathml mtable\Hnewline \mml:class="multilimits">}} {\HCode{}} {\HCode{<\a:mathml mtr><\a:mathml mtd\Hnewline>}} {\HCode{}} \Configure{smallmatrix} {\HCode{<\a:mathml mtable\Hnewline \mml:class="smallmatrix">}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline>}} {\HCode{}} >>> \<<< \Configure{matrix} {\HCode{<\a:mathml mtable\Hnewline \mml:class="matrix">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{}} {\HCode{|}} {\HCode{}} >>> \<<< \Configure{pmatrix}{\Tg<\a:mathml mrow \mml:class="pmatrix">} {\Tg} >>> \<<< \Configure{align} {\HCode{<\a:mathml mtable\Hnewline \mml:class="align">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{}} {\HCode{<\a:mathml mtd>}} {\HCode{}} \Configure{aligned} {\HCode{<\a:mathml mtable\Hnewline \mml:class="aligned">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline>}} {\HCode{}} {\HCode{<\a:mathml mtd>}} {\HCode{}} >>> \<<< \Configure{cases} {\Tg<\a:mathml mrow \mml:class="cases">} {\Tg} \Configure{alignat} {\HCode{<\a:mathml mtable \mml:class="alignat">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="alignat">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline \mml:class="alignat">}} {\HCode{}} \Configure{gather} {\HCode{<\a:mathml mtable \mml:class="gather">}} {\HCode{}} {\HCode{<\a:mathml mtr\Hnewline \mml:class="gather">}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline \mml:class="gather">}} {\HCode{}} >>>> \<<< \Configure{align} {\EndP\HCode{<\a:mathml mtable\Hnewline \mml:class="align">}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{<\a:mathml mtd>}} {\HCode{}} >>> % {\mathchar"0403} % \square % {\mathchar"0404} % \blacksquare % {\mathchar"0406} % \lozenge % {\mathchar"0407} % \blacklozenge % {\mathchar"0438} % \backprime % {\mathchar"0446} % \bigstar % {\mathchar"0448} % \blacktriangledown % {\mathchar"044E} % \blacktriangle % {\mathchar"044F} % \triangledown % {\mathchar"045D} % \measuredangle % {\mathchar"045E} % \sphericalangle % {\mathchar"0473} % \circledS % {\mathchar"047B} % \complement % {\mathchar"051E} % \diagup % {\mathchar"051F} % \diagdown % {\mathchar"053F} % \varnothing % {\mathchar"0540} % \nexists % {\mathchar"0560} % \Finv % {\mathchar"0561} % \Game % {\mathchar"0567} % \eth % {\mathchar"0569} % \beth % {\mathchar"056A} % \gimel % {\mathchar"056B} % \daleth % {\mathchar"057A} % \digamma % {\mathchar"057B} % \varkappa % {\mathchar"057C} % \Bbbk % {\mathchar"057D} % \hslash \<<< \ifx \tmp:bx\:UnDef \csname newbox\endcsname \tmp:bx \fi \ifx \find:set:mgroup\:UnDef \def\find:set:mgroup#1#2#3{\bgroup \def\use@mathgroup##1##2##3{\relax \tmp:cnt=##2% \xdef\:temp####1{\noexpand\Configure{MathClass}{#2}% {}{}{}{\mathchar"0\the\tmp:cnt ####1}}% }% \setbox\tmp:bx=\hbox{$#1$}\setbox\tmp:bx=\hbox{}% \set:mgroup#3{}{}% \egroup } \fi \def\set:mgroup#1#2{\if :#1#2:\else \:temp{#1#2}\expandafter\set:mgroup \fi} >>> \<<< \ifx \mathboldcalMathClass\:UnDef \NewMathClass\mathboldcalMathClass \fi \Configure{MathClass}{\mathboldcalMathClass}{*} {<\a:mathml mi\Hnewline mathvariant="bold-script">}{}{} >>> \<<< \expandafter\ifx\csname mv@bold\endcsname\relax \else \bgroup \mathversion{bold}% \find:set:mgroup{\mathcal{A}}{\mathboldcalMathClass}% {4142434445464748494A4B4C4D4E4F505152535455565758595A} |%A--Z|% \egroup \fi >>> This version of mathcal will prevent conversion of letters to Unicode Script values. The Script style is required using the mathvariant attribute, so it should be rendered correctly. \<<< \def\:tempa#1{\bgroup\HCode{<\a:mathml mstyle\Hnewline mathvariant="script">}#1\HCode{}\egroup} \HLet\mathcal\:tempa >>> \<<< \def\:tempa#1"#2#3///{% \edef\:next{\noexpand\Configure{MathClass}{\ifnum 0=#2 \mathordMathClass \else #2\fi}}% \:next } % \def\:tempb#1{\:tempa#1///{}{}{}{#1}} % \def\:tempc#1"#2//{\:tempb{\mathchar"#2}} % \def\:temp#1{\expandafter\:tempc\meaning#1//} \def\:temp#1{\expandafter\:tempc\meaning#1//} \def\:tempb#1{\:tempa#1///{}{}{}{#1}} \def\:tempc#1"#2//{\:tempd#2...//} \def\:tempd#1#2#3#4#5//{% \if #4.\:tempb{\mathchar"0#1#2#3}\else \:tempb{\mathchar"#1#2#3#4}\fi } \:temp \boxdot \:temp \boxplus \:temp \boxtimes \:temp \centerdot \:temp \boxminus \:temp \veebar \:temp \barwedge \:temp \doublebarwedge \:temp \Cup \:temp \Cap \:temp \curlywedge \:temp \curlyvee \:temp \leftthreetimes \:temp \rightthreetimes \:temp \dotplus \:temp \intercal \:temp \circledcirc \:temp \circledast \:temp \circleddash \:temp \divideontimes \:temp \lessdot \:temp \gtrdot \:temp \ltimes \:temp \rtimes \:temp \smallsetminus \:temp \circlearrowright \:temp \circlearrowleft \:temp \leftrightharpoons \:temp \Vdash \:temp \Vvdash \:temp \vDash \:temp \twoheadrightarrow \:temp \twoheadleftarrow \:temp \leftleftarrows \:temp \rightrightarrows \:temp \upuparrows \:temp \downdownarrows \:temp \upharpoonright \:temp \downharpoonright \:temp \upharpoonleft \:temp \downharpoonleft \:temp \rightarrowtail \:temp \leftarrowtail \:temp \leftrightarrows \:temp \rightleftarrows \:temp \Lsh \:temp \Rsh \:temp \rightsquigarrow \:temp \leftrightsquigarrow \:temp \looparrowleft \:temp \looparrowright \:temp \circeq \:temp \succsim \:temp \gtrsim \:temp \gtrapprox \:temp \multimap \:temp \therefore \:temp \because \:temp \doteqdot \:temp \triangleq \:temp \precsim \:temp \lesssim \:temp \lessapprox \:temp \eqslantless \:temp \eqslantgtr \:temp \curlyeqprec \:temp \curlyeqsucc \:temp \preccurlyeq \:temp \leqq \:temp \leqslant \:temp \lessgtr \:temp \risingdotseq \:temp \fallingdotseq \:temp \succcurlyeq \:temp \geqq \:temp \geqslant \:temp \gtrless \:temp \vartriangleright \:temp \vartriangleleft \:temp \trianglerighteq \:temp \trianglelefteq \:temp \between \:temp \blacktriangleright \:temp \blacktriangleleft \:temp \vartriangle \:temp \eqcirc \:temp \lesseqgtr \:temp \gtreqless \:temp \lesseqqgtr \:temp \gtreqqless \:temp \Rrightarrow \:temp \Lleftarrow \:temp \varpropto \:temp \smallsmile \:temp \smallfrown \:temp \Subset \:temp \Supset \:temp \subseteqq \:temp \supseteqq \:temp \bumpeq \:temp \Bumpeq \:temp \lll \:temp \ggg \:temp \pitchfork \:temp \backsim \:temp \backsimeq \:temp \lvertneqq \:temp \gvertneqq \:temp \nleq \:temp \ngeq \:temp \nless \:temp \ngtr \:temp \nprec \:temp \nsucc \:temp \lneqq \:temp \gneqq \:temp \nleqslant \:temp \ngeqslant \@ifpackageloaded{program}{}{\:temp \lneq} \:temp \gneq \:temp \npreceq \:temp \nsucceq \:temp \precnsim \:temp \succnsim \:temp \lnsim \:temp \gnsim \:temp \nleqq \:temp \ngeqq \:temp \precneqq \:temp \succneqq \:temp \precnapprox \:temp \succnapprox \:temp \lnapprox \:temp \gnapprox \:temp \nsim \:temp \ncong \:temp \varsubsetneq \:temp \varsupsetneq \:temp \nsubseteqq \:temp \nsupseteqq \:temp \subsetneqq \:temp \supsetneqq \:temp \varsubsetneqq \:temp \varsupsetneqq \:temp \subsetneq \:temp \supsetneq \:temp \nsubseteq \:temp \nsupseteq \:temp \nparallel \:temp \nmid \:temp \nshortmid \:temp \nshortparallel \:temp \nvdash \:temp \nVdash \:temp \nvDash \:temp \nVDash \:temp \ntrianglerighteq \:temp \ntrianglelefteq \:temp \ntriangleleft \:temp \ntriangleright \:temp \nleftarrow \:temp \nrightarrow \:temp \nLeftarrow \:temp \nRightarrow \:temp \nLeftrightarrow \:temp \nleftrightarrow \:temp \eqsim \:temp \shortmid \:temp \shortparallel \:temp \thicksim \:temp \thickapprox \:temp \approxeq \:temp \succapprox \:temp \precapprox \:temp \curvearrowleft \:temp \curvearrowright \:temp \backepsilon \:temp \square \:temp \blacksquare \:temp \lozenge \:temp \blacklozenge \:temp \backprime \:temp \bigstar \:temp \blacktriangledown \:temp \blacktriangle \:temp \triangledown \:temp \measuredangle \:temp \sphericalangle \:temp \circledS \:temp \complement \:temp \diagup \:temp \diagdown \:temp \varnothing \:temp \nexists \:temp \Finv \:temp \Game \:temp \eth \:temp \beth \:temp \gimel \:temp \daleth \:temp \digamma \:temp \varkappa \:temp \Bbbk \:temp \hslash >>> Note that in the presence of bm.sty the symbols of amssymb change their codings. \begin{verbatim} \documentclass{article} % \usepackage{bm} \usepackage{amsmath,amssymb} \begin{document} \hshow{boxdot} \begin{equation} 2 \end{equation} \end{document} \end{verbatim} %%%%%%%%%%%%%%%%%% \chapter{Loose Ends} %%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%% \section{Commutative Diagrams (amscd)} %%%%%%%%%%%%%%%%%% \<<< \ConfigureEnv{CD}{}{}{}{} \Configure{CD} {\HCode{<\a:mathml mtable class="CD"\Hnewline>}} {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\HCode{<\a:mathml mtd\Hnewline>}} {\HCode{}} >>> \<<< \Configure{ @>} {\Configure{mathrel*}{*} {} {} {}} >>> \<<< \Configure{ @<} {\Configure{mathrel*}{*} {} {} {}} >>> \<<< \Configure{ @V} {\HCode{} \hbox{$\m@th\vcenter{\hbox{$\scriptstyle#2$}}$}%% \HCode{}} {\HCode{} \hbox{$\m@th\vcenter{\hbox{$\m@th\vcenter{\hbox {$\scriptstyle#1$}}$}}$}% \HCode{}} >>> Are there \verb+\llap+and \verb+\rlap+ facilities in mathml? %%%%%%%%%%%%%%%%%% \section{Right-to-Left Babel} %%%%%%%%%%%%%%%%%% \<<< \expandafter\ifx \csname o@everypar\endcsname\relax \else \expandafter\ifx \csname ht:everypar\endcsname\relax \let\ht:everypar\o@everypar \fi\fi >>> \<<< dir="\if@rl rtl\else ltr\fi" >>> \<<< \Configure{moreL} {\ifmathml |% \else \ifvmode \let\end:moreRL=\empty \else\HCode{}% \def\end:moreRL{\HCode{}}% \fi \fi } {\end:moreRL} \Configure{moreR} {\ifmathml |% \else \ifvmode \let\end:moreRL=\empty \else\HCode{}\def\end:moreRL{\HCode{}}\fi \fi } {\end:moreRL} \Css{.rtl {direction: rtl} .ltr {direction: ltr} } >>> \<<< \ifmtext \leavevmode\special{t4ht@+<\a:mathml mtext{32}\mml:class="ltr">}x% \def\end:moreRL{\HCode{<\a:mathml mtext>}}% \else \let\end:moreRL=\empty \fi >>> \<<< \ifmtext \leavevmode\special{t4ht@+<\a:mathml mtext{32}\mml:class="rtl">}x% \def\end:moreRL{\HCode{<\a:mathml mtext>}}% \else \let\end:moreRL=\empty \fi >>> %%%%%%%%%%%%% \subsection{Tables} %%%%%%%%%%%%% %%%%%%%%%%%%% \subsection{dcolumn} %%%%%%%%%%%%% \<<< \Configure{dcolumn} {\NoFonts\Configure{$}{}{}{}} {\EndNoFonts} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{openmath} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{itemitem}{}{}{\par\leavevmode}{} >>> Used to have also a \verb'\special{t4ht@[}...\special{t4ht@]}', where the specials asked to igore the enclosed content. It is provided for getting `realistic' measurements in mathml applets. a candidadte for delition. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Shared} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< !*?: >>> \<<< cw:>>> \<<< tail>>> \<<< \xdef\:cursec{|
}% >>> \<<< \expandafter\edef\csname :RestoreCatcodes\endcsname{% \expandafter\ifx \csname :RestoreCatcodes\endcsname\relax\else \csname :RestoreCatcodes\endcsname \fi \catcode`\noexpand :|=\the\catcode`:% \let\expandafter\noexpand\csname :RestoreCatcodes\endcsname|= \noexpand\UnDefcS} \catcode`\:|=11 >>> %%%%%%%%%%%%%%%%%% \section{Boxed} %%%%%%%%%%%%%%%%%% \<<< \Configure{boxed} {\ifmathml \Tg<\a:mathml menclose \a:mathml notation="box">\Tg<\a:mathml mrow>% \else \HCode{}\fi\IgnorePar} {\ifmathml \Tg\Tg% \else \HCode{}\fi} \Css{.boxed{border: 1px solid black; padding-left:2px; padding-right:2px;}} >>> %%%%%%%%%%%%%%%%%% \section{fontmath} %%%%%%%%%%%%%%%%%% \<<< \mathchar"3230 |%\prime|% \mathchar"3231 |%\infty|% \mathchar"323B |%\emptyset|% \mathchar"323C |%\Re|% \mathchar"323D |%\Im|% \mathchar"3240 |%\aleph|% >>> \<<< \mathchar"3234 |%\triangle|% \mathchar"3238 |%\forall|% \mathchar"3239 |%\exists|% \mathchar"323A |%\neg|% \mathchar"323E |%\top|% \mathchar"323F |%\bot|% \mathchar"3272 |%\nabla|% \mathchar"3278 |%\mathsection|% \mathchar"327B |%\mathparagraph|% \mathchar"327C |%\clubsuit|% \mathchar"327D |%\diamondsuit|% \mathchar"327E |%\heartsuit|% \mathchar"327F |%\spadesuit|% >>> \subsection{1: Large Operators} \begin{verbatim} \mathchardef\coprod="1360 \mathchardef\bigvee="1357 \mathchardef\bigwedge="1356 \mathchardef\biguplus="1355 \mathchardef\bigcap="1354 \mathchardef\bigcup="1353 \mathchardef\intop="1352 \def\int{\intop\nolimits} \mathchardef\prod="1351 \mathchardef\sum="1350 \mathchardef\bigotimes="134E \mathchardef\bigoplus="134C \mathchardef\bigodot="134A \mathchardef\ointop="1348 \def\oint{\ointop\nolimits} \mathchardef\bigsqcup="1346 \mathchardef\smallint="1273 \end{verbatim} \<<< \Configure{MathClass}{1}{}{}{}{ \mathchar"1360 \mathchar"1357 \mathchar"1356 \mathchar"1355 \mathchar"1354 \mathchar"1353 \mathchar"1352 \mathchar"1351 \mathchar"1350 \mathchar"134E \mathchar"134C \mathchar"134A \mathchar"1348 \mathchar"1346 \mathchar"1273 |% } >>> % \mathchar"230 |%math prime|% A prime is typically placed on letters and digits. \subsection{2: Binary Operations} \begin{verbatim} \mathchardef\triangleleft="212F \mathchardef\triangleright="212E \mathchardef\bigtriangleup="2234 \mathchardef\bigtriangledown="2235 \mathchardef\wedge="225E \let\land=\wedge \mathchardef\vee="225F \let\lor=\vee \mathchardef\cap="225C \mathchardef\cup="225B \mathchardef\ddagger="227A \mathchardef\dagger="2279 \mathchardef\sqcap="2275 \mathchardef\sqcup="2274 \mathchardef\uplus="225D \mathchardef\amalg="2271 \mathchardef\diamond="2205 \mathchardef\bullet="220F \mathchardef\wr="226F \mathchardef\div="2204 \mathchardef\odot="220C \mathchardef\oslash="220B \mathchardef\otimes="220A \mathchardef\ominus="2209 \mathchardef\oplus="2208 \mathchardef\mp="2207 \mathchardef\pm="2206 \mathchardef\circ="220E \mathchardef\bigcirc="220D \mathchardef\setminus="226E % for set difference A\setminus B \mathchardef\cdot="2201 \mathchardef\ast="2203 \mathchardef\times="2202 \mathchardef\star="213F \mathcode`\*="2203 % \ast \mathcode`\+="202B \mathcode`\-="2200 \end{verbatim} \<<< \Configure{MathClass}{2}{}{}{}{ *-+/ \mathchar"212F \mathchar"212E \mathchar"2234 \mathchar"2235 \mathchar"225E \mathchar"225F \mathchar"225C \mathchar"225B \mathchar"227A \mathchar"2279 \mathchar"2275 \mathchar"2274 \mathchar"225D \mathchar"2271 \mathchar"2205 \mathchar"220F \mathchar"226F \mathchar"2204 \mathchar"220C \mathchar"220B \mathchar"220A \mathchar"2209 \mathchar"2208 \mathchar"2207 \mathchar"2206 \mathchar"220E \mathchar"220D \mathchar"226E \mathchar"2201 \mathchar"2203 \mathchar"2202 \mathchar"213F \mathchar"6201 % cdot } >>> \subsection{3: Relational Operations} The catcode is needed because 303A is \verb':'. \<<< \Configure{MathClass}{3}{}{}{}{ \mathchar"3128 \mathchar"3129 \mathchar"312A \mathchar"312B \mathchar"315E \mathchar"315F \mathchar"3210 \mathchar"3211 \mathchar"3212 \mathchar"3213 \mathchar"3214 \mathchar"3215 \mathchar"3216 \mathchar"3217 \mathchar"3218 \mathchar"3219 \mathchar"321A \mathchar"321B \mathchar"321C \mathchar"321D \mathchar"321E \mathchar"321F \mathchar"3220 \mathchar"3221 \mathchar"3224 \mathchar"3227 \mathchar"3232 \mathchar"3233 \mathchar"3236 \mathchar"3237 \mathchar"323F :=>< \mathchar"322F \mathchar"3276 \mathchar"3277 \mathchar"326B \mathchar"326A \mathchar"3261 \mathchar"3260 \mathchar"3225 \mathchar"3226 \mathchar"322D \mathchar"322E \mathchar"322C \mathchar"3228 \mathchar"3229 } >>> % \mathchar"327C |%clubsuit|% % \mathchar"327D |%diamondsuit|% % \mathchar"327E |%heartsuit|% % \mathchar"327F |%spadesuit|% % \mathchar"340A % rightleftharpoons % \mathchar"340B % leftrightharpoons % \begin{verbatim} \mathcode`\>="313E \mathcode`\<="313C \mathcode`\=="303D \mathcode`\:="303A \mathchardef\leq="3214 \let\le=\leq \mathchardef\geq="3215 \let\ge=\geq \mathchardef\succ="321F \mathchardef\prec="321E \mathchardef\approx="3219 \mathchardef\succeq="3217 \mathchardef\preceq="3216 \mathchardef\supset="321B \mathchardef\set="321A \mathchardef\supseteq="3213 \mathchardef\seteq="3212 \mathchardef\in="3232 \mathchardef\ni="3233 \let\owns=\ni \mathchardef\gg="321D \mathchardef\ll="321C \mathchardef\not="3236 \mathchardef\leftrightarrow="3224 \mathchardef\leftarrow="3220 \let\gets=\leftarrow \mathchardef\rightarrow="3221 \let\to=\rightarrow \mathchardef\mapstochar="3237 \def\mapsto{\mapstochar\rightarrow} \mathchardef\sim="3218 \mathchardef\simeq="3227 \mathchardef\perp="323F \mathchardef\equiv="3211 \mathchardef\asymp="3210 \mathchardef\smile="315E \mathchardef\frown="315F \mathchardef\leftharpoonup="3128 \mathchardef\leftharpoondown="3129 \mathchardef\rightharpoonup="312A \mathchardef\rightharpoondown="312B \mathchardef\propto="322F \mathchardef\sqsubseteq="3276 \mathchardef\sqsupseteq="3277 \mathchardef\parallel="326B \mathchardef\mid="326A \mathchardef\dashv="3261 \mathchardef\vdash="3260 \mathchardef\nearrow="3225 \mathchardef\searrow="3226 \mathchardef\nwarrow="322D \mathchardef\swarrow="322E \mathchardef\Leftrightarrow="322C \mathchardef\Leftarrow="3228 \mathchardef\Rightarrow="3229 \end{verbatim} \subsection{4/5: Delimiters} \begin{verbatim} \mathcode`\(="4028 \mathcode`\)="5029 \mathcode`\[="405B \mathcode`\]="505D \mathcode`\{="4266 \mathcode`\}="5267 \delcode`\(="028300 \delcode`\)="029301 \delcode`\[="05B302 \delcode`\]="05D303 \def\lmoustache{\delimiter"437A340 } % top from (, bottom from ) \def\rmoustache{\delimiter"537B341 } % top from ), bottom from ( \def\lgroup{\delimiter"462833A } % extensible ( with sharper tips \def\rgroup{\delimiter"562933B } % extensible ) with sharper tips \def\backslash{\delimiter"26E30F } % for double coset G\backslash H \def\rangle{\delimiter"526930B } \def\langle{\delimiter"426830A } \def\rbrace{\delimiter"5267309 } \let\}=\rbrace \def\lbrace{\delimiter"4266308 } \let\{=\lbrace \def\rceil{\delimiter"5265307 } \def\lceil{\delimiter"4264306 } \def\rfloor{\delimiter"5263305 } \def\lfloor{\delimiter"4262304 } \def\arrowvert{\delimiter"26A33C } % arrow without arrowheads \def\Arrowvert{\delimiter"26B33D } % double arrow without arrowheads \def\bracevert{\delimiter"77C33E } % the vertical bar that extends braces \def\Vert{\delimiter"26B30D } \let\|=\Vert How should these be treated? \def\vert{\delimiter"26A30C } " " " " " \def\uparrow{\delimiter"3222378 } \def\downarrow{\delimiter"3223379 } \def\updownarrow{\delimiter"326C33F } \def\Uparrow{\delimiter"322A37E } \def\Downarrow{\delimiter"322B37F } \def\Updownarrow{\delimiter"326D377 } \end{verbatim} The comamnds \verb'\Configure{MathClass}{4}...' and \verb'\Configure{MathClass}{5}...' are for unmatched delimiters, and the comamnd \verb'\Configure{MathDelimiters}{(}{)}' is for matched ones. \<<< \Configure{MathClass}{4}{}{}{}{} \Configure{MathDelimiters}{(}{)} \Configure{MathDelimiters}{[}{]} \Configure{MathDelimiters}{\mathchar"4262}{\mathchar"5263} \Configure{MathDelimiters}{\mathchar"4264}{\mathchar"5265} \Configure{MathDelimiters}{\mathchar"4266}{\mathchar"5267} \Configure{MathDelimiters}{\mathchar"4268}{\mathchar"5269} \Configure{MathDelimiters}{\mathchar"4300}{\mathchar"5301} \Configure{MathDelimiters}{\mathchar"4302}{\mathchar"5303} \Configure{MathDelimiters}{\mathchar"4304}{\mathchar"5305} \Configure{MathDelimiters}{\mathchar"4306}{\mathchar"5307} \Configure{MathDelimiters}{\mathchar"4308}{\mathchar"5309} \Configure{MathDelimiters}{\mathchar"430A}{\mathchar"530B} >>> \begin{verbatim} \mathcode`\?="503F \end{verbatim} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{6: Punctuation Marks} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{verbatim} \mathcode`\;="603B \mathcode`\,="613B \end{verbatim} \<<< \Configure{MathClass}{6}{}{}{}{ \mathchar"613A % ldot \mathchar"603A % colon !?; , } >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Questions} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{verbatim} \delcode`\<="26830A \delcode`\>="26930B \delcode`\|="26A30C \delcode`\\="26E30F % N.B. { and } should NOT get delcodes; otherwise parameter grouping fails! \def\mathhexbox#1#2#3{\leavevmode \hbox{$\m@th \mathchar"#1#2#3$}} \def\dag{\mathhexbox279} \def\ddag{\mathhexbox27A} \def\S{\mathhexbox278} \def\P{\mathhexbox27B} \end{verbatim} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Type 4: Math Open} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% latex.ltx, fontmath.ltx, plain.tex %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Packages} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%% \section{Small Ones} %%%%%%%%%%%%%%%%%% \<<< \Configure{thousandsep} {\ifmathml \ifmtext\else \Tg<\a:mathml mspace width="0.25em"/>\fi \fi} >>> %%%%%%%%%%%%% \subsection{subeqnarray} %%%%%%%%%%%%% \<<< \Configure{subeqnarray} {\HCode{<\a:mathml mtable\Hnewline \mml:class="subeqnarray\ifx \@seqncr\@eqncr\else-star\fi" \a:mathml columnalign="right center left" >}}% {\HCode{}} {\HCode{<\a:mathml mtr>}} {\HCode{}} {\Tg<\a:mathml mtd\Hnewline \mml:class="subeqnarray-\HCol"> \ifnum \HCol=4 \Tg<\a:mathml mtext \mml:class="subeqnarray">|\PauseMathClass \mtexttrue |% \fi} {\ifnum \HCol=4 \mtextfalse \EndPauseMathClass|\Tg\fi \Tg} >>> %%%%%%%%%%%%% \subsubsection{Bm} %%%%%%%%%%%%% \<<< \Configure{bm} {\ifmmode \ifmtext \else \Tg<\a:mathml mstyle mathvariant="bold">% \expandafter\expandafter\expandafter\:gobble \fi\fi} {\ifmmode \ifmtext \else \Tg\fi\fi} >>> The bm commands produces bold printing by overprinting the characters with small shifting. %%%%%%%%%%%%%%%%%% \section{Color} %%%%%%%%%%%%%%%%%% \<<< \Configure{textcolor} {\gHAdvance\textcolorN by 1 \Configure{color}% {\Configure{SetHColor} {\Css{.textcolor\textcolorN{color:\HColor}}}}% \HCode{<\ifmathml\a:mathml mstyle\else span\fi \space id="textcolor\textcolorN">}}% {\HCode{}} >>> \<<< \Configure{textcolor} {\ifmathml \Configure{color}% {\Configure{SetHColor} {\HCode{<\a:mathml mstyle mathcolor="\HColor">}}}% \else \gHAdvance\textcolorN by 1 \Configure{color}% {\Configure{SetHColor} {\Css{\#textcolor\textcolorN{color:\HColor}}}}% \HCode{}% \fi }% {\HCode{}} >>> %%%%%%%%%%%%%%%%% \section{mhchem} %%%%%%%%%%%%%%%% \<<< \Configure{mhchemcf}{\bgroup\HCode{<\:mhmathmlorhtml{mrow}{span}\space class="mhchem-cf">}}{\HCode{}\egroup} \Configure{mhchemce}{\bgroup\HCode{<\:mhmathmlorhtml{mrow}{span}\space class="mhchem-ce">}}{\HCode{}\egroup} % we configure subscripts and superscripts to have empty bases. it is because if superscript followed subscript, we got wrong % MathML markup, with mismatched tags. For example: \ce{CrO4^2-} \Configure{mhchemsub}{% \:mhmathmlorhtml{% \HCode{<\a:mathml msub><\a:mathml mrow>}% }{% \HCode{}}% }{\:mhmathmlorhtml{\Tg\TG}{\HCode{}}} \Configure{mhchemsup}{% \:mhmathmlorhtml{ \HCode{<\a:mathml msup><\a:mathml mrow>}% }{% \HCode{}}% }{\:mhmathmlorhtml{\Tg\TG}{\HCode{}}} \Configure{mhchemsupsub}{\setbox0=\hbox\bgroup$}{$\egroup\setbox1=\hbox\bgroup$}{$\egroup\HCode{<\a:mathml msubsup><\a:mathml mrow><\a:mathml mrow>}\box1\HCode{<\a:mathml mrow>}\box0\HCode{}} \Configure{mhchemisotope}{\setbox0=\hbox\bgroup$}{$\egroup\setbox1=\hbox\bgroup$}{$\egroup\HCode{<\a:mathml msubsup><\a:mathml mrow><\a:mathml mrow>}\box1\HCode{<\a:mathml mrow>}\box0\HCode{}} % mhchemoperator is always used inside \HCode, so we need not to use \HCode in it's configuration \Configure{mhchemoperator}{<\:mhmathmlorhtml{mo \a:mathml stretchy="false" }{span} class="mhchem-operator">}{} \Configure{mhchemarrow}{\HCode {<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow">\:mhonlyinmathml{\a:mhchemoperator}}\PauseMathClass}{\EndPauseMathClass\HCode{\:mhonlyinmathml{\b:mhchemoperator}}} \Configure{mhchemarrowabove}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-above">\:mhonlyinmathml{\a:mhchemoperator}}\PauseMathClass}{\EndPauseMathClass\HCode{\:mhonlyinmathml{\b:mhchemoperator}}} \Configure{mhchemarrowyields}{\ensuremath{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x27F6;\:mhonlyinmathml{\b:mhchemoperator}}}} \Configure{mhchemarrowyieldsLeft}{\ensuremath{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x27F5;\:mhonlyinmathml{\b:mhchemoperator}}}} \Configure{mhchemarrowyieldsLeftRight}{\ensuremath{\HCode{<\a:mathml munder class="mhchem-arrow-larger"><\a:mathml mrow><\a:mathml mpadded height="0" depth="0.3em"><\a:mathml mo stretchy="false" >&\#x27F5; <\a:mathml mrow><\a:mathml mpadded depth="0" height="0"><\a:mathml mo stretchy="false">&\#x27F6;} }} \Configure{mhchemarrowmesomerism}{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x2194;\:mhonlyinmathml{\b:mhchemoperator}}} % todo: improve % \Configure{mhchemarrowequilibrium}{\ensuremath{\HCode{<\:mhmathmlorhtml{mrow}{span} class="mhchem-arrow-normal">\:mhonlyinmathml{\a:mhchemoperator}&\#x21cc;\:mhonlyinmathml{\b:mhchemoperator}}}} % todo: improve \Configure{mhchemarrowequilibrium}{\ensuremath{\HCode{<\a:mathml munder class="mhchem-arrow-larger"><\a:mathml mrow><\a:mathml mpadded height="0" depth="0" voffset="-0.1em" ><\a:mathml mo stretchy="true" >&\#x21c0; <\a:mathml mpadded height="0" depth="0" ><\a:mathml mo stretchy="false">&\#x21bd;} }} % todo: improve % this configuration is inspired by the MathML code from MathJax. There is a problem with vertical positioning of arrows, so we need to use % the element to fix that. It is still not perfect, moreover, there is a difference in rendering between % vanilla Firefox and MathJax's MathML \Configure{mhchemarrowequilibriumRight} {\ensuremath{\HCode{<\a:mathml munder class="mhchem-arrow-larger"><\a:mathml mrow><\a:mathml mpadded height="0" depth="1" voffset="3px"><\a:mathml mo stretchy="true" >&\#x21c0; <\a:mathml mpadded height="0" depth="1" voffset="2px"><\a:mathml mspace width="0.167em"><\a:mathml mo stretchy="false">&\#x21bd;<\a:mathml mspace width="0.167em">} }} % todo: improve \Configure{mhchemarrowequilibriumLeft} {\ensuremath{\HCode{<\a:mathml munder class="mhchem-arrow-larger"><\a:mathml mrow><\a:mathml mpadded height="0" depth="1" voffset="4px"><\a:mathml mspace width="0.167em"><\a:mathml mo stretchy="false">&\#x21c0;<\a:mathml mspace width="0.167em"> <\a:mathml mpadded height="0" depth="1" voffset="2px"><\a:mathml mo stretchy="true" >&\#x21bd;} }} % todo: improve % this is not the right symbol % \Configure{mhchemarrowequilibriumRight}{\a:mhchemoperator\HCode{&\#x2942;}\b:mhchemoperator } % todo: improve % \Configure{mhchemarrowequilibriumLeft}{\a:mhchemoperator\HCode{&\#x2943;}\b:mhchemoperator} % todo: improve \Configure{mhchembondhalf}{\HCode{&\#xfe4d;}} \Configure{mhchembondoneandhalf}{\HCode{&\#x2212;&\#xfe4d;}} \Configure{mhchembondtwoandhalf}{\HCode{=&\#xfe4d;}} \Configure{mhchembondtwoandhalff}{\HCode{&\#x2212;&\#x2212;&\#xfe4d;}} | >>> This is a local redefinition of the text over and under arrow handling code for MathML. We need to do change the sequence of elements that are printed to support the munderover element easily. \<<< \ExplSyntaxOn \cs_set_protected:Npn \__mhchem_arrow_deployfourht:nnnnn #1#2#3#4#5 { \bgroup \ensuremath{% % we need to test if the text is larger than arrow. if it is, the math operator needs to be stretchy. % otherwise, it must be not stretchy, otherwise the text over arrow will be aligned to the right \setbox0=\hbox{\tl_if_empty:nF {#3#5} { \str_case:nnF {#2} { { } { \ce{ #5 } } { M } { { #5 } } { T } { \text{ #5 } } { C } { \ce{ #5 } } } { \msg_error:nnn { mhchem } { unexpected-arrow-type } {#2} } }} \setbox1=\hbox{\tl_if_empty:nF {#3#5} { \str_case:nnF {#2} { { } { \ce{ #3 } } { M } { { #3 } } { T } { \text{ #3 } } { C } { \ce{ #3 } } } { \msg_error:nnn { mhchem } { unexpected-arrow-type } {#2} } }} % now compare dimensions of boxes and change math stretchines \ifdim \wd0>1em \Configure{mhchemoperator}{<\a:mathml mo~\a:mathml stretchy="true"~\a:mathml class="mhchem-operator">}{} \else \ifdim \wd1>1em \Configure{mhchemoperator}{<\a:mathml mo~\a:mathml stretchy="true"~\a:mathml class="mhchem-operator">}{} \fi \fi \a:mhchemmathlarrow \str_case:nnF {#1} { { yields } {\a:mhchemarrowyields } { yieldsLeft } {\a:mhchemarrowyieldsLeft } { yieldsLeftRight } {\a:mhchemarrowyieldsLeftRight } % todo: improve { esomerism } {\a:mhchemarrowesomerism } % todo: improve { equilibrium } {\a:mhchemarrowequilibrium } % todo: improve { equilibriumRight } {\a:mhchemarrowequilibriumRight } % todo: improve { equilibriumLeft } {\a:mhchemarrowequilibriumLeft } % todo: improve } { \msg_error:nnn { mhchem } { unexpected-arrow-type } {#1} } \b:mhchemmathlarrow \box0 \c:mhchemmathlarrow \box1 \d:mhchemmathlarrow } \egroup } \HRestore\__mhchem_arrow_deploy:nnnnn \HLet\__mhchem_arrow_deploy:nnnnn\__mhchem_arrow_deployfourht:nnnnn \ExplSyntaxOff \NewConfigure{mhchemmathlarrow}{4} \Configure{mhchemmathlarrow}{\HCode{<\a:mathml munderover><\a:mathml mrow>}}{\HCode{<\a:mathml mpadded>}}{\HCode{<\a:mathml mpadded>}}{\HCode{}} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{siunitx} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< % redefinitions of Expl 3 syntax commands \ExplSyntaxOn | \ExplSyntaxOff >>> \<<< % this fixes circle in degree celsius not printed as superscript \siunitx_declare_unit:Ne \degreeCelsius { \HCode{<\a:mathml msup><\a:mathml mrow /><\a:mathml mi>&\#x2218;} C } >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Notes} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{To Do} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{itemize} \item Parametric commands as Superscripts or Subscripts: \verb+$E^\frac{1}{2}$+ (instead of \verb+$E^{\frac{1}{2}}$+). \item Numbering is not right justified: \begin{verbatim} \documentclass{amsart} \begin{document} \begin{eqnarray} A &=& B + C \end{eqnarray} \begin{align} A &= B + C \qquad & N &= G + F \end{align} \begin{alignat}{2} A &= B + C \qquad \qquad & N & = G + F \end{alignat} \begin{gather} A = B + C \tag{my equation} \\ B = \text{variable unknown} \notag \\ Y = \max X + \log 10 \end{gather} \end{document} \end{verbatim} \item \begin{verbatim} \begin{align} e &= a + b \\ \intertext{this should be located on the left browser hand margin} a &= u \end{align} \end{verbatim} \end{itemize} \endinput