防止词汇表项“加粗”

防止词汇表项“加粗”

有没有办法防止 “加粗”词汇表条目名称和符号词汇表章节?

我已经设法基于其中包括的属性来制作newglossarystyle类似于的。altlistlistsymbolglossaryentryfield

但是,我的一些条目有symbolname文本格式(例如"Ss"),但其他条目包括数学(例如"\ensuremath{N_s}")。

在正文中,上面的内容显示得很好,然而在词汇表章节纯文本条目正在获取大胆的,但数学不是。这看起来不一致且丑陋。

有没有办法防止“加粗”词汇表条目名称和符号词汇表章节?

\makeatletter
\newglossarystyle{altlistSymbol}{%
    \glossarystyle{list}%
    \renewcommand*{\glossaryentryfield}[5]{%
        \item[\glsentryitem{##1}\glstarget{##1}{##4}]%
        \mbox{}\newline%\mbox{}\par\nobreak\@afterheading%
        {##2}%
        \mbox{}\newline%\mbox{}\par\nobreak\@afterheading%
        {##3}\glspostdescription\space {##5}}%
    \renewcommand{\glossarysubentryfield}[6]{%
        \par
        \glssubentryitem{##2}%
        \glstarget{##2}{\strut}##4\glspostdescription\space {##6}}%
}
\makeatother

移动\glstarget{##1}{##4}外面item[...]似乎是肮脏的伎俩并改变文本的左侧位置。

\item[\glsentryitem{##1}]\glstarget{##1}{##4}%

此外,将所有条目更改为数学模式是不可行的。

梅威瑟:

% arara: xelatex
% arara: makeglossaries
% arara: xelatex
% arara: makeglossaries
% arara: xelatex
% arara: xelatex

\documentclass[a4paper,10pt]{article}
\usepackage{glossaries}
\newglossary[slg]{symbols}{sym}{sbl}{Symbols}
\makeglossaries

\newglossaryentry{number}{
type            = {symbols},
name            = {number, glossary entry name},
symbol          = {\ensuremath{N_s}},
sort            = {n},
description     = {number, glossary entry description}
}

\newglossaryentry{subject}{
type            = {symbols},
name            = {subject},
plural          = {subjects},
symbol          = {S},
symbolplural    = {Ss},
sort            = {s},
description     = {plural \glsentrysymbolplural{subject}, glossary entry description}
}   

\makeatletter
\newglossarystyle{altlistSymbol}{%
    \glossarystyle{list}%
    \renewcommand*{\glossaryentryfield}[5]{%
        \item[\glsentryitem{##1}\glstarget{##1}{##4}]%
        \mbox{}\newline%\mbox{}\par\nobreak\@afterheading%
        {##2}%
        \mbox{}\newline%\mbox{}\par\nobreak\@afterheading%
        {##3}\glspostdescription\space {##5}}%
    \renewcommand{\glossarysubentryfield}[6]{%
        \par
        \glssubentryitem{##2}%
        \glstarget{##2}{\strut}##4\glspostdescription\space {##6}}%
}
\makeatother

\begin{document}
\null
\glsaddall

\printglossary[type=symbols,style=altlistSymbol]

\end{document}

答案1

词汇list表样式使用description;您可以通过以下方式重置环境来修改它enumitem

% arara: xelatex
% arara: makeglossaries
% arara: xelatex
% arara: makeglossaries
% arara: xelatex
% arara: xelatex

\documentclass[a4paper,10pt]{article}
\usepackage{enumitem}
\usepackage{glossaries}
\newglossary[slg]{symbols}{sym}{sbl}{Symbols}
\makeglossaries

\show\glsgroupheading

\newglossaryentry{number}{
type            = {symbols},
name            = {number, glossary entry name},
symbol          = {\ensuremath{N_s}},
sort            = {n},
description     = {number, glossary entry description}
}

\newglossaryentry{subject}{
type            = {symbols},
name            = {subject},
plural          = {subjects},
symbol          = {S},
symbolplural    = {Ss},
sort            = {s},
description     = {plural \glsentrysymbolplural{subject}, glossary entry description}
}   

\makeatletter
\newglossarystyle{altlistSymbol}{%
    \glossarystyle{list}%
    \renewcommand*{\glossaryentryfield}[5]{%
        \item[\glsentryitem{##1}\glstarget{##1}{##4}]%
        \mbox{}\newline%\mbox{}\par\nobreak\@afterheading%
        {##2}%
        \mbox{}\newline%\mbox{}\par\nobreak\@afterheading%
        {##3}\glspostdescription\space {##5}}%
    \renewcommand{\glossarysubentryfield}[6]{%
        \par
        \glssubentryitem{##2}%
        \glstarget{##2}{\strut}##4\glspostdescription\space {##6}}%
\renewenvironment{theglossary}
 {\begin{description}[font=\normalfont]}
 {\end{description}}%
}
\makeatother

\begin{document}
\null
\glsaddall

\printglossary[type=symbols,style=altlistSymbol]

\end{document}

在此处输入图片描述

相关内容