1

for my current thesis I want to reuse code of another one I have written before. There is the follwing code:

% glossareintraege fett schreiben
\renewcommand*{\glstextformat}[1]{\textbf{#1}} 

% abkuerzungen normal schreiben
\renewcommand*{\acronymfont}[1]{\mdseries #1}

\renewcommand*{\CustomAcronymFields}{%  
      name={\noexpand\acronymfont{\the\glsshorttok}},%  
      sort={\the\glsshorttok},%  
      symbol={\the\glsshorttok},%  
      text={\noexpand\acronymfont{\the\glsshorttok}},%  
      first={\textmd{\the\glslongtok}},%  
      firstplural={\textmd{\the\glslongtok\noexpand\acrpluralsuffix}},%  
      plural={\noexpand\acronymfont{\the\glsshorttok}\noexpand\acrpluralsuffix},%  
      description={\the\glslongtok}
    } 

        \renewcommand*{\SetCustomDisplayStyle}[1]{%  
      \defglsdisplayfirst[#1]{##1##4\space (\acronymfont{\glsentryshort{\glslabel}})}  
      \defglsdisplay[#1]{##1##4}%  
    } 
%    
    \SetCustomStyle 
%    
    \makeglossaries 

The problem about this is, that I get two warnings, because defglsentryfmt and defglsdisplay are deprecated.

Ho can i resolve this issue? Thanks!

tellob
  • 277

1 Answers1

1

As far as I can tell, I think this does what you want:

\documentclass{report}

\usepackage[colorlinks]{hyperref}
\usepackage[acronym]{glossaries}

\makeglossaries

\renewcommand*{\glstextformat}[1]{\textbf{#1}}

\makeglossaries 

\newacronymstyle{md-long-short}%
{%
  \ifglshaslong{\glslabel}{\textmd{\glsgenacfmt}}{\glsgenentryfmt}%
}%
{%
  \GlsUseAcrStyleDefs{long-short}%
  \renewcommand{\acronymfont}[1]{\textmd{##1}}%
}

\setacronymstyle{md-long-short}

\newacronym{abc}{ABC}{Long Form}
\newglossaryentry{sample}{name=sample,description={an example}}

\begin{document}

\gls{sample}.

First: \gls{abc}. Next: \gls{abc}.

\printglossaries

\end{document}
Nicola Talbot
  • 41,153