1

I want to show series of some chemical reactions on wordpress with QuickLaTeX using the popular chemfig and mhchem packages. However, I always encounter some problem.

For example I want to show reaction in series like this:

A + B -> C
D + E -> F
and much more like that

In Wordpress post I post like this isn't it

[latexpage]
\[
\ce{A+B->C} //
\ce{D+E->G}
\]

But // which creates new line don't work here. I get a single image which looks like this after it is rendered by WP-QuickLaTeX

A+B->CD+E->G

Is there some way that we can do to WP-QuickLaTeX so it do with codes what we do in LaTeX editor like TeXmaker?

3
  • @clemens it don't work it gives same result as in above post .
    – user80946
    Jun 27, 2015 at 15:49
  • @clemens hmm i don't need that but i want to know is there anyway i write chemical reaction fast and quick in website . I wrote latex code in editor and i got all those reaction in pdf now i need to wrap every equation to show in website using [....] is there better way?
    – user80946
    Jun 27, 2015 at 15:55
  • I don't know about Wordpress and line wrapping there. But you should write \ce{A + B -> C} (with four spaces). The spaces are important in mhchem syntax.
    – mhchem
    Jun 28, 2015 at 19:03

1 Answer 1

2

The code with QuickLaTeX is just the same as you would do in LaTeX as QuickLaTeX uses a TeX Live distribution. The LaTeX code

\documentclass{article}
\begin{document}

\[
  xxx \\ yyy
\]

\end{document}

just gives one line xxxyyy because you cannot have a linebreak in a single equation. This still holds of course when you use \ce{...} and it also holds for QuickLaTeX. My guess is that your confusion comes from the fact that on a [latexpage] math input with $...$ and \[...\] works natively within a WP post. But there are more possibilities, see below.

If you want alignment with mhchem then you can combine it with amsmath's alignment environments:

\documentclass{article}
\usepackage{amsmath}
\usepackage[version=4]{mhchem}
\begin{document}

\begin{align*}
  \ce{A + B &-> D} \\
  \ce{C + F &-> X + Y}
\end{align*}

\end{document}

enter image description here

The same works as QuickLaTeX code for WordPress, too:

[latex]
[preamble+]
\usepackage{amsmath}
\usepackage[version=4]{mhchem}
[/preamble]
\begin{align*}
  \ce{A + B &-> D} \\
  \ce{C + F &-> X + Y}
\end{align*}
[/latex]

or

[latexpage]

\begin{align*}
  [preamble+]\usepackage[version=4]{mhchem}[/preamble]
  \ce{A + B &-> D} \\
  \ce{C + F &-> X + Y}
\end{align*}

both give on my blog:

enter image description here

According to QuickLaTeX's homepage the following is valid on a [latexpage] so loading of amsmath is not necessary in the second case.

Support of native LaTeX shorthands embedded in the text: $ ... $, \[ ... \], \( ... \), $$ ... $$ and environments: equation, align, displaymath, eqnarray, multline, flalign, gather, and alignat.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .