# Italic abbreviations/acronyms with dots and spaces in ConTeXt

I am trying to setup an abbreviation/acronym list for my document as described in http://wiki.contextgarden.net/Command/definesynonyms . Some of my abbreviations are names of microorganisms like E.coli which stands for Escherichia coli. These abbreviations have to be in italics and also contain dots and sometimes spaces. Both these things cause problems for me:

\definesynonyms[abbreviation][abbreviations][\infull]
\abbreviation{\it{E.coli}}{\it{Escherichia coli}} % This throws an error

\starttext
Blablabla \E.coli % and this doesn't work either.
\placelistofabbreviations
\stoptext


How is it done right?

There are two mistakes in your code. Firstly, the use of \it: it is a toggle, and so the proper usage is {\it ...}, or you can use the command \italic instead which does take an argument, like \italic{...}.

The other is to do with the synonyms. Having done

\definesynonyms[abbreviation][abbreviations][\infull]


You now have \abbreviation which takes the arguments

\abbreviation[<optional>]{<shortform>}{<longform>},


and can of course do \shortform to get the short form and \infull{<shortform>} to get the long form.

We have a problem though, if <shortform> (under normal catcode regimes) doesn't work as a control sequence name. Ours is just such a case. That is the purpose of the optional argument, to supply a more suitable shorthand. Then you can do \optional for the short form and \infull{optional} for the long one.

All in all, the MWE becomes

\definesynonyms[abbreviation][abbreviations][\infull]
\abbreviation[ECOLI]{{\it E.coli}}{{\it Escherichia coli}}

\starttext
Blablabla \ECOLI
\placelistofabbreviations
\stoptext


For making things italic, there is a better way. Just put the content you want in each \abbreviation, and set the style using \setupsynonyms. Now we can nicely control the style in the "list" separately, although presumably you want the same style again. MWE with these changes:

\definesynonyms[abbreviation][abbreviations][\infull]
\setupsynonyms[abbreviation][synonymstyle=\it, textstyle=\it]
\abbreviation[ECOLI]{E.coli}{Escherichia coli}

\starttext
Blablabla \ECOLI

• I'd apply slanting by setting textstyle and synonymstyle for the newly created abbreviation. – Henri Menke Jul 26 '17 at 10:49
• @HenriMenke I was just looking into that, can't figure out how to also apply the same style in the list. – 9tTn9B Jul 26 '17 at 10:56