0

I have two reaction schemes and one is a skeletal representation. I want all of my bonds to be a certain length, so I set the option fixed length = true and atom sep=1.5em. This gives me the above formula with equal bonds, but it destroys the skeletal molecule. If I then set fixed length = false the bonds are way too short. How can I fix this?

Also, the vertical alignment of seems off (see red line).

enter image description here

MWE:

\documentclass[11pt, a4paper]{scrbook}
\usepackage[left=27.5mm,right=16mm,top=30mm,bottom=30mm]{geometry}
\usepackage[english,main=ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{chemfig}
\setchemfig{fixed length=false, atom sep=1.5em, arrow offset=6pt, scheme debug=false}


\begin{document}

\small
\centering
\schemestart
\chemfig{\mathit{n}}
\chemname{\chemfig{NH_2-{(}CH_2{)}_{11}-COOH}}{$\omega$-Amino-Laurylsäure}
\arrow(.mid east--.mid west)
\chemname{\chemfig{\vphantom{N}-[@{li}]{NH}-{(}CH_2{)_{11}}-CO-[@{re}]}}{Polyamid 12}
\polymerdelim[delimiters={[]}]{li}{re}
\+
\chemfig{\mathit{n}}
\chemname{\chemfig{H_2O}}{Wasser}
\schemestop

\vspace{1cm}

\schemestart
\chemfig{\mathit{n}}
\chemname{\chemfig{-[:-58]-[:20]-[:-30]-[:30]-[:-30]-[:30]-[:90](=[:30]O)-[:150]N(-[:90]H)-[:210]-[:150]-[:210]-[:160]-[:238]}}{Laurinlactam}
\arrow
\chemname{\chemfig{-[@{li}:-30]NH-[:30]-[:-30]-[:30]-[:-30]-[:30]-[:-30]-[:30]-[:-30]-[:30]-[:-30]-[:30]-[:-30](=[6]O)-[@{re}:30]}}{Polyamid 12}
\polymerdelim[delimiters={[]},height=5pt,depth=30pt]{li}{re}
\schemestop

\end{document}
3
  • 1
    Why don't you add [fixed length=false] after \chemfig only for Laurinlactam? – polyn Feb 27 '20 at 18:55
  • Thank you! That was really easy – fuj36840 Feb 28 '20 at 9:19
  • It worked the first time I compiled it, but now I got the error message 'Package pgfkeys: I do not know the key '/tikz/fixed length', to which you passed 'false', and I am going to ignore it. Perhaps you misspelled it.' – fuj36840 Feb 28 '20 at 18:56
1

the following code works perfectly on my pc

\documentclass[11pt, a4paper]{scrbook}
\usepackage[left=27.5mm,right=16mm,top=30mm,bottom=30mm]{geometry}
\usepackage[english,main=ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{chemfig}
\setchemfig{fixed length=true, atom sep=1.5em, arrow offset=6pt, scheme debug=false}


\begin{document}

\small
\centering
\schemestart
\chemfig{\mathit{n}}
\chemname{\chemfig{NH_2-{(}CH_2{)}_{11}-COOH}}{$\omega$-Amino-Laurylsäure}
\arrow(.mid east--.mid west)
\chemname{\chemfig{\vphantom{N}-[@{li}]{NH}-{(}CH_2{)_{11}}-CO-[@{re}]}}{Polyamid 12}
\polymerdelim[delimiters={[]}]{li}{re} 
  \+ 
\chemfig{\mathit{n}}
\chemname{\chemfig{H_2O}}{Wasser}
\schemestop

\vspace{1cm}

\schemestart
\chemfig{\mathit{n}}
\chemname{\chemfig[fixed length=false]{
        -[:-58]-[:20]-[:-30]-[:30]-[:-30]-[:30]-[:90](=[:30]O)-[:150]N(-[:90]H)-[:210]-[:150]-[:210]-[:160]-[:238]}}{Laurinlactam}
\arrow
\chemname{\chemfig{-[@{li}:-30]NH-[:30]-[:-30]-[:30]-[:-30]-[:30]-[:-30]-[:30]-[:-30]-[:30]-[:-30]-[:30]-[:-30](=[6]O)-[@{re}:30]}}{Polyamid 12}
\polymerdelim[delimiters={[]},height=5pt,depth=30pt]{li}{re}
\schemestop

\end{document}

enter image description here

1
  • I updated my Tex Live distribution to 2019 and now it works again – fuj36840 Feb 29 '20 at 6:52

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.