# Reaction sheme for Saponification with chemfig: horizontal and vertical placement

I want to draw the formation of a fat molecule like shown in the picture below

I tried with hspace/vspace and yshift:

\documentclass[margin=2cm]{standalone}
\usepackage{chemfig}
\begin{document}
\schemestart
\chemfig{C(-[2,0.7])(-[4,0.7])(-[0]\lewis{57,O}(-[1]H))(-[6,3]C(-[2,0.7])(-[4,0.7])(-[0]\lewis{57,O}(-[1]H))(-[6,3]C(-[2,0.7])(-[4,0.7])(-[0]\lewis{57,O}(-[1]H))(-[6,0.7])))} \+ \chemfig{\lewis{57,O}(-[4]H)(-[1]C(=[3]\lewis{24,O})(-C_{15}H_{31}))} \arrow{0}[,0] \hspace*{-4.125cm} \+ \chemfig{\lewis{57,O}(-[4]\textcolor{red}{H})(-[1]C(=[3]\lewis{24,O})(-C_{15}H_{31}))}  \chemmove[orientation/.style={rotate=0},xshift=-2cm, yshift=-2cm]{
\draw[orientation,draw=black,opacity=.2,fill=black!30]
node[pos=.25,above,opacity=1,orientation]{\+ \chemfig{\lewis{57,O}(-[4]\textcolor{red}{H})(-[1]C(=[3]\lewis{24,O})(-C_{15}H_{31}))}} ;
}
\schemestop
\end{document}


This isn't nice. How can I achieve a perfect alignment with chemfig?

• As the question has been translated I've tided up the comments Jun 30 '15 at 9:43

Only after I had the code finished I realised that your code shows something different than the picture. But the alignment idea should work nonetheless.

As you might know chemfig allows to add anchor names in compounds using the @{<name>} syntax which can be referred to in \chemmove for example, but also in arrows \arrow(@<name>--). The code below uses this for aligning the fatty acids \arrow(@OH1.base east--.base west){0}[,.2]:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{chemfig}
\begin{document}

\begin{center}
\small
\setatomsep{2em}
\schemestart
\subscheme{
\chemfig{
H-C(-[2]H)(
-[6,2]C(-[4]H)(-@{OH2}OH)
-[6,2]C(-[4]H)(-@{OH3}OH)
-[6]H
)
-@{OH1}OH
}
\arrow(@OH1.base east--.base west){0}[,.2]
\+ \chemname{\chemfig{C_{17}H_{33}COOH}}{Ölsäure}
\arrow(@OH2.base east--.base west){0}[,.2]
\+ \chemname{\chemfig{C_{3}H_{7}COOH}}{Buttersäure}
\arrow(@OH3.base east--.base west){0}[,.2]
\+ \chemname{\chemfig{C_{17}H_{35}COOH}}{Stearinsäure}
}
\arrow{<=>[Veresterung][Verseifung]}[,1.5]
\chemfig{
H-C(-[2]H)(
-[6,2]C(-[4]H)(-O-C(=[2]O)-C_{3}H_{7})
-[6,2]C(-[4]H)(-O-C(=[2]O)-C_{17}H_{35})
-[6]H
)
-O-C(=[2]O)-C_{17}H_{33}
}
\schemestop
\end{center}

\end{document}