5

Is there a nice way to define a ring submolecule and then reuse it in a bigger molecule (maybe something similar to “chemfig and lego-style molecule construction”? (append one ring after another)

I would like to draw for example this:

\documentclass{article}
\usepackage{chemfig,xstring}

\begin{document}

\chemfig{-*6(-=-(-*6(-=-(-*6(-=-(-)=-=))=-=))=-=)}

\end{document}

but such that the ring would be defined as a submolecule (name e.g. ring) and then append one ring after another (\chemfig{-!{ring}-!{ring}-!{ring}}). Is there a way to do it?

Desired result:

(image of desired result)

1 Answer 1

7

Here are two ideas:

\documentclass{article}
\usepackage{chemfig}

\definesubmol{ring}{(-[::-60]=^[::60]-[::60])=_[::60]-[::-60]=_[::-60]}
\definesubmol{ring2}{(**6(------))-[,,,,draw=none]-[,,,,draw=none]}

\begin{document}

\chemfig{-!{ring}-!{ring}-!{ring}}

\chemfig{-!{ring2}-!{ring2}-!{ring2}}

\end{document}

enter image description here

You must log in to answer this question.

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