Hello,
The following example demonstrates the problem:
\documentclass{article}
\usepackage[acronym]{glossaries}
\usepackage{tabularx}
\newacronym{CW}{CW}{continuous-wave}
\begin{document}
\begin{tabularx}{\linewidth}{X}
\gls{CW}
\end{tabularx}
\end{document}
CW will not be expanded. I wonder if this is a bug?
Best,
Leo
Post by Leo\documentclass{article}
\usepackage[acronym]{glossaries}
\usepackage{tabularx}
\newacronym{CW}{CW}{continuous-wave}
\begin{document}
\begin{tabularx}{\linewidth}{X}
\gls{CW}
\end{tabularx}
\end{document}
CW will not be expanded. I wonder if this is a bug?
I haven't looked at the tabularx code, but I expect it's because
tabularx parses its contents more than once (or puts it in a box,
maybe). If you do:
\begin{tabularx}{\linewidth}{X}
\newcommand{\foo}{}\global\let\foo\foo
\end{tabularx}
You'll get two instances of the error message "Command \foo already
defined."
If you know that you haven't used the acronym CW, then you could just
put \glsreset{CW} before \gls{CW} or, if you're not sure, you could do:
\documentclass{article}
\usepackage[acronym]{glossaries}
\usepackage{tabularx}
\newacronym{CW}{CW}{continuous-wave}
\begin{document}
\ifglsused{CW}{\def\resetCW{}}{\def\resetCW{\glsreset{CW}}}
\begin{tabularx}{\linewidth}{X}
\resetCW\gls{CW}
\end{tabularx}
\end{document}
Regards
Nicola Talbot
--
Home: http://theoval.cmp.uea.ac.uk/~nlct/
LaTeX Related Information: http://theoval.cmp.uea.ac.uk/~nlct/latex/
Creating a LaTeX Minimal Example:
http://theoval.cmp.uea.ac.uk/~nlct/latex/minexample/
--- news://freenews.netfront.net/ - complaints: ***@netfront.net ---
Post by Nicola TalbotI haven't looked at the tabularx code, but I expect it's because
tabularx parses its contents more than once (or puts it in a box,
\begin{tabularx}{\linewidth}{X}
\newcommand{\foo}{}\global\let\foo\foo
\end{tabularx}
You'll get two instances of the error message "Command \foo already
defined."
I think this is exactly the reason.
Post by Nicola TalbotIf you know that you haven't used the acronym CW, then you could just
\documentclass{article}
\usepackage[acronym]{glossaries}
\usepackage{tabularx}
\newacronym{CW}{CW}{continuous-wave}
\begin{document}
\ifglsused{CW}{\def\resetCW{}}{\def\resetCW{\glsreset{CW}}}
\begin{tabularx}{\linewidth}{X}
\resetCW\gls{CW}
\end{tabularx}
\end{document}
Regards
Nicola Talbot
Thank you for the workaround. I will put a big warning around the table
and fix it later on.
Best,
Leo
--
H A P P Y H O L I D A Y S!