I have made the code for following using \chemfig
. But I am having issue making the final [D]
at the end of the equation. Can anyone please help me how to define this and the final output. I have copied the following code from Chemfig but this gives error, I have tried putting the defining code both in preamble and in body of the program but nothing works!
My MWE is here:
\documentclass{article}
\usepackage{mhchem}
\usepackage{chemmacros}
\usepackage{amsmath}
\usepackage{rotating}
\usepackage{chemfig}
\begin{document}
\newcommand\setpolymerdelim[2]{\def\delimleft{#1}\def\delimright{#2}}
\def\makebraces[#1,#2]#3#4#5{%
\edef\delimhalfdim{\the\dimexpr(#1+#2)/2}%
\edef\delimvshift{\the\dimexpr(#1#
2)/2}%
\chemmove{%
\node[at=(#4),yshift=(\delimvshift)]
{$\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim
width0pt\right.$};%
\node[at=(#5),yshift=(\delimvshift)]
{$\left.\vrule height\delimhalfdim depth\delimhalfdim
width0pt\right\delimright_{\rlap{$\scriptstyle#3$}}$};}}
\setpolymerdelim[]
\chemfig{*6(----(=[:90]NOH)--)} \schemestart \arrow(start.mid east--.mid west){->[\ce{H^{+}}]} $C$ \arrow(start.mid east--.mid west){->[Polymerisation]}[,1.85] \schemestop
\chemfig{\vphantom{CH_2}[@{op,.75}]CH_2CH_2[@{cl,0.25}]}
\makebraces[5pt,5pt]{}{left}{right}
\end{document}
\makebraces
is not necessary when usingchemmacros
and it'spolymers
module