I have been trying to draw a chemistry diagram using the following code:
\schemestart
{\scriptsize \chemfig{
H-[:30]C(-[:90]H)(-[:-90]H)-[:-30]\Lewis{2:,N}(-[:-90]H)-[:30]C(-[:90]H)(-[:-90]H)-[:-30]C(-[:90]H)(-[:-90]N\rlap{${}^+$}(-[:-150]H)(-[:-90]H)-[:-30]H)-[:30]C(=[:90]\Lewis{1:3:,O})-[:-30]\Lewis{1:5:7:,O}^\rlap{${}^-$}
}}
\arrow{<=>}
{\scriptsize \chemfig{
H-[:30]C(-[:90]H)(-[:-90]H)-[:-30]N\rlap{${}^+$}(-[:-90]H)(-[:90]H)-[:30]C(-[:90]H)(-[:-90]H)-[:-30]C(-[:90]H)(-[:-90]N(-[:-150]H)-[:-30]H)-[:30]C(=[:90]\Lewis{1:3:,O})-[:-30]\Lewis{1:5:7:,O}\rlap{${}^-$}
}}
\arrow{<=>[$+$\chemfig{H^+}]}
{\scriptsize \chemfig{
H-[:30]C(-[:90]H)(-[:-90]H)-[:-30]N\rlap{${}^+$}(-[:-90]H)(-[:90]H)-[:30]C(-[:90]H)(-[:-90]H)-[:-30]C(-[:90]H)(-[:-90]N\rlap{${}^+$}(-[:-150]H)(-[:-90]H)-[:-30]H)-[:30]C(=[:90]\Lewis{1:3:,O})-[:-30]\Lewis{1:5:7:,O}\rlap{${}^-$}
}}
\schemestop
Unfortunately the following error comes
! Missing { inserted.<to be read again>\hbox {
! Missing { inserted.<inserted text>{
The error is attached to the second molecule, that is the line where {\scriptsize \chemfig{
appears for the second time. How do I fix this error?
^\rlap{${}^-$}
at the end of the firstchemfig
. What precisely do you want to achieve with it?\Lewis{1:5:7:,O}^-
as one 'box'. See the chemfig documentation (mirror.aarnet.edu.au/pub/CTAN/macros/generic/chemfig/…) and page 42 section 12.2^\rlap{${}^-$}
. So I am asking to understand what it is good for to be able with an alternative way to achieve the same.