대문자로 된 약어 항목을 가져오고 용어집 항목의 첫 글자만 대문자로 표시하는 방법은 무엇입니까?

대문자로 된 약어 항목을 가져오고 용어집 항목의 첫 글자만 대문자로 표시하는 방법은 무엇입니까?

나는 이 포럼에서 항목을 용어집(대문자, 소문자, 첫 글자 대문자)에 표시하는 방법에 대한 많은 정보를 찾았습니다. 하지만 약어 목록과 용어집에 대해 서로 다른 두 가지 스타일을 사용하고 항목을 다르게 표시하는 방법을 이해하지 못합니다. 다음은 용어집의 첫 글자를 대문자로 표시하는 데 사용하는 코드입니다. 그러나 이는 약어 목록과 용어집에 영향을 미칩니다. 용어집은 괜찮지만, 전체 단어에 대해 대문자로 된 약어 항목을 원합니다...

여기에 전체 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] 이제 작동합니다. 약어는 대문자입니다. , 용어집에서는 첫 글자만 대문자로 표시됩니다.

관련 정보