Convert mathematical equations to SVGs, PNGs, or MathML. A general wrapper to Lasem and mtex2MML.
All from https://github.com/gjtorikian/mathematical/pull/48:
nonumber
and notag
Single strings also return a hash with :data
and an optional :error
:
Forgot to do this as a PR. :crying_cat_face:
https://github.com/gjtorikian/mathematical/pull/42:
:data
exception
, containing the error class (with message)This is a m-m-m-massive change in usability. Over the past few weeks I've been hacking away at Mathematical and mtex2mml in my free time to get the projects in an improved state. Here's what's around for this release:
Get to better compatibility with LaTeX math. We were at 68% compatibility with MathJax, we're now at 82% :metal:.
With that compatibility comes equation numbering support. :tada:. In LaTeX, you can mark equations as "numbered," such that they increment automatically:
% this is marked as "1"
$$
\begin{align}
B'&=-\nabla \times E,\\
E'&=\nabla \times B - 4\pi j,
\end{align}
$$
% this is marked as "2"
$$
\begin{align}
A &= \left(\int_t XXX \right. \
&\qquad \left.\vphantom{\int_t} YYY \dots \right)
\end{align}
$$
Previously, Mathematical worked on a one string in, one string out model. Now, if you pass in an array of strings, it'll mark them up appropriately.
Rather than Mathematical::Render
, which made no sense, 1.0.0 moves to a simpler Mathematical.render
. There was no need for the additional class.
Errors are now also printed to STDERR (as well as raised). This is especially relevant for passing in an array of equations. If an exception is caught, rather than bail completely, the error message is thrown out, and Mathematical continues humming down the list, processing items. This way, one bad equation doesn't stall out all the other good ones.
C classes have been split up for easier working, eg rendering callbacks are in their own file.
Did you know every single letter in the alphabet can start a LaTeX equation? I did! How? The SUPPORTED.md file has been reorganized alphabetically, for easier scanning.