词汇表包的替代脚注样式缩写显示

词汇表包的替代脚注样式缩写显示

我使用了词汇表包中的首字母缩略词footnote-desc作为首字母缩略词样式。通过此设置,第一次引入首字母缩略词时,我会得到一个脚注,给出长首字母缩略词。如果可能的话,我希望得到的是显示“短首字母缩略词:长首字母缩略词”的脚注,而无需更改选项。在这里,在示例中,它将在脚注中给出:“1D:一维”。

这是 MWE

\documentclass{report}

\usepackage[acronym,
            nomain,
            indexonlyfirst,
            hyperfirst,
            ]{glossaries}


\newacronym{1D}{1D}{\textit{One-Dimensional}}
\newacronym{2D}{2D}{\textit{Two-Dimensional}}

\setacronymstyle{footnote-desc}

\makenoidxglossaries

\begin{document}

\gls{1D}, \gls{2D}.


\printnoidxglossary[
            style=listgroup,
            type=acronym]

\end{document}

答案1

你可以定义自己的风格来做到这一点。例如:

\newacronymstyle{myfootnote}%
{%
  \GlsUseAcrEntryDispStyle{footnote}%
}%
{%
  \GlsUseAcrStyleDefs{footnote}%
  \renewcommand*{\genacrfullformat}[2]{%
   \protect\firstacronymfont{\glsentryshort{##1}}##2%
   \protect\footnote{\glsentryshort{##1}: \glsentrylong{##1}}%
  }%
  \renewcommand*{\Genacrfullformat}[2]{%
   \firstacronymfont{\Glsentryshort{##1}}##2%
   \protect\footnote{\Glsentryshort{##1}: \glsentrylong{##1}}%
  }%
  \renewcommand*{\genplacrfullformat}[2]{%
   \protect\firstacronymfont{\glsentryshortpl{##1}}##2%
   \protect\footnote{\glsentryshortpl{##1}: \glsentrylongpl{##1}}%
  }%
  \renewcommand*{\Genplacrfullformat}[2]{%
   \protect\firstacronymfont{\Glsentryshortpl{##1}}##2%
   \protect\footnote{\Glsentryshortpl{##1}: \glsentrylongpl{##1}}%
  }%
}%


\setacronymstyle{myfootnote}

\newacronym{1D}{1D}{\textit{One-Dimensional}}
\newacronym{2D}{2D}{\textit{Two-Dimensional}}

如果所有缩写都使用,则将移出bit 并移入 style\textit更符合语义。例如:\textit\newacronym

\newacronymstyle{myfootnote}%
{%
  \GlsUseAcrEntryDispStyle{footnote}%
}%
{%
  \GlsUseAcrStyleDefs{footnote}%
  \renewcommand*{\GenericAcronymFields}%
   {description={\textit{\the\glslongtok}}}%
  \renewcommand*{\genacrfullformat}[2]{%
   \protect\firstacronymfont{\glsentryshort{##1}}##2%
   \protect\footnote{\glsentryshort{##1}:
     \textit{\glsentrylong{##1}}}%
  }%
  \renewcommand*{\Genacrfullformat}[2]{%
   \firstacronymfont{\Glsentryshort{##1}}##2%
   \protect\footnote{\Glsentryshort{##1}: 
     \textit{\glsentrylong{##1}}}%
  }%
  \renewcommand*{\genplacrfullformat}[2]{%
   \protect\firstacronymfont{\glsentryshortpl{##1}}##2%
   \protect\footnote{\glsentryshortpl{##1}: 
     \textit{\glsentrylongpl{##1}}}%
  }%
  \renewcommand*{\Genplacrfullformat}[2]{%
   \protect\firstacronymfont{\Glsentryshortpl{##1}}##2%
   \protect\footnote{\Glsentryshortpl{##1}: 
     \textit{\glsentrylongpl{##1}}}%
  }%
}%

\setacronymstyle{myfootnote}

\newacronym{1D}{1D}{One-Dimensional}
\newacronym{2D}{2D}{Two-Dimensional}

相关内容