3

I want to reproduce this scheme in P. J. Flory's first book, p. 319:

enter image description here

for which I need to typeset labels under the bonds. I tried to make bonds accept labels like arrows do, first with the pretty naïve attempt in the MWE below, then I delved into chemformula's code to try to paste up a solution, but LaTeX3 looks like extraterrestrial to me.

\documentclass{article}
\usepackage{chemformula}

%% \ch{A --[a][b] B}, with --[a][b] defined as follows, puts too much space around the arrow-bond.
\NewChemArrow{--}{\draw[chemarrow] (cf_arrow_start) -- (cf_arrow_end) ; }

\begin{document}

\ch{A--[a][b]B}

\bigskip
\ch{A '$\underset{a}{\ch{--}}$' B} % This one ends in "TeX capacity exceeded, sorry [grouping levels=255]."

\end{document}

[Edit] One solution is to use \ch[bond-length=3em]{A '$\underset{x-1}{\bond{sb}}$' B}, as suggested by @Troy.

Is it possible to let the label accomodate itself under the text? As it stands now, a large label pushes the atoms apart:

\documentclass{article}
\usepackage{chemformula}

\begin{document}

\noindent
\ch{A-B}\\
\ch{A '$\underset{x - 1}{\bond{sb}}$' B}\\
\ch[bond-length=3em]{A '$\underset{x-1}{\bond{sb}}$' B}

\end{document}

prints

enter image description here

1
  • @Troy Thanks! Should have figured out by myself... Anyway, I would rewrite it as \ch{A '$\underset{a}{\bond{sb}}$' B} (with the quotes and the spaces surrounding the bond). Try \ch[bond-length=3em]{A '$\underset{x-1}{\bond{sb}}$' B} with and without them to see the difference. Sep 9, 2017 at 16:15

2 Answers 2

4

I'd use chemformula's

\ch{ !(<text>)(<formula>) }

syntax and a zero-width box:

\documentclass{article}

\usepackage{chemformula}

\begin{document}

\ch{
  H !(1)(\bond{sb}) ORCO !(2)(\bond{sb}) ORCO !(3)(\bond{sb})
  ...
  !(\makebox[0pt]{$x-1$})(\bond{sb}) ORCO !($x$)(\bond{sb}) OH
}

\end{document}

enter image description here

2
  • Thank you Clemens. What is the empty group before the dots for? Sep 10, 2017 at 8:49
  • @ArchStanton it's useless, I removed it
    – cgnieder
    Sep 10, 2017 at 11:50
2

mathtools' \mathclap does the job:

\documentclass{article}
\usepackage{chemformula}
\usepackage{mathtools}

\begin{document}

\noindent
\ch{A-B}\\
\ch{A '$\underset{\mathclap{x - 1}}{\bond{sb}}$' B}\\
\ch[bond-length=3em]{A '$\underset{x-1}{\bond{sb}}$' B}
\end{document}

enter image description here

You may use a command for it:

\newcommand*{\blb}[2][sb]{\ensuremath{\underset{\mathclap{#2}}{\bond{#1}}}}
...
\ch{A '\blb{x-1}' B} % same as the second line above
\ch{A '\blb[db]{x-1}' B} % this is an unsaturated AB

You must log in to answer this question.

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