Page MenuHomePhabricator

Add support for mhchem package in <math> markup
Closed, ResolvedPublic

Description

Author: ezyang

Description:
Currently, most chemical equations are represented in plain text or LaTeX (if
there are complicated arrows, ions or symbols). These systems are cumbersome and
difficult to use. Mhchem was developed as a solution for typesetting chemical
equations, and comes with a quite intuitive syntax, e.g.:

\ce{HCl + H2O -> Cl- + H3O+}

It would be nice if we could use this package in the math environment, i.e.
<math>\ce{C6H12O6 ->M[\Delta] 6C + 6H2O}</math>. Additionally, creating a <chem>
parser hook to automatically put the expression into \ce{} would offer nice
convenience.

There may be security issues with this, however. I do not know enough texvc to say.


Version: unspecified
Severity: enhancement
URL: http://www.tug.org/tex-archive/help/Catalogue/entries/mhchem.html
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=20902

Details

Reference
bz5856

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:14 PM
bzimport added a project: Math.
bzimport set Reference to bz5856.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 17133 has been marked as a duplicate of this bug. ***

mike.lifeguard+bugs wrote:

(In reply to comment #0)

Currently, most chemical equations are represented in plain text or LaTeX (if
there are complicated arrows, ions or symbols). These systems are cumbersome and
difficult to use. Mhchem was developed as a solution for typesetting chemical
equations, and comes with a quite intuitive syntax, e.g.:

\ce{HCl + H2O -> Cl- + H3O+}

It would be nice if we could use this package in the math environment, i.e.
<math>\ce{C6H12O6 ->M[\Delta] 6C + 6H2O}</math>. Additionally, creating a <chem>
parser hook to automatically put the expression into \ce{} would offer nice
convenience.

Yes, that'd be nice... but perhaps the best possible solution would be to have a <tex></tex> tag in addition, which will be agnostic as to what kind of TeX input it's getting. Then you can use
*normal TeX markup in <tex>, including $...$ etc for math and \ce{} for chem
*math markup in <math>, including \text{} for text and \ce{} for chem
*mhchem markup in <chem>, including $...$ etc for math and \text{} for text

zasnuty wrote:

Just if someone would search for solution:
Take a look at the bottom of site: http://wiki.biol.uw.edu.pl/w/Brudnopis#Pisanie_wzor.C3.B3w_chemicznych_z_u.C5.BCyciem_LaTeXa

(found here: http://www.mediawiki.org/wiki/User:PSt , there is also contact email given)

mal.malego wrote:

mhchem is available as an extension to MathJax. It may be worthwhile to add this support once MathJax is selected as the default rendering method.

physik wrote:

Seems a very old request (from 2006). Please reopen if still needed.

@Physikerwelt shouldn't this just work in MathML mode now? Or did mathoid intentionally dop the extension?

Physikerwelt changed the task status from Declined to Resolved.Feb 13 2016, 9:32 PM
Physikerwelt claimed this task.
Physikerwelt subscribed.