0

Why is \textcolor forcing my methyl group to center. I don´t want it to do that and so far I could not find anything to counteract this. Does anyone have any sugestions? Thanks

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{*6((=O)-N(-\textcolor{red}{CH_3})-*5(-N=-N(-\textcolor{red}{CH_3})-=)--(=O)-N(-\textcolor{red}{H_3C})-)}
\chemfig{*6((=O)-N(-CH_3)-*5(-N=-N(-CH_3)-=)--(=O)-N(-H_3C)-)}
\end{document}

enter image description here

1 Answer 1

1

You have to colour each atom, enclose the group within braces and separate the groups with a |:

\documentclass{article}
\usepackage{chemfig}

\begin{document}

\chemfig{*6((=O)-N(-{\color{red}C}|{\color{red}H_3})-*5(-N=-N(-{\color{red}C}|{\color{red}H_3})-=)--(=O)-N(-{\color{red}H_3}|{\color{red}C})-)}

\end{document}

enter image description here

0

You must log in to answer this question.

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