|
|
|
# itex2MML extension
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
* [MathJax TeX and LaTeX Support](http://docs.mathjax.org/en/latest/tex.html) ;
|
|
|
|
[TeX Input Jax](https://github.com/mathjax/MathJax/blob/master/unpacked/jax/input/TeX/jax.js) ;
|
|
|
|
[TeX Extensions](https://github.com/mathjax/MathJax/tree/master/unpacked/extensions/TeX)
|
|
|
|
|
|
|
|
* [itex Commands](http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html) ; [Source](http://golem.ph.utexas.edu/~distler/code/itexToMML/changes)
|
|
|
|
|
|
|
|
## General syntax
|
|
|
|
|
|
|
|
* In itex, inline equations are demarcated by $ $. Display equations are demarcated by $$ $$ or \[ \].
|
|
|
|
|
|
|
|
Should the itex2MML define these default delimiters?
|
|
|
|
|
|
|
|
* In itex, $pin$ is a single token, which is translated into
|
|
|
|
<mi>pin</mi> in
|
|
|
|
MathML. $p i n$, on the other hand, is three tokens, which is translated into
|
|
|
|
<mi>p</mi><mi>i</mi><mi>n</mi> in MathML.
|
|
|
|
TeX makes no distinction between these two.
|
|
|
|
|
|
|
|
The itex2MML extension must override MathJax.InputJax.TeX to treat multiple
|
|
|
|
letters as a single variable.
|
|
|
|
|
|
|
|
* It is possible (though probably not recommended) to insert MathML markup
|
|
|
|
inside itex equations. So "<" and ">" are significant. To obtain a less-than
|
|
|
|
or greater-than sign, you should use \lt or \gt, respectively.
|
|
|
|
|
|
|
|
MathJax supports \lt or \gt. It does not seem worth allowing MathML in TeX.
|
|
|
|
|
|
|
|
## The svg Environment
|
|
|
|
|
|
|
|
\begin{svg} ... \end{svg} allows you to embed snippets of SVG in itex
|
|
|
|
equations. To assist in Instiki's LaTeX export feature, you can also include
|
|
|
|
a graphicx command: \begin{svg} ... \end{svg}
|
|
|
|
\includegraphics[width=...]{foo} where foo.pdf is a file containing a PDF
|
|
|
|
version of the graphic. In itex, the \includegraphics command is defined as a
|
|
|
|
NOOP, and the SVG is embedded in the MathML output. In Instiki's LaTeX
|
|
|
|
export, the opposite is true: the svg environment is a NOOP, and the
|
|
|
|
\includegraphics command is included in the output.
|
|
|
|
|
|
|
|
The itex2MML extension can define \includegraphics as a NOOP. Including
|
|
|
|
SVG inside the TeX source might be a more difficult, cf for example the
|
|
|
|
issue with \verb. For example, with itex2MML
|
|
|
|
\begin{svg} <svg><text>\end{svg}</text> \end{svg} is an
|
|
|
|
error and \begin{svg} <svg><text>\end{svg</text> \end{svg}
|
|
|
|
generates invalid markup.
|
|
|
|
|
|
|
|
## WebTeX-style Arrays and Array Options
|
|
|
|
|
|
|
|
The itex2MML extension should implement the following array options:
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
\array
|
|
|
|
\arrayopts
|
|
|
|
\collayout (=\colalign),
|
|
|
|
\rowalign,
|
|
|
|
\align,
|
|
|
|
\eqcols,
|
|
|
|
\eqrows,
|
|
|
|
\collines,
|
|
|
|
\rowlines,
|
|
|
|
\frame,
|
|
|
|
\padding
|
|
|
|
\rowopts
|
|
|
|
\colalign,
|
|
|
|
\rowalign
|
|
|
|
\cellopts
|
|
|
|
\colalign,
|
|
|
|
\rowalign,
|
|
|
|
\rowspan,
|
|
|
|
\colspan
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
## Greek Letters
|
|
|
|
|
|
|
|
Missing commands:
|
|
|
|
\Alpha, \Beta, \Zeta, \Eta, \Iota, \Kappa, \Mu, \Nu, \Pho, \Tau, \Upsi
|
|
|
|
|
|
|
|
## Log-like Symbols
|
|
|
|
|
|
|
|
All commands are supported.
|
|
|
|
|
|
|
|
## Arrows
|
|
|
|
|
|
|
|
Missing commands: \embedsin, \to, \nearr, \nwarr, \searr, \swarr,
|
|
|
|
\neArrow \nwArrow \seArrow \swArrow, \darr, \uparr, \downuparrow
|
|
|
|
\leftsquigarrow, \curvearrowbotright, \righttoleftarrow,
|
|
|
|
\lefttorightarrow
|
|
|
|
|
|
|
|
## Extensible Arrows
|
|
|
|
|
|
|
|
\xrightarrow and \xmapsto are supported by the extpfeil extension. The
|
|
|
|
itex2MML extension can implement other commands similarly.
|
|
|
|
|
|
|
|
## Delimiters
|
|
|
|
|
|
|
|
Missing commands: \lang and \rang
|
|
|
|
|
|
|
|
## Operators
|
|
|
|
|
|
|
|
Missing commands:
|
|
|
|
|
|
|
|
\bottom \minusb \plusb \timesb \intersection \union \VDash \nequiv \notni \invamp \Del \odash \Perp \sslash \nsubset \nsupset \qed \coloneqq \Coloneqq \coloneq \Coloneq \eqqcolon \Eqqcolon \eqcolon \Eqcolon \colonapprox \Colonapprox \colonsim \Colonsim \dblcolon
|
|
|
|
|
|
|
|
In keeping with AMSLaTeX, rather than MathML's conventions, \smallsetminus
|
|
|
|
is designated as a small (non-stretchy) reverse solidus, \backslash is a
|
|
|
|
reverse solidus. \setminus is stretchy.
|
|
|
|
|
|
|
|
The itex2MML extension should modify the MathJax's default behavior.
|
|
|
|
|
|
|
|
## Symbols
|
|
|
|
|
|
|
|
Missing command: \infinity
|
|
|
|
|
|
|
|
## Dots
|
|
|
|
|
|
|
|
Missing command: \udots
|
|
|
|
|
|
|
|
## Large Math Operators and Integrals
|
|
|
|
|
|
|
|
Missing commands: \Union, \Intersection, \Oplus, \Otimes, \bigsqcap,
|
|
|
|
\biginterleave, \Wedge, \Vee, \coproduct
|
|
|
|
|
|
|
|
## Sizes and Styles
|
|
|
|
|
|
|
|
Missing commands: \textsize, \scriptscriptsize, \mathfr
|
|
|
|
|
|
|
|
## Spaces
|
|
|
|
|
|
|
|
Missing commands: \medspace, \thickspace, \negspace, \mathrlap, \mathllap, \mathclap
|
|
|
|
|
|
|
|
## Accents
|
|
|
|
|
|
|
|
Missing commands: \closure, \widebar, \widevec, \widecheck, \slash
|
|
|
|
|
|
|
|
## Fractions, Sub/Superscripts and Roots
|
|
|
|
|
|
|
|
Missing commands: \underoverset, \tensor, \multiscripts, \mathraisebox
|
|
|
|
|
|
|
|
## Numbers
|
|
|
|
|
|
|
|
itex2MML does its best to intelligently parse what's a number and what's not. Unfortunately, conventions for things like decimal markers are very culture-dependent, and incompatibly-so. If you don't like the way itex2MML parses the would-be numbers in your input, you can force it to interpret a certain string as a number, using the \itexnum{} command.
|
|
|
|
|
|
|
|
The extension should modify the number parsing and add the \itexnum command.
|
|
|
|
|
|
|
|
## Colors
|
|
|
|
|
|
|
|
\color is already supported (perhaps with the color extension for the named
|
|
|
|
colors).
|
|
|
|
|
|
|
|
Missing command: \bgcolor
|
|
|
|
|
|
|
|
## Interactivity
|
|
|
|
|
|
|
|
Missing commands: \statusline, \tooltip.
|
|
|
|
|
|
|
|
\toggle is implemented differently (as a 2-parameters command).
|
|
|
|
|