1

I have customized, with the help of How to combine Acronym and Glossary . However, I can't get acrshort or glsentryshort output.

MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[acronym]{glossaries}

    % 1 -> key
    % 2 -> name
    % 3 -> pluralname
    % 4 -> long
    % 5 -> longplural
    % 6 -> description

    \newcommand*{\newdualentry}[6]{%
        %%% The glossary entry the acronym links to
        \longnewglossaryentry{{#1}g}%
        {%
            name={#2}%title of glossary entry
        }%
        {#6}%description, possibly multiparagraph
        %
        %%% define the acronym and use the see= option
        \newglossaryentry{#1}%
        {%
            type=\acronymtype,%
            name={#2},
            plural={#3},
            long={#4},
            longplural={#5},
            description={#6},
            first={#4 (#2)},
            firstplural={#5 (#3)}
            }%
    }%

    % Renew gls commands

    \let\oldgls\gls
    \let\oldGls\Gls
    \let\oldglspl\glspl
    \let\oldGlspl\Glspl
    %\let\oldacrshort\arcshort


    \renewcommand*{\gls}[1]{\oldgls{#1}\glsadd{{#1}g}}
    \renewcommand*{\Gls}[1]{\oldGls{#1}\glsadd{{#1}g}}
    \renewcommand*{\glspl}[1]{\oldglspl{#1}\glsadd{{#1}g}}
    \renewcommand*{\Glspl}[1]{\oldGlspl{#1}\glsadd{{#1}g}}
    %\renewcommand*{\acrshort}[1]{\oldacrshort{#1}g}

\makeglossaries

\newdualentry{snap}
{SNAP}
{SNAP}
{Stanford Large Network Dataset collection}
{Stanford Large Network Dataset collection}
{D}

\begin{document}

gls is working as expected. First use: \gls{snap}. Second use: \gls{snap}.

However, acrshort, acrlong, acrfull, and glsentry* variants do not work properly.
\\acrshort: \acrshort{snap}
\\acrlong: \acrlong{snap}
\\acrfull: \acrfull{snap}
\\glsentrytext: \glsentrytext{snap}
\\glsentryshort: \glsentryshort{snap}
\\glsentrylong: \glsentrylong{snap}
\\glsentryfull: \glsentryfull{snap}

\clearpage

\printglossary[type=\acronymtype]

\printglossary

\end{document}

enter image description here

1 Answer 1

3

you need to add the short definition.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[acronym]{glossaries}

    % 1 -> key
    % 2 -> name <---- which is also the short
    % 3 -> pluralname
    % 4 -> long
    % 5 -> longplural
    % 6 -> description

    \newcommand*{\newdualentry}[6]{%
        %%% The glossary entry the acronym links to
        \longnewglossaryentry{{#1}g}%
        {%
            name={#2}%title of glossary entry
        }%
        {#6}%description, possibly multiparagraph
        %
        %%% define the acronym and use the see= option
        \newglossaryentry{#1}%
        {%
            type=\acronymtype,%
            name={#2},
            short={#2}, % <------------------ THIS RIGHT HERE
            plural={#3},
            long={#4},
            longplural={#5},
            description={#6},
            first={#4 (#2)},
            firstplural={#5 (#3)}
            }%
    }%

    % Renew gls commands

    \let\oldgls\gls
    \let\oldGls\Gls
    \let\oldglspl\glspl
    \let\oldGlspl\Glspl
    %\let\oldacrshort\arcshort


    \renewcommand*{\gls}[1]{\oldgls{#1}\glsadd{{#1}g}}
    \renewcommand*{\Gls}[1]{\oldGls{#1}\glsadd{{#1}g}}
    \renewcommand*{\glspl}[1]{\oldglspl{#1}\glsadd{{#1}g}}
    \renewcommand*{\Glspl}[1]{\oldGlspl{#1}\glsadd{{#1}g}}
    %\renewcommand*{\acrshort}[1]{\oldacrshort{#1}g}

\makeglossaries

\newdualentry{snap}
{SNAP}
{SNAP}
{Stanford Large Network Dataset collection}
{Stanford Large Network Dataset collection}
{D}

\begin{document}

gls is working as expected. First use: \gls{snap}. Second use: \gls{snap}.

However, acrshort, acrlong, acrfull, and glsentry* variants do not work properly.
\\acrshort: \acrshort{snap}
\\acrlong: \acrlong{snap}
\\acrfull: \acrfull{snap}
\\glsentrytext: \glsentrytext{snap}
\\glsentryshort: \glsentryshort{snap}
\\glsentrylong: \glsentrylong{snap}
\\glsentryfull: \glsentryfull{snap}

\clearpage

\printglossary[type=\acronymtype]

\printglossary

\end{document}
1
  • 1
    I can't believe I've missed this... Thanks.
    – vicaba
    Commented Sep 26, 2019 at 13:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .