4

I've just started using the chemfig package for drawing some chemistry. However there is a problem with vertical alignment. The vertical alignment of "2 Water", reaction arrow and "2 ABC" is complety random. How can I align them to the same vertical position?

Also I would like to know, how to rotate the second ring to align it into the same orientation as the first one?

\documentclass{article}
\usepackage{chemfig}
\usepackage{tikz}
\usepackage[ngerman]{babel}
\usetikzlibrary{babel}
\tikzstyle{arrow}=[draw, -latex]

\begin{document}


\schemestart
2 Water + \chemfig{O=[:-90]*5(-[@{b1}]O-[@{b2}](@{a1})-(@{a2})-[@{b4}]O-[@{b5}])} \arrow{->[+2 $H^+$]} \chemfig{*5(-[@{b1}]O-[@{b2}](@{a1})-(@{a2})-[@{b4}]O-[@{b5}])} + 2 ABC
\schemestop


\end{document}

Screenshot

4

chemfig always places the first atom of the molecule on the baseline, so you have to rewrite the molecule with the atom you want to be on the baseline first. For example,

\documentclass{article}

\usepackage{chemfig}
\usepackage{chemformula}
% \schemedebug{true} % Uncomment this to see how it works

\begin{document}

\schemestart
\chemfig{\ch{2 "Water"}}
\+
\chemfig{[:-54]O*5(---O-(=O)-)}
\arrow(.mid east--.mid west){->[\ch{2 H^+}]}
\chemfig{[:-54]O*5(---O--)}
\+
\chemfig{\ch{2 ABC}}
\schemestop

\end{document}

gives

enter image description here

Note that

  1. TikZ is already loaded by Chemfig, so you don't need \usepackage{tikz};
  2. I've wrapped chemical notation in math or text with chemformula's \ch command.
  3. I've used anchors in the \arrow to keep the molecules aligned. They're described in Chemfig's manual, from p. 50.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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