2

Essentially I just want to put a charge on a carbon atom, but I don't want to include the "C", using \chemabove almost works however it creates gaps between the bonds.

\documentclass{article}
\usepackage{chemfig}

\begin{document}

\setangleincrement{30}
\setatomsep{20pt}

\begin{center}
        \schemestart
        \chemfig{\chemabove{}{\hspace{-15pt}{\textcolor{blue}{+}}}(-[-1]-[-3]H)(-[7])(-[3]N(-[1]R)(-[5]R))}
        \schemestop
\end{center}

\end{document}

Result from code What I want to create

Anyone know a good way to add the charge without the gaps (or the need to add the C atom)?

Compiled using -> latexmk -pdf file.tex

3

You can add things afterwards with \chemmove. All you need to do is to set some nodes with the @{<name>}{<content>} syntax.

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\begin{center}
        \schemestart
        \chemfig{(-[-1]@{plus}{}-[-3]H)(-[7])(-[3]N(-[1]R)(-[5]R))}
        \schemestop
\chemmove{
\node at ([xshift=1.5mm]plus) {+};
}
\end{center}
\end{document}

enter image description here

My problem is that your code does not produce the output you show. Do I have to do something special when compiling? Anyway, here is some alternative:

\documentclass{article}
\usepackage{chemfig}
\usetikzlibrary{positioning}
\begin{document}
\begin{center}
        \schemestart
        \chemfig{R-[:-30](N-[:-90]@{plus}{}(-[:-135])-[:-45]-[:-90]H)-[:30]H}
        \schemestop
\chemmove{
\node[blue,above left=1pt of plus]  {$+$};
}
\end{center}
\end{document}

enter image description here

1

Like this perhaps:

\documentclass{article}
\usepackage{chemfig}
\definesubmol\nobond{-[3,0.2,,,draw=none]}
\begin{document}
    \begin{center}
        \schemestart
        \chemfig{(-[-1]-[6]H)(-[5])(-[2]N(-[1]R)(-[3]R))(!\nobond\textcolor{blue}{\oplus})}
        \schemestop
    \end{center}
\end{document}

f

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.