3

I use glossaries and define besides standard acronyms also some acronyms like this:

\documentclass{scrreprt}

\usepackage{xcolor} 

\definecolor{navy}{RGB}{0,0,128}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}

\usepackage[
    colorlinks=true,
    linkcolor=navy,
    anchorcolor=black,
    urlcolor=navy
]{hyperref}

\usepackage[acronym,toc]{glossaries}

\makeglossaries

\newglossaryentry{P2P}{
    type=\acronymtype, 
    name={P2P}, 
    description={Peer-to-Peer}, 
    first={Peer-to-Peer (P2P)}, 
    see=[\glossaryname:]{Peer-to-Peer}
}
\newglossaryentry{Peer-to-Peer}{
    name={Peer-to-Peer},
    description={Eine direkte Kommunikation zwischen zwei Teilnehmern}
}

\newglossaryentry{Plug-in}{
    name={Plug-in},
    description={Ein Softwaremodul, das zur Laufzeit eingebunden werden kann und damit die Funktionalität eines Systems erweitert}
}

\newacronym{DIN}{DIN}{Deutsches Institut für Normung}


\newcommand*\acrshortlong[2][]{\glslink[#1]{#2}{\glsentryshort{#2} (\glsentrylong{#2})}}

\begin{document}

Works as expected:

gls: \gls{Plug-in}

gls: \gls{DIN}

acrshort: \acrshort{DIN}

acrshortlong: \acrshortlong{DIN}

gls: \gls{Peer-to-Peer}

Not as expected:

acrshort: \acrshort{P2P}

acrshortlong: \acrshortlong{P2P}

\glossarystyle{altlist}
\printglossary[type=\acronymtype]

\glossarystyle{altlist}
\printglossary

\end{document}

Unfortunately the \acr... commands dont work as expected with acronyms defined via \newglossaryentry with type=\acronymtype

Anyone an idea how to get these cross-referencing acronyms also working as expected?

  • 1
    \newacronym also sets the long and short keys, which are referenced by \glsentrylong and \glsentryshort. However, why don't you you just use \newacronym[see={[\glossaryname:]{Peer-to-Peer}}]{P2P}{P2P}{Peer-to-Peer}? – Nicola Talbot Feb 14 '14 at 13:49
  • Thanks a lot! Sometimes are the easier solutions the better ones :) – kitingChris Feb 15 '14 at 14:57
3

(Converting comment into an answer.)

Commands like \glsentrylong and \glsentryshort access the long and short keys. These keys (and their plural versions) are set by \newacronym but have to be explicitly set, if required, when using \newglossaryentry. However in this case it's simpler to just use the optional argument of \newacronym to set the cross-referencing information:

\newacronym[see={[\glossaryname:]{Peer-to-Peer}}]{P2P}{P2P}{Peer-to-Peer}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.