0

I'm trying to get the chemical names to align vertically in this reaction, but for some reason setting \chemnameinit to match the larger molecule doesn't seem to have any effect.

    \chemnameinit{\chemfig{C(-[6]CH_2OPO_3^{2-})(-[4]H)(-[0]OH)(-[2]C(=[1]O)(-[3]H))}}
\schemestart[0,2.5,thick]  %argument specifies arrow angle, length, style
    \chemname{\chemfig{C(=[0]O)(-[2]CH_2OH)(-[6]CH_2OPO_3^{2-})}}{Dyhydroxyacetone phophate}
    \arrow{<=>[Triose phophate isomerase]}
    \chemname{\chemfig{C(-[6]CH_2OPO_3^{2-})(-[4]H)(-[0]OH)(-[2]C(=[1]O)(-[3]H))}}{D-Glyceradldehyde 3-phophate}
\schemestop

enter image description here

0

You'll have to use anchors on your arrow: when you remove the arrow, the two structures align on the central carbon. So, changing the definition of your arrow to

\arrow(.base east--.base west){<=>[Triose phophate isomerase]}

gives you the alignment on the central carbons. So the full example would be:

\documentclass[]{article}
\usepackage{chemfig}

\begin{document}         
    \chemnameinit{%
        \chemfig{C(-[6]CH_2OPO_3^{2-})(-[4]H)(-[0]OH)(-[2]C(=[1]O)(-[3]H))}}
    \schemestart[0,2.5,thick][north]  %argument specifies arrow angle, length, style
    \chemname{%
         \chemfig{C(=[0]O)(-[2]CH_2OH)(-[6]CH_2OPO_3^{2-})}}%
              {Dyhydroxyacetone phophate}
    \arrow%
        (.base east--.base west)% <----ensures alignment on baseline
        {<=>[Triose phophate isomerase]}
    \chemname{%
         \chemfig{C(-[6]CH_2OPO_3^{2-})(-[4]H)(-[0]OH)(-[2]C(=[1]O)(-[3]H))}}%
              {D-Glyceradldehyde 3-phophate}
    \schemestop
\end{document}

(As an aside, it's considered good form here to give a complete code example, from \documentclass{...} to \end{document} to make it easier for others to compile your example and see what goes wrong (and play with it to find a solution)

|improve this answer|||||
  • Thanks @remco. Where does the \documentclass and \end{document} come from? I'm using texmath within libreoffice, and I suspect these are handled behind the scenes. – Phenomniverse May 4 '18 at 3:43
  • I had to add the extra lines to get an example that compiles with LaTeX compiler, assuming that that's what you used – remco May 7 '18 at 7:11

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.