用語集から頭字語のエントリを大文字で取得し、エントリの最初の文字のみを大文字にするにはどうすればよいでしょうか?

用語集から頭字語のエントリを大文字で取得し、エントリの最初の文字のみを大文字にするにはどうすればよいでしょうか?

このフォーラムで、用語集のエントリの表示方法 (大文字、小文字、最初の文字を大文字にする) に関する情報をたくさん見つけましたが、頭字語リストと用語集に 2 つの異なるスタイルを設定し、エントリを異なる方法で表示する方法を理解していません。用語集の最初の文字を大文字にするために使用するコードを以下に示します。ただし、これは頭字語リストと用語集に影響します。用語集では問題ありませんが、頭字語エントリは単語全体を大文字にしたいのです...

完全な MWE はこちらです...

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage[acronym,shortcuts,automake,nopostdot]{glossaries}

\usepackage{glossary-tree}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Capitalize the first letter of the entry %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\ignore}[1]{}

\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\capitalize}{>{\SplitList{~}}m}
 {
  \seq_clear:N \l_capitalize_words_seq
  \ProcessList{#1}{\CapitalizeFirst}
  \seq_use:Nn \l_capitalize_words_seq { ~ }
 }
\NewDocumentCommand{\CapitalizeFirst}{m}
 {
  \capitalize_word:n { #1 }
 }

\sys_if_engine_pdftex:TF
 {
  \cs_set_eq:Nc \capitalize_tl_set:Nn { protected@edef }
 }
 {
  \cs_set_eq:NN \capitalize_tl_set:Nn \tl_set:Nn
 }

\cs_new_protected:Nn \capitalize_word:n
 {
  \capitalize_tl_set:Nn \l_capitalize_word_tl { #1 }
  \seq_if_in:NfTF \g_capitalize_exceptions_seq { \tl_to_str:n { #1 } }
   % exception word
   { \seq_put_right:Nn \l_capitalize_words_seq { #1 } } % exception word
   % to be uppercased
   { \seq_put_right:Nx \l_capitalize_words_seq { \tl_mixed_case:V \l_capitalize_word_tl } }
 }
\cs_generate_variant:Nn \tl_mixed_case:n { V }
\NewDocumentCommand{\AppendToList}{m}
 {
  \clist_map_inline:nn { #1 }
   {
    \seq_gput_right:Nx \g_capitalize_exceptions_seq { \tl_to_str:n { ##1 } }
   }
 }
\cs_generate_variant:Nn \seq_if_in:NnTF { Nf }
\seq_new:N \l_capitalize_words_seq
\seq_new:N \g_capitalize_exceptions_seq
\ExplSyntaxOff

\renewcommand{\glsnamefont}[1]{\capitalize{#1}}

%%%%%%%%%%%%%%%%%%

\makeglossaries

\newglossaryentry{latex}
{
        name=latex,
        description={Is a mark up language specially suited for 
scientific documents}
}

\newglossaryentry{maths}
{
        name=mathematics,
        description={Mathematics is what mathematicians do}
}

\newglossaryentry{formula}
{
        name=formula,
        description={A mathematical expression}
}

\newacronym{gcd}{GCD}{Greatest Common Divisor}

\newacronym{lcm}{LCM}{Least Common Multiple}


\begin{document}

The \Gls{latex} typesetting markup language is specially suitable 
for documents that include \gls{maths}. \Glspl{formula} are 
rendered properly an easily once one gets used to the commands.

Given a set of numbers, there are elementary methods to compute 
its \acrlong{gcd}, which is abbreviated \acrshort{gcd}. This 
process is similar to that used for the \acrfull{lcm}.

\printglossary[type=\acronymtype]

\printglossary

\end{document}

答え1

最後に、頭字語を呼び出すときの解決策は次のとおりです。glsnamefond コマンドを次のように変更する必要があります: \renewcommand{\glsnamefont}[1]{#1} \printglossary[type=\acronymtype] これで動作します。頭字語は大文字になり、用語集では最初の文字のみが大文字になります。

関連情報