Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I align multiple reactions to the reaction arrow using chemfig?

In the MWE, I want to align the two reactions to the arrow.

\documentclass{minimal}
\usepackage{chemfig}

\begin{document}

\chemfig{Cl}\chemsign+\chemfig{O_3}
\chemrel{->}
\chemfig{ClO}\chemsign+\chemfig{O_2}

\chemfig{ClO}\chemsign+\chemfig{O}
\chemrel{->}
\chemfig{Cl}\chemsign+\chemfig{O_2}

\end{document}

enter image description here

share|improve this question

2 Answers 2

up vote 4 down vote accepted
  • Here's a chemfig only way: use its \startscheme ... \stopscheme mechanism in combination with the invisible »arrow« 0 and the anchoring of TikZ nodes. The trick here:

    \arrow(@c1.south east--.north east){0}[-90,.1]
    

    an invisible arrow {0} pointing downwards (-90) and shortened (.1) that connects compound c1 with a new one, the former anchored south east and the latter north east. You can see what chemfig treats as compounds if you add \schemedebug{true} before the scheme.

    \documentclass{article}
    \usepackage{chemfig}
    \begin{document}
    \schemestart
      Cl \+ \printatom{O_3} \arrow ClO \+ \printatom{O_2}
      \arrow(@c1.south east--.north east){0}[-90,.1]
      ClO \+ O \arrow Cl \+ \printatom{O_2}
    \schemestop
    \end{document}
    

    enter image description here

  • As you've noted in your own answer chemfig can also be used in combination with amsmath's alignment environments, similar to the following proposals

  • Simple reactions like the ones shown in the question can also be typeset with mhchem and amsmath:

    \documentclass{article}
    \usepackage{mhchem}
    \usepackage{amsmath}
    \begin{document}
    \begin{align*}
      \cee{Cl + O3 &-> ClO + O2} \\
      \cee{ClO + O &-> Cl + O2}
    \end{align*}
    \end{document}
    

    enter image description here

  • Another possibility would be chemformula with amsmath oder chemmacros:

    \documentclass{article}
    \usepackage[ghsystem=false]{chemmacros}% loads amsmath and chemformula
    \begin{document}
    \begin{align*}
      \ch{Cl + O3 &-> ClO + O2} \\
      \ch{ClO + O &-> Cl + O2}
    \end{align*}
    \begin{reactions*}
      Cl + O3 &-> ClO + O2 \\
      ClO + O &-> Cl + O2
    \end{reactions*}
    \end{document}
    

    enter image description here

share|improve this answer
    
The last approach is what I was after for, thank you! A bit of a hax, but does the trick. –  Mappi Jul 27 at 16:43
    
I believe that the 0 arrow is there for such purposes. I often find it very useful! –  cgnieder Jul 27 at 16:46

chemfig can be used inside align environment. Thus, it can be done as

\documentclass{minimal}
\usepackage{chemfig}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\chemfig{Cl}\chemsign+\chemfig{O_3}
& \chemrel{->}
\chemfig{ClO}\chemsign+\chemfig{O_2} \\
\chemfig{ClO}\chemsign+\chemfig{O}
& \chemrel{->}
\chemfig{Cl}\chemsign+\chemfig{O_2}
\end{align*}

\end{document}

enter image description here

The downside of this answer is that the reactions are inside align and not chemfig. For example, you cannot scale the equations easily.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.