5

I am using chemfig to draw a reaction that splits into two and then goes to one final molecules. I have managed to use nodes to get the arrows to go from the second molecule and split into the two alternatives, however, the two alternative molecules are not aligned. Secondly, I only get errors with my code if i use e.g. \tiny to get the label on the reactions arrows to be smaller in font size.

How can I align the molecules above each other? How can I change the text size?

reactions which is not aligned, see orange lines

I have made it as following:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{chemfig}

    \begin{document}

    \begin{tikzpicture} 
    \setatomsep{1.4em}
    \schemestart
    \chemfig{[:210]O*3(-(-(*6(-=-=-=)))-(-)-)} 
    \arrow{<=>[x]}[,1.3,thick,teal]
    \chemfig{*6(-=-(-(<[2]\color{red}{O}H)-[-0.7](<:[-2]\color{red}{O}H)-)=-=)} 
    \arrow{<=>[enzyme]}[45,1,thick,teal]
    \chemfig{*6(-=-(-(<[2]\color{red}{O}H)-[-0.7](=[-2]\color{red}{O})-CH3)=-=)}
    \arrow{<=>[enzyme]}[-40,1,thick,teal]
    \chemfig{*6(-=-(-(=[2]\color{red}{O})-[-0.7](<:[-2]\color{red}{O}H)-CH3)=-=)}
    \arrow(@c2--.north west){<=>[enzyme]}[-45,1,thick,teal]
    \chemfig{*6(-=-(-(=[2]\color{red}{O})-[-0.7](<:[-2]\color{red}{O}H)-CH3)=-=)}
    \arrow(@c5--@c4){<=>[enzyme]}[,1,thick,teal] 
    \schemestop
    \end{tikzpicture}


    \end{document}

1 Answer 1

3
+50

If you start the arrows from symmetric points on the @c2 molecule, i.e. from north west and south west, you can align the alternative molecules. Surrounding the reaction scheme with tikzpicture is unnecessary, as far as I know, and without the tikzpicture, you can set the label font size to \tiny just fine:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{chemfig}

\begin{document}

%\begin{tikzpicture} 
    \setatomsep{1.4em}
    %\schemedebug{true}
    \schemestart
    \chemfig{[:210]O*3(-(-(*6(-=-=-=)))-(-)-)} 
    \arrow{<=>[\tiny x]}[,1.3,thick,teal]
    \chemfig{*6(-=-(-(<[2]\color{red}{O}H)-[-0.7](<:[-2]\color{red}{O}H)-)=-=)} 
    \arrow(.north east--.south west){<=>[\tiny enzyme]}[45,1,thick,teal] % added anchors
    \chemfig{*6(-=-(-(<[2]\color{red}{O}H)-[-0.7](=[-2]\color{red}{O})-CH3)=-=)}
    \arrow(.south east--.north west){<=>[\tiny enzyme]}[-45,1,thick,teal]  % added anchors, corrected angle
    \chemfig{*6(-=-(-(=[2]\color{red}{O})-[-0.7](<:[-2]\color{red}{O}H)-CH3)=-=)}
    \arrow(@c2.south east--.north west){<=>[\tiny enzyme]}[-45,1,thick,teal] % added start anchor
    \chemfig{*6(-=-(-(=[2]\color{red}{O})-[-0.7](<:[-2]\color{red}{O}H)-CH3)=-=)}
    \arrow(@c5.north [email protected] west){<=>[\tiny enzyme]}[,1,thick,teal] % added anchors
    \schemestop
%\end{tikzpicture}

\end{document}

enter image description here

2
  • Thanks! The alignment now looks great; however, I have to use the tikz environment (tikzpicture) otherwise the script wont run due to collision with some other packages that I'm using. Is there anyway to change the font size while using the tikz environment? Mar 30, 2017 at 13:47
  • 1
    I don't know for sure if this will fix your compatibility problems, but you might try to surround the scheme into \begin{tikzpicture}\node {...};\end{tikzpicture} This allowed, at least for me, to set the font size to \tiny.
    – aehrm
    Mar 30, 2017 at 22:07

You must log in to answer this question.

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