I want to typeset my acronyms with abbreviating dots with, for
instance, P.C.A. standing for principal component analysis and use
macros for them.
This question
provides a trick to avoid double dots when the acronym is at the end
of a sentence so that This could be done with a \pca. gives
This could be done with a P.C.A.
and not
This could be done with a P.C.A. .
Now, i would like to combine this approach with the acronym related
commands of glossaries.
Thus, I defined an acronym with this command
\newacronym{pca}{\pca}{principal component analysis}
and then use it with \gls{pca}
This could be done with a \gls{pca}.
However, the glossaries command add some characters between \pca and
the full stop so that the trick mentioned before does not work and I
get a double dot.
Any idea how I could deal with that?
Here is a minimal working example. The xspace package and command
can be removed ; they are intended to conform to the english usage.
\documentclass{article}
\usepackage[acronym]{glossaries}
\makeglossaries
\usepackage{xspace}
\makeatletter
\DeclareRobustCommand{\abren}[1]{%
\@ifnextchar{.}%
{#1}%
{#1.\@\xspace}%
}
\makeatother
\newcommand{\pca}{\abren{P.C.A}}
\newacronym{pca}{\pca}{principal component analysis}
\begin{document}
This could be done with a \pca. %good
This could be done with a \gls{pca}. %good
This could be done with a \gls{pca}.%awkward
\end{document}

glossariespackage for other reasons, but here is how I solved it with a (very ugly)biblatexhack. It could probably be improved by writing the .bib file automatically. Note that I opted for dots in all of the acronyms that should be in the list of abbreviations (the ones pronounced as words are well known and seldom explained, like UNESCO). – ienissei Jul 11 '12 at 08:52