1

I have a glossary formatted as given in the answer of @mafp which works perfectly for my purposes.

However adding this solution in my main tex file which is a thesis, in the page where the list is printed i always get a link for the appearance in the list. Is there any way to remove this first entry?

The same problem appeared in the related question of @Max, but there is no solution.

The working example @mafp gave is

    \documentclass[a4paper,10pt]{article}

    \usepackage{hyperref}
    \hypersetup{
        colorlinks=true,
        linkcolor=blue,
        filecolor=magenta,      
        urlcolor=cyan,
    }

    \usepackage{glossaries}
    \makeglossaries

    \renewcommand{\glossarysection}[2][]{} % not to show word glossary


    \newglossaryentry{A}{%
    name={foo},%
    description={bar},%
    %user1={cm}%
    }

    \newglossaryentry{B}{%
    name={AAPL},%
    description={apples},%
    %user1={box}%
    }

    \newglossaryentry{C}{%
    name={BTR},%
    description={books to read},%
    %user1={LoC}%
    }

    \newglossaryentry{D}{%
    name={BTRTIO},%
    description={books to read that I own},%
    %user1={shelf},%
    %parent={C}
    }

    \newglossarystyle{aiaostyle}{%
    % put the glossary in a longtable environment:
    \renewenvironment{theglossary}%
     {\begin{longtable}{lp{\glsdescwidth}cp{\glspagelistwidth}}}%
     {\end{longtable}}%
    % Set the table’s header: title row
    \renewcommand*{\glossaryheader}{%
     \bfseries Term & \bfseries Description & 
     \bfseries Units & \bfseries Page List
     \\\endhead}%
    % No table header:
    %\renewcommand*{\glossaryheader}{}%
    % No heading between groups:
     \renewcommand*{\glsgroupheading}[1]{}%
    % Main (level 0) entries displayed in a row optionally numbered:
     \renewcommand*{\glossaryentryfield}[5]{%
        \glstarget{##1}{##2}% Name
        & ##3% Description
        & \glsentryuseri{##1}% Units
        & ##5% Page list
        \\% end of row
     }%
    % Similarly for sub-entries (no sub-entry numbers):
    \renewcommand*{\glossarysubentryfield}[6]{%
        % ignoring first argument (sub-level)
        \glstarget{##2}{##3}% Name
        & ##4% Description
        & \glsentryuseri{##2}% Units
        & ##6% Page list
        \\% end of row
     }%
    % Nothing between groups:
    \renewcommand*{\glsgroupskip}{}%
    }



    \begin{document}
    \null
    \glsaddall

    \glossarystyle{aiaostyle}
    \setlength{\glsdescwidth}{0.5\textwidth}
    \setlength{\glspagelistwidth}{0.1\textwidth}
    \printglossaries

    \newpage
    test entry \gls{A}.

    \end{document}

I am sorry for writting a new question but i cannot comment below the solution of @mapf since this is my first appearance in TeX.SE.

  • I can't compile the example since it fails due to some error in the definition of aiaostyle, but perhaps \glsdisablehyper is useful; at the moment hyperref is not loaded anyway ;-) Side note: \glossarystyle is a deprecated command, use \setglossarystyle instead, please.... and welcome to TeX.SE – user31729 Apr 18 '17 at 18:41
  • Are you referring to the first number in the location list for each entry, which in your MWE is created with \glsaddall at the start of your document? – Nicola Talbot Apr 18 '17 at 19:22
  • I have changed the MWE to show the effect of hyperref in many pages. But @NicolaTalbot had already answered. Can you please post this as an answer so that i can accept it? You 've been very helpful. – Christos Apr 18 '17 at 19:35
  • @ChristianHupfer thanks for the notification for the deprecated command. Although it seems that in the particular example it produces an error. I 'll play around with it and maybe i will figure it out. – Christos Apr 18 '17 at 19:37
1

\glsadd{label} is an indexing command that automatically adds a location to the entry's number list. \glsaddall iterates over all the defined entries and uses \glsadd for each entry. It's designed for use in conjunction with the nonumberlist option to automatically include all entries in the glossary, regardless of whether or not you have used them in the document (with commands like \gls). If the number list isn't suppressed, \glsaddall will cause all entries to have an extra location corresponding to the place in the document where \glsaddall was used.

If you want a number list and you want to include all defined entries, regardless of whether or not they have been used in the document, then you can put \glsaddallunused at the end of the document to add any remaining entries that haven't been used.

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.