I use the package \usepackage[acronym,toc]{glossaries}
In the text I write my acronyms usually via \gls{Acr}
, \acrshort{Acr}
or \acrlong{Acr}
This displays my acronyms like:
Acronymdescription (Acr)
Acr
Acronymdescription
Now my question: How can I get the description in brackets?
Acr (Acronymdescription)
I used in a makeshift manner \acrshort{Acr} (\acrlong{Acr})
Is there a better solution?
Minimal example:
\documentclass{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp} % special chars
\usepackage{lmodern} % better fonts
\usepackage{relsize} % font size relative
\usepackage{xcolor}
\definecolor{navy}{RGB}{0,0,128}
\usepackage[
bookmarks,
bookmarksopen=true,
bookmarksnumbered,
colorlinks=true,
linkcolor=navy, % link colors
anchorcolor=black,% anchor link color
citecolor=navy, % referral to bibliography items in the text
filecolor=navy, % links to local files
menucolor=black, % Acrobat-menuecolor
urlcolor=navy,
backref,
plainpages=false, % needed for correct creation of bookmarks
pdfpagelabels=true, % needed for correct creation of bookmarks
hypertexnames=true, % needed for correct creation of bookmarks
linktocpage % page number linked to text in toc
]{hyperref}
\usepackage[acronym]{glossaries}
\makeglossaries
\newacronym{DIN}{DIN}{Deutsches Institut für Normung}
\begin{document}
Often I need the standard form: \gls{DIN}.
But sometimes I need it like this: \acrshort{DIN} (\acrlong{DIN}).
Better would be an single command that includes the bracket in the link.
\newpage
\printglossary
\end{document}
\newcommand\myacr[1]{\acrshort{#1} (\acrlong{#1})}
in the preamble will be enough. You'll use it\myacr{DIN}
in your document.\newcommand*\myacr[2][]{\glslink[#1]{#2}{\glsentryshort{#2} (\glsentrylong{#2})}}