Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the acro package, and I want to use a comma in one of the acronyms. Unfortunately TeXnicCenter throws a wobbly:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "xparse/split-excess-tokens"
! 
! Too many ',' tokens when trying to split argument.
! 
! See the LaTeX3 documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

l.24 ...m{pvt}{PVT}{process, voltage, temperature}

|'''''''''''''''''''''''''''''''''''''''''''''''
| LaTeX was asked to split the input 'process, voltage, temperature' at each
| occurrence of the token ',', up to a maximum of 2 parts. There were too many
| ',' tokens.
|............................................... 

My code:

\documentclass{article}
\usepackage{acro}
\acsetup{list-long-format=\capitalisewords}
\usepackage{mfirstuc}% provides \capitalisewords

\DeclareAcronym{pvt}{PVT}{process, voltage, temperature}

\begin{document}
The environmental space is known as \ac{pvt} blah blah blah
\end{document}

Clearly in its current form the only way I am going to get it to work is to remove the commas, however I'd very much like to have my cake and eat it. So how do I get it written as:

The environmental space is known as process, variation, temperature (PVT) blah blah blah...

share|improve this question
2  
Add another pair of braces: \DeclareAcronym{pvt}{PVT}{{process, voltage, temperature}} –  cgnieder Jan 30 '13 at 11:47
2  
or put braces around the commas –  cgnieder Jan 30 '13 at 11:48
    
As well as what @cgnieder says, the input seems to be wrong as \DeclareAcronym only takes two arguments (according to the v1.0 documentation). –  Joseph Wright Jan 30 '13 at 11:49
1  
@E_L I will but that'll have to wait a few hours until I'm home again –  cgnieder Jan 30 '13 at 12:52
1  
@E_L It seems that you're using a version 0.x of the package. Consider upgrading, as version 1.0 is surely more powerful. –  egreg Jan 30 '13 at 12:53

1 Answer 1

up vote 2 down vote accepted

version 0.*

An acronym is declared by

\DeclareAcronym{<id>}{<short>}{<long>}

but this is only a little part of the truth. More accurate and the explanation for your issue is this:

\DeclareAcronym{<id>}{<short>,<plural ending>}{<long>,<plural ending>}

Both the <short> and the <long> argument are split by a possible comma where after the comma one can add a different plural ending than the default s. Your entry had two commas so acro saw the following:

\DeclareAcronym{pvt}{PVT}{process, voltage, temperature}
 - id:    pvt
 - short: PVT
 - long:  process
 - long plural ending: voltage (including a leading space)

and then it choked as it didn't expect a second comma. Workaround: hide the commas or the whole long entry in an extra pair of braces.

    \DeclareAcronym{pvt}{PVT}{{process, voltage, temperature}}

version 1.*

With version 1.0 the syntax of the command has changed (the old syntax is still available through the package option version=0).

\DeclareAcronym{<id>}{
  short = <short> ,
  long  = <long> ,
  <other key value pairs>
}

Here it is more obvious that a comma delimits the single key/value pairs and hence a value must be written in braces if it should contain one or more commas.

share|improve this answer

Your Answer

 
discard

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.