我怎样才能将\gls
词汇表条目设置为粗体,但不将\glsdesc
定义设置为粗体?
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}
\usepackage[colorlinks=true]{hyperref}
\usepackage[acronym,toc,style=listgroup]{glossaries}
\makeglossaries
\newglossaryentry{apc} {
name = {antigen presenting cell},
description = {cells that present MHC proteins on their surface},
}
% glossary definitions as bold
\renewcommand*{\glstextformat}[1]{\textcolor{black}{\textbf{#1}}}
\begin{document}
\Glspl{apc} are \glsdesc*{apc}.
\printglossary
\end{document}
(请注意,这与以下问题相关,但并不完全相同:使用长样式时如何以粗体显示词汇表条目名称?)
答案1
在你的序言中添加这一行:
\defglsentryfmt{\color{black}\bfseries\glsgenentryfmt}
并删除
\renewcommand*{\glstextformat}[1]{\textcolor{black}{\textbf{#1}}}
梅威瑟:
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
\documentclass{article}
\usepackage[colorlinks=true]{hyperref}
\usepackage[acronym,toc,style=listgroup]{glossaries}
\makeglossaries
\newglossaryentry{apc} {
name = {antigen presenting cell},
description = {cells that present MHC proteins on their surface},
}
% glossary definitions as bold
\defglsentryfmt{\color{black}\bfseries\glsgenentryfmt}
\begin{document}
\Glspl{apc} are \glsdesc*{apc}.
\printglossary
\end{document}
输出: