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 having some trouble with acronyms such as I2C, where there is a number inside. My code is like the following:

\usepackage[acronym]{glossary}
\makeglossary
\newacronym{I2C}{Inter-Integrated Circuit}{}

\begin{document}
\I2C
\end{document}
share|improve this question
1  
The problem is caused by the fact that commands names can't containing numbers. However, the glossary package is obsolete and has been replaced by glossaries. –  Nicola Talbot Jan 31 '13 at 16:13
    
Welcome to TX.SX! If you indent your code by four spaces, it will show up as code, as it can be seen now in your question. Moreover, we don't write "Thank you"'s here. –  mafp Jan 31 '13 at 16:15
add comment

1 Answer

The solution is to use the optional argument:

\documentclass{article}

\usepackage[acronym]{glossary}
\makeglossary
\newacronym[IIC]{I2C}{Inter-Integrated Circuit}{}

\begin{document}
\IIC
\end{document}

However since glossary is obsolete, it's better to use the replacement glossaries package:

\documentclass{article}

\usepackage[acronym]{glossaries}
\makeglossary
\newacronym{I2C}{I2C}{Inter-Integrated Circuit}

\begin{document}
\gls{I2C}
\end{document}
share|improve this answer
add comment

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.