# use \textit{} for Italic letters in acronym package

I'm writing an article in which I need to use species name E. coli. My problem is, that "E. coli" is both, an abbreviation and a species name, which should be in italic letters.

Is there a way to use \textit within the acronym package?

Something like this:

\documentclass[]{scrbook}

\usepackage{acronym}

\begin{document}
\begin{acronym}
\acro{\textit{E.coli}}{\textit{Escherichia coli}}
\end{acronym}

This is a damn nice \ac{\textit{E. coli}}.

\end{document}


You can pass an optional argument which accepts font changes:

\documentclass{scrbook}

\usepackage{acronym}
\usepackage{lmodern}% For bold italics

\begin{document}
\begin{acronym}
\acro{E. coli}[\emph{E. coli}]{\emph{Escherichia coli}}
\end{acronym}

This is a damn nice \ac{E. coli}.

\end{document}


The first argument is the identifier of the acronym. It's used in a \csname, so it can contain only characters. It doesn't need to be the same as the printed text. You could've used, for example, \acro{ecoli}[\emph{E. coli}]{\emph{Escherichia coli}} and then \ac{ecoli}.

I also used \emph instead of \textit, so that when you write \ac{E. coli} in a italicized text, it is typeset upright.

• Thanks a lot! Works fine. May 17 '19 at 12:02