[texhax] Strange ordering problem with glossary macro
Geoff Russell
geoffrey.russell at gmail.com
Fri Dec 14 01:36:56 CET 2007
Hi All,
The following latex/tex code works fine, however swapping lines A, and B,
makes it fail.
The \myglossabbr{TL}{TeX Live 2005{TL} defines a macro \TL/ which produces
"Tex Live 2005 (TL)" on the first use and TL on subsequent uses and
accumulates items
in a glossary list: TL --- TeX Live 2005. etc. Without the \cite{}
in the second
argument, everything is fine, however the \cite{} produces problems. I
figure I've
broken some latex law somewhere, any ideas?
Cheers,
Geoff Russell
P.S. I'm using TeXLive 2005,
pdfeTeX 3.141592-1.30.4-2.2 (Web2C 7.5.5)
\documentclass{article}
\def\orglist{}
\def\myglossabbr#1#2#3{%
\long\edef\nnnn{\orglist}%
\def\orglist{\nnnn #3 --- #2\par}%
\expandafter\def\csname#1\endcsname/{ {\it #2} (#3)%
\expandafter\def\csname#1\endcsname/{#3}}%
\expandafter\def\csname org#1\endcsname/{#3 --- #2\par}%
}
\begin{document}
\myglossabbr{WHO}{World Health Organisation}{WHO} % A
\myglossabbr{TWB}{Total Wellbeing Diet\cite{xxx}}{TWB} % B
\WHO/ \WHO/
\TWB/ \TWB/
\orglist
\bibliographystyle{unsrt}
\end{document}
More information about the texhax
mailing list