0

I have problems with my glossaries/hyperrefs. The glossaries uses in imy text are links but only refers to the first page and not to the "Abbraviations" or "Symbols". The code is distributed pver several files and I have simplified it as much as possible with reproducing the problem.

Does anyone have an Idea for this issue? All I found by google was not fixing my problem.

Thanks for every helpful response.

\documentclass[
    twoside,
    open=right,
    a4paper,
    pdftex,
    toc=bibliography,
    12pt,
    DIV=14,
    BCOR=6mm,
    headsepline
    ]{scrbook}
        \usepackage[a4paper]{geometry}
        \usepackage[english]{babel}
        \usepackage{blindtext}
        \usepackage{amsmath}
        \usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = blue]{hyperref}
        \usepackage[capitalise, nameinlink]{cleveref} 
        \usepackage[nonumberlist, toc, nomain, nopostdot, acronym, nogroupskip,automake]{glossaries}
        \usepackage[stylemods=longextra]{glossaries-extra}
        \newglossary[sym]{symbolslist}{syt}{syn}{Symbols}
        \newglossary[alg]{Abbreviations}{acr}{acn}{Abbreviations}
        \newglossarystyle{symunit}{%  
            \setglossarystyle{long-name-desc-sym}
                \renewenvironment{theglossary}
                {\begin{longtable}[l]{@{}lp{\glsdescwidth}lp{\glsdescwidth}}}
                {\end{longtable}}
            \renewcommand*{\glossaryheader}{
                \bfseries Symbol & \bfseries Description & \bfseries Unit  
                                    \\\endhead}
            \renewcommand*{\glossentry}[2]{
                \glsentryname{##1}
                & \glossentrydesc{##1}
                & \glossentrysymbol{##1}
                \tabularnewline
            }%
                                    } 
        \newglossarystyle{abbre}{ 
            \setglossarystyle{long-name-desc}
                \renewenvironment{theglossary}
                {\begin{longtable}[l]{@{}lp{\glsdescwidth}lp{\glsdescwidth}}}  
                {\end{longtable}}
            \renewcommand*{\glossaryheader}{
                \bfseries Abbreviations & \bfseries Description  
                                    \\\endhead}
                \renewcommand*{\glossentry}[2]{
                \glossentryname{##1}
                & \glossentrydesc{##1}
                \tabularnewline
            }
                                    }

        \makeglossaries
    \newglossaryentry{abr:bet}{name=BET,
        description={Brunauer-Emmett-Teller},
        first={Brunauer-Emmett-Teller (BET)},
        sort = BET,
        type = Abbreviations}

    \newglossaryentry{abr:bjh}{name=BJH,
        description={Barrett-Joyner-Halenda},
        first={Barrett-Joyner-Halenda (BJH)},
        sort = BJH,
        type = Abbreviations}


    \newglossaryentry{abr:xps}{name=XPS,
        description={X-ray photoelectron spectroscopy},
        first={X-ray photoelectron spectroscopy (XPS)},
        sort = xps,
        type = Abbreviations}

    \pdfminorversion=7
    \begin{document}
    \frontmatter
    \pagenumbering{Roman}
    \begin{titlepage}
    \pdfbookmark{Titelblatt}{Titelblatt}
    \hypertarget{Titelblatt}{}

    \blindtext
    \cleardoubleemptypage

    {\Large \textbf{Abstract}}\\
    \blindtext
    \end{titlepage}
    \printglossary[type=Abbreviations,title=Abbreviations,style=abbre]

    \tableofcontents
    \mainmatter
    \chapter{Introduction}
    \blindtext
    \gls{abr:bjh}
    \gls{abr:bet}
    \gls{abr:xps}


\end{document}
2
  • Please don't split your example over 5 files in two folders. That make it very difficult to test. Move everything in one document. – Ulrike Fischer May 28 '20 at 11:38
  • I have edited it – Niklas May 28 '20 at 11:45
1

Your style definitions are wrong. In the entry definitions you should use \glstarget so that hyperref finds an anchor for the links. For example:

       \renewcommand*{\glossentry}[2]{%
          \glstarget{##1}{\glossentryname{##1}}%<--------------
           & \glossentrydesc{##1}
          \tabularnewline}
1
  • That worked for my mini version. I will now impliment it in the document. Thanks a lot!! – Niklas May 28 '20 at 14:01

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.