TransWikia.com

Mesomere structures are in one line

TeX - LaTeX Asked on February 27, 2021

I’m trying to write the mesomeric structures of Phenetol. Here’s a short form of the code:

documentclass[pstricks, a4paper, 14pt]{article}
usepackage{chemfig}
usepackage[version=4]{mhchem}

begin{document}
schemestart
chemleft[
        subscheme{
        chemfig{{CH} * 6( -{CH} ={CH} -C( =[1] charge{90=|}{O}^{oplus} -[7]CH2 -[1]CH3) - charge{270=|}{CH}^{ominus} -{CH} =)}
        arrow{<->}
        chemfig{{CH} * 6( -{CH} ={CH} -C( =[1] charge{90=|}{O}^{oplus} -[7]CH2 -[1]CH3) - charge{270=|}{CH}^{ominus} -{CH} =)}
        arrow{<->}
         % This doesn't work :(
        chemfig{{CH} * 6( -{CH} ={CH} -C( =[1] charge{90=|}{O}^{oplus} -[7]CH2 -[1]CH3) - charge{270=|}{CH}^{ominus} -{CH} =)}
        }
chemright]
schemestop
end{document}

Apparently it looks like this:
How it looks like

As you can see LaTeX doesn’t wrap the line. Do you have an idea how I can fix this?

One Answer

Is this ok for you?

documentclass[a4paper,12pt]{article}
usepackage[margin=1cm]{geometry}
usepackage{chemfig}

begin{document}

schemestart
chemleft[
    chemfig{{CH} * 6( -{CH} ={CH} -C( =[1] charge{90=|}{O}^{oplus} -[7]CH2 -[1]CH3) - charge{270=|}{CH}^{ominus} -{CH} =)}
chemright.
    arrow{<->}
    chemfig{{CH} * 6( -{CH} ={CH} -C( =[1] charge{90=|}{O}^{oplus} -[7]CH2 -[1]CH3) - charge{270=|}{CH}^{ominus} -{CH} =)}
    arrow{<->}
schemestop

vspace{baselineskip}
schemestart
chemleft.
    chemfig{{CH} * 6( -{CH} ={CH} -C( =[1] charge{90=|}{O}^{oplus} -[7]CH2 -[1]CH3) - charge{270=|}{CH}^{ominus} -{CH} =)}
chemright]
schemestop

end{document}

Correct answer by polyn on February 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP