使用 gls{} 時強調文本

使用 gls{} 時強調文本

我目前正在寫我的碩士論文。我還將分發 PDF 版本和印刷版本。

由於超連結在列印版本中看起來不太好,我將使用超連結的草稿選項將其刪除。不幸的是,這將導致\gls文本中我的所有縮寫和術語表條目(全部由 組成)將不再突出的問題。我想知道是否有一個選項可以強調在\gls{}不使用 using 的情況下使用的文本\emph{\gls{}},以便讀者知道這些單字在其他地方進行了解釋。最後一個選項意味著需要大量的手動工作來更改所有條目。

\documentclass{article}
\usepackage[style=super,toc,acronym]{glossaries}
\makeglossaries
\newglossarystyle{clong}{
    \renewenvironment{theglossary}%
    {\begin{longtable}{p{.3\linewidth}p{\glsdescwidth}}}%
        {\end{longtable}}%
    \renewcommand*{\glossaryheader}{}%
    \renewcommand*{\glsgroupheading}[1]{}%
    \renewcommand*{\glossaryentryfield}[5]{%
        \glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}%
    \renewcommand*{\glossarysubentryfield}[6]{%
        & \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}%
% Groupskip verhindert den leeren Platz nach anderen Buchstaben
%   \renewcommand{\glsgroupskip}{}
}

\newglossaryentry{ATL-g}{name= {ATL},
    description={Sich wiederholende Tätigkeiten, welche die psychischen und physischen menschlichen Grundbedürfnisse erfüllen}}
\newglossaryentry{ATL}{type=\acronymtype, name={ATL}, description={Aktivitäten des täglichen Leben}, first={Aktivitäten des täglichen Lebens (ATL)\glsadd{ATL-g}}, see=[Glossar]{ATL-g}}

\newacronym{ANN}{ANN}{Artificial Neuronal Network}
\begin{document}
\printglossary[style = clong, type=\acronymtype]
\newpage
\printglossary[style = clong, type=main]
\newpage

\gls{ATL} glossary test with \gls{ANN}

\end{document}

答案1

更新:

如果使用,glossaries-extra您可以變更不同條目類型的文字格式:

\documentclass{article}
\usepackage[style=super,toc,acronym]{glossaries-extra}

\glssetcategoryattribute{general}{textformat}{emph}
\glssetcategoryattribute{acronym}{textformat}{emph}

\glssetcategoryattribute{general}{glossnamefont}{emph}
\glssetcategoryattribute{acronym}{glossnamefont}{emph}


\makeglossaries
\newglossarystyle{clong}{
    \renewenvironment{theglossary}%
    {\begin{longtable}{p{.3\linewidth}p{\glsdescwidth}}}%
        {\end{longtable}}%
    \renewcommand*{\glossaryheader}{}%
    \renewcommand*{\glsgroupheading}[1]{}%
    \renewcommand*{\glossaryentryfield}[5]{%
        \glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}%
    \renewcommand*{\glossarysubentryfield}[6]{%
        & \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}%
% Groupskip verhindert den leeren Platz nach anderen Buchstaben
%   \renewcommand{\glsgroupskip}{}
}

\newglossaryentry{ATL-g}{name= {ATL},
    description={Sich wiederholende Tätigkeiten, welche die psychischen und physischen menschlichen Grundbedürfnisse erfüllen}}
\newglossaryentry{ATL}{type=\acronymtype, name={ATL}, description={Aktivitäten des täglichen Leben}, first={Aktivitäten des täglichen Lebens (ATL)\glsadd{ATL-g}}, see=[Glossar]{ATL-g}}

\newacronym{ANN}{ANN}{Artificial Neuronal Network}

\begin{document}
\printglossary[style = clong, type=\acronymtype]
\newpage
\printglossary[style = clong, type=main]
\newpage

\gls{ATL} glossary test with \gls{ANN}

\end{document}

在此輸入影像描述


您可以透過重新定義來變更條目格式\glsentryfmt

\documentclass{article}
\usepackage{glossaries}
\renewcommand*{\glsentryfmt}{%
  \emph{\glslabel}%
}
\makeglossaries

\begin{document}
\newglossaryentry{utc}{name=UTC, description={Coordinated Universal Time}}
\newglossaryentry{adt}{name=ADT, description={Atlantic Daylight Time}}
\newglossaryentry{est}{name=EST, description={Eastern Standard Time}}

\gls{utc} is 3 hours behind \gls{adt} and 10 hours ahead of \gls{est}.

\printglossaries

\end{document}

相關內容