# Overleaf, How do I insert a \definesubmol with hooks “?” in a parent structure multiple times?

I have defined a submol for TEDA so that it can be inserted via !{TEDA} into a parent structure (Hexamethylbenzene).

\definesubmol{TEDA}{-[::60]*6(\chemabove{\textcolor{blue}{N}}{\scriptstyle{+}}?---\textcolor{blue}{N}(-[::150,.7]-[::-30,.7]?)--?)


This works perfectly fine as long as I do it once, but leads to undesired bonds with a vertex when I insert more than one.

1. TEDA : \chemfig[][scale=.5]{!{TEDA}}
2. TEDA+Parent : \chemfig[][scale=.5]{*6((-!{TEDA})-(-)=(-)-(-)=(-)-(-)=)}
3. 2*TEDA+Parent : \chemfig[][scale=.5]{*6((-!{TEDA})-(-)=(-!{TEDA})-(-)=(-)-(-)=)}

I already know that this must be caused by my TEDA definition, which contains hooks "?", which end up connecting among themselves, if I add more than one TEDA unit.

Is there a way to specify unique hooks for a single !{TEDA} instance? Do I need to tackle the problem in a different way entirely?

• Welcome to TeX.SE! May I suggest to change the title? I can't see how "overleaf" is important here, you may just scare away some of those who could answer this question. More importantly, could you provide us with a minimal compilable document that starts with \documentclass, ends with \end{document} and illustrates the issue? – user121799 Nov 7 '18 at 15:09

\documentclass{article}
\definesubmol{TEDA}1{-[::60]\chemabove{\textcolor{blue}{N}}{\rlap{\kern0.2em$\scriptstyle{+}$}}?[#1]*6(---\textcolor{blue}{N}(-[::150,.7]-[::-30,.7]?[#1])--?[#1])}