從縮寫列表中刪除第一個鏈接

從縮寫列表中刪除第一個鏈接

我有一個按照 @mafp 的答案中給出的格式格式化的術語表,它非常適合我的目的。

然而,在我的主 tex 檔案(即論文)中添加此解決方案,在列印清單的頁面中,我總是會得到清單中外觀的連結。有什麼辦法可以刪除第一個條目嗎?

相關問題也出現了問題@Max,但沒有解決方案。

@mafp 給出的工作範例是

    \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}

我很抱歉寫了一個新問題,但我無法在 @mapf 的解決方案下面發表評論,因為這是我第一次出現在TeX.SE.

答案1

\glsadd{標籤}是索引指令,可自動將位置新增至條目的編號清單。\glsaddall迭代所有定義的條目並使用\glsadd每個條目。它設計用於與nonumberlist自動包含術語表中所有條目的選項結合使用,無論您是否在文件中使用過它們(使用諸如 之類的命令\gls)。如果不抑制號碼列表,\glsaddall將導致所有條目都有一個額外的位置,與文件中\glsaddall使用的位置相對應。

如果您想要一個數字列表並且想要包含所有定義的條目,無論它們是否已在文件中使用,那麼您可以將\glsaddallunused 在文件末尾新增任何尚未使用的剩餘條目。

相關內容