# chemformula and common organic chemistry groups

What would be the proper (and efficient) way to type common organic groups/radicals/substituents like i-Pr, n-Bu or t-Bu with chemformula (the main concern is the prefixes)?

So far I tried the following:

\documentclass[a4paper]{report}

\usepackage[modules={all}]{chemmacros}

\begin{document}

Tetra-\textit{n}-butylammonium cation:

\begin{enumerate}
\item \ch{\textit{n-}Bu4N+}
\item \ch{ $n\text{-}$ Bu4N+}
\item \ch{ "\textit{n-}" Bu4N+}
\end{enumerate}

\end{document}


Third version looks the best, but I find my code too cumbersome. I only found \tert command in chemmacros manual which produces tert, and is intended for the names, not formulas. Something tells me there must be more elegant (and semantically correct) way of typing this.

• Maybe the bpchem package would help. – Bernard Jan 7 '18 at 1:57
• @SandyG $n$-\ch{Bu4N+} makes me feel uncomfortable since it breaks code semantics: n- is the part of the chemical formula, not a math symbol. – andselisk Jan 7 '18 at 9:14
• You could define your own command like \newcommand{\nn}{\textit{n-}} and use it like \ch{\nn Bu4N+}. – leandriis Jan 7 '18 at 10:58
• Like @leandriis I would define a command. – clemens Jan 7 '18 at 13:22
• @andselisk that's right. IIRC the chemstyle package has ready made macros for some of those groups... – clemens Jan 7 '18 at 13:47

To easily access descriptors (prefixes in chemical nomenclature) that are not already built in chemmacros' nomenclature module, you can define your own commands as shown in the following MWE:

\documentclass[a4paper]{report}
\usepackage[modules={all}]{chemmacros}
\newcommand{\nn}{\textit{n-}}
\begin{document}

Tetra-\textit{n}-butylammonium cation: \ch{ "\textit{n-}" Bu4N+}

\iupac{Tetra-\nn butylammonium cation}:  \ch{\nn Bu4N+}

\end{document}


As mentioned by clemens in the comments, there is also the chemstyle package, that provides the commands \nPr, \iPr, \nBu, \iBu, \sBu, \tBu.

• Could you please clarify what's the meaning of the second "n" in \nn is? – andselisk Jan 7 '18 at 13:48
• The name of the command does not have any special meaning. In order to avoid problems with already defined one letter commands, I simply added a second n. But you can of course name the command however you like. – leandriis Jan 7 '18 at 13:54
• Oh, my bad. Sometimes I'm overthinking too much. Thank you! – andselisk Jan 7 '18 at 13:55

Since one need to define these commands anyway, I figured it might also be useful to define them as abbreviations and use glossaries package. According to ACS Style Guide, common groups in organic chemistry don't necessarily have to be defined in text, but one might consider adding own abbreviated groups later. Then building own glossary list can be quite beneficial:

\documentclass[a4paper]{report}

\usepackage[modules={all}]{chemmacros}

\usepackage[acronym]{glossaries}

\newacronym{nPr}{\textit{n}-Pr}{\textit{n}-propyl}
\newacronym{iPr}{\textit{i}-Pr}{isopropyl}
\newacronym{nBu}{\textit{n}-Bu}{\textit{n}-butyl}
\newacronym{iBu}{\textit{i}-Bu}{isobutyl}
\newacronym{sBu}{\textit{s}-Bu}{\textit{sec}-butyl}
\newacronym{tBu}{\textit{t}-Bu}{\textit{tert}-butyl}

\makeglossaries

\begin{document}

\glsunsetall

Common groups in organic chemistry are: \gls{nPr}, \gls{iPr}, \gls{nBu}, \gls{iBu}, \gls{sBu}, \gls{tBu}.

Tetra-\textit{n}-butylammonium cation: \ch{\gls{nBu}4N+}.

\printglossaries

\end{document}