myChemistry

chemistry, typesetting and LaTeX

myChemistry and QuickLaTeX

| 1 Comment

I just discovered, that it is possible to display myChemistry directly on the web site using QuickLaTeX. For some reason though, it’s not possible to use it directly in the exact meaning of the word.
This code

$
[preamble]
\usepackage{mychemistry}
[/preamble]
\begin{rxn}
\reactant{\chemfig{*6(=-=-=-)}} \arrow[,,1.5]{\ce{Br2}, \ce{AlBr3}}{\ce{- HBr}}\reactant{\chemfig{*6(=-=(-Br)-=-)}}
\end{rxn
}
$

will fail:
<img src="http://www.mychemistry.eu/wp-content/ql-cache/quicklatex.com-afbe3d258f4ebf8a7ddff1c22f67951b_l3.png" height="113" width="424" class="ql-img-picture " alt="Rendered by QuickLaTeX.com" title="Rendered by QuickLaTeX.com"/>
If you put it inside of a node of a tikzpicture, however, it is working:

[preamble]
\usepackage{mychemistry}
[/preamble]
\begin{tikzpicture}
\node{
\begin{rxn}
\reactant{\chemfig{*6(=-=-=-)}} \arrow[,,1.5]{\ce{Br2}, \ce{AlBr3}}{\ce{- HBr}}\reactant{\chemfig{*6(=-=(-Br)-=-)}}
\end{rxn}
};
\end{tikzpicture
}

Rendered by QuickLaTeX.com

Update 2011/05/09: Pavel Holoborodko, the developer of QuickLaTeX told me (a) that he is going to add support for direct use of ChemFig and myChemistry in the next release of QuickLaTeX and (b) a slightly simpler workaround:

[latex]
%\begin{tikzpicture}\end{tikzpicture}
\begin{rxn}
\mesomeric{
\reactant{
\chemfig{*6(=[@{e1}]-=-(-[:120]X)(-[:60]H)-(-[:-30,.4,,,white]\oplus)-[@{e2}])}
\elmove{e1}{60:4mm}{e2}{0:4mm}
}
\marrow
\reactant{
\chemfig{*6(-(-[:90,.4,,,white]\oplus)-[@{e4}]=[@{e3}]-(-[:120]X)(-[:60]H)-=)}
\elmove{e3}{180:4mm}{e4}{150:4mm}
}
\marrow
\reactant{
\chemfig{*6(-=-(-[:-150,.4,,,white]\oplus)-(-[:120]X)(-[:60]H)-=)}
}
}
\end{rxn
}
[/latex]

Rendered by QuickLaTeX.com

You can use this in comments as well. :-)

One Comment

  1. Pavel Holoborodko really is a fast guy. Just a day later he released an update to QuickLaTeX, that naturally supports ChemFig and myChemistry. We now don’t need the tikzpicture workaround any more!

    [latex]\chemfig{[:30]--[::-60]-OH}[/latex]

    \chemfig{[:30]--[::-60]-OH}

Leave a Reply

Required fields are marked *.