4

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}

1 Answer 1

4

You can pass an optional argument which accepts font changes:

enter image description here

\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.

1
  • Thanks a lot! Works fine.
    – prog2de
    May 17, 2019 at 12:02

You must log in to answer this question.

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