TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The acronym packages allows one to easily create and display acronyms, with a simple syntax, like \ac{usb}. The first time this is called, is will say “Universal Serial Bus (USB)”, but after that, just “USB”. I found nothing about this in the documentation, but this article on PDF-strings seems to offer similar functionality, but the example seems incomplete. How can I define and display acronyms in ConTeXt?

share|improve this question
See manual chapter 12.2 - Synonyms – Marco May 9 '12 at 12:18
up vote 3 down vote accepted

The theory behind this is easy, if you don't need to index the acronyms.

\def\newacronym#1#2#3{% #1 = key, #2 = abbreviated form, #3 = expanded form
  \expandafter\def\csname ac@#1\endcsname{%
    \expandafter\gdef\csname ac@#1\endcsname{#2}%
\def\ac#1{\csname ac@#1\endcsname}

\newacronym{usb}{USB}{Universal Serial Bus}
\newacronym{ml}{ML}{Murphy's Law}

Here's \ac{usb} and \ac{ml}; let's see that \ac{usb} works 
not according to \ac{ml}.


enter image description here

share|improve this answer

The context version of this functionality is called 'synonyms', types of which are defined using \definesynonyms. The wiki page for definesynonyms contains some examples, but in short:


\acronym[VVV]{vvv}{Bureau of Tourist Information}
The Dutch \VVV\ (\infull{VVV}) can provide you with the tourist information on Hasselt.

There now also a \setupsynonyms[acronyms] and \placelistofacronyms. That are used to produce a list of (used or all) acronyms.

As far as I know, ConTeXt does not have a built-in feature for 'first use'.

share|improve this answer

I had the same question but needed indexing. Also, my project contains many loose files, so I don't want to search for first occurances myself.

\definesynonyms[acron][acronyms][\fullac] % Define acronyms as context synonyms

% Define a new macro
  \ifcsname AcroUsed#1\endcsname
    % If the acro was already used, return the acronym
    \csname #1\endcsname
    % Otherwise, set as used, print full and acro
    \fullacro{#1} (\csname #1\endcsname)
    \expandafter\def\csname AcroUsed#1\endcsname{1}
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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