
Ich habe in diesem Forum viele Informationen darüber gefunden, wie man die Einträge in einem Glossar präsentiert (Großbuchstaben, Kleinbuchstaben, erster Buchstabe groß); aber ich verstehe nicht, wie ich zwei verschiedene Stile für die Akronymliste und das Glossar haben und die Einträge unterschiedlich präsentieren kann. Hier ist der Code, den ich verwende, um den ersten Buchstaben im Glossar groß zu schreiben; aber das betrifft die Akronymliste und das Glossar. Für das Glossar ist es in Ordnung, aber ich möchte die Akronymeinträge für die ganzen Wörter in Großbuchstaben ...
Hier ist ein vollständiges 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}
Antwort1
Schließlich liegt die Lösung beim Aufrufen der Akronyme darin, dass Sie Ihren glsnamefond-Befehl folgendermaßen ändern müssen: \renewcommand{\glsnamefont}[1]{#1} \printglossary[type=\acronymtype] Jetzt funktioniert es: Akronyme werden in Großbuchstaben angezeigt, im Glossar wird nur der erste Buchstabe groß geschrieben.