# Horizontal and vertical alignment of chemfig structures

I'd like to align these four chemfig structures, seen below, horizontally and vertically. (The centers of the rectangles are vertices of a new rectangle. I would prefer an automatic solution.)

\documentclass{article}

\usepackage{chemfig}

\begin{document}

\setchemfig{compound style={draw,inner sep=6pt}}

\schemestart
A
\arrow
B
\arrow(@c1--)[-90,1]
C
\arrow
\chemfig{CH_3CH_2CHCH_2CH_3([6,,5]-OH)}
\arrow(@c4.north--@c2.south)
\schemestop

\end{document}

• Please make your code compilable. Currently one recieves the following error message: Package inputenc Error: Unicode character Α (U+391). Apr 21, 2019 at 12:27
• If you find the answers to your question useful, considering accepting it by selecting the tick-mark on the left-top corner below the voting button. Aug 1, 2019 at 21:15

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\setchemfig{compound style={draw,inner sep=6pt}}
\schemestart
\chemfig{CH_3CH_2CHCH_2CH_3([6,,5]-OH)}
\arrow(s.center--B.center)[90,1.5,draw=none]
B
\arrow(B.center--A.center)[180,2,draw=none]
A
\arrow(@s.center--C.center)[180,2,draw=none]
C
\arrow(@A--@C)\arrow(@C--@s)\arrow(@s--@B)\arrow(@A--@B)
\schemestop

Edit :\schemestart
A
\arrow(A.south east--s.north west)[-45,1.5*1.414,draw=none]
\chemfig{CH_3CH_2CHCH_2CH_3([6,,5]-OH)}
\arrow(@s.west--C.east)[180,1.5,CF-]
C
\arrow(@s.north--B.south)[90,1.5,CF-]
B
\arrow(@A--@C)\arrow(@A--@B)
\schemestop
\end{document}

• unbonpetit, your approach is very interesting and useful, however, if you change a chemical compound, it is necessary to re-adjust the sides of the rectangle. Thank you very much. Apr 24, 2019 at 6:47
• Very easy to adapt, see edit. Apr 24, 2019 at 11:00
• I agree, I would just like a solution without the need for adapt. Apr 24, 2019 at 21:36
• @polyn But in the second scheme, there is nothing to adapt. Apr 25, 2019 at 6:24
• If you replace C with CCCCCCCCCC then you will need the adjustment. Apr 25, 2019 at 7:12

Not perfect due to the manually determined value of the first arrow but maybe nevertheless close to what you want to achieve. Note: I have replaced the two occurences of the capital alpha by a regular latin A.

\documentclass{article}

\usepackage{chemfig}

\begin{document}

\setchemfig{compound style={draw,inner sep=6pt}}

\schemestart
A
\arrow[,1.83727]
A
\arrow(@c1--)[-90,1]
A
\arrow
\chemfig{CH_3CH_2CHCH_2CH_3([6,,5]-OH)}
\arrow(@c4.north--@c2.south)
\schemestop

\end{document}

• leandriis i fixed the code. Thank you. I would not prefer a manually determined value but an automatic solution. Apr 21, 2019 at 13:21