2

Code

\documentclass[10pt, a4paper]{article}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage{chemfig,stackengine,graphicx}
\usepackage{xcolor,tikz}
\usepackage[version=3]{mhchem}

\definesubmol{wallpart}{-[:-90,.5](-[:110,.5])}
\definesubmol{wall}{!{wallpart}!{wallpart}!{wallpart}}

\begin{document}
\lipsum[10]

\begin{align}
\cee{CH3 + \varphi &-> \varphi CH3}\\
\cee{\varphi CH3 +e &-> }\chemfig{!{wall}(-[:0]**6(---(-CH3)---)) !{wall}}
\end{align}

\lipsum[20]

\end{document}

Product

Product benzene ring

Trouble shooter

As you can see, the image (chemfig) is maybe a little too big. I don't know how to make it smaller.

I would also like to have the equation before the chemfig to be vertically centered to the chemfig image.

In the meantime, thank you so much for your attention and participation.

4

Citing chemfig's manual

ChemFig always places the first atom of the molecule on the baseline of the preceding code.

This means that the first atom in a molecule determines the baseline of the whole molecule. A solution in this case it is rather easy: add an invisible bond upwards before the “wall” (i.e. three bonds scaled by .5 going down (the angle is :-90)) starts:

\documentclass{article}
\usepackage{chemfig}

\definesubmol{wallpart}{-[:-90,.5](-[:110,.5])}
\definesubmol{wall}{!{wallpart}!{wallpart}!{wallpart}}

\begin{document}

A \chemfig{
  -[:90,1.5,,,draw=none]
  !{wall}
  (-[:0]**6(---(-CH_3)---))
  !{wall}
} B

\end{document}

enter image description here

If you also add a phantom atom at the beginning the alingment fits the preceding and following text:

\documentclass{article}
\usepackage{chemfig}

\definesubmol{wallpart}{-[:-90,.5](-[:110,.5])}
\definesubmol{wall}{!{wallpart}!{wallpart}!{wallpart}}

\begin{document}

A \chemfig{
  \vphantom{A}-[:90,1.5,,,draw=none]
  !{wall}
  (-[:0]**6(---(-CH_3)---))
  !{wall}
} B

\end{document}

enter image description here

You can make the molecule smaller by setting the atom sep to a smaller value

\setatomsep{1.5em}

(default is 3em) or scale it using the optional arguments: \chemfig[scale=.5][scale=.5]{...}. Try using only one of the optional arguments to see their different effects…

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.