2

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(@[email protected])
\schemestop

\end{document}
2
  • Please make your code compilable. Currently one recieves the following error message: Package inputenc Error: Unicode character Α (U+391).
    – leandriis
    Commented 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. Commented Aug 1, 2019 at 21:15

2 Answers 2

4
\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}
6
  • 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.
    – polyn
    Commented Apr 24, 2019 at 6:47
  • Very easy to adapt, see edit.
    – unbonpetit
    Commented Apr 24, 2019 at 11:00
  • I agree, I would just like a solution without the need for adapt.
    – polyn
    Commented Apr 24, 2019 at 21:36
  • @polyn But in the second scheme, there is nothing to adapt.
    – unbonpetit
    Commented Apr 25, 2019 at 6:24
  • If you replace C with CCCCCCCCCC then you will need the adjustment.
    – polyn
    Commented Apr 25, 2019 at 7:12
3

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.

enter image description here

\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(@[email protected])
\schemestop

\end{document}
1
  • leandriis i fixed the code. Thank you. I would not prefer a manually determined value but an automatic solution.
    – polyn
    Commented Apr 21, 2019 at 13:21

You must log in to answer this question.

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