Quantcast
Channel: Active questions tagged uppercase - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 71

How to get acronyms entries in uppercase letters and capitalize only the first letter of the entries from the glossary?

$
0
0

I found a lot of information on this forum about how to present the entries into a glossary (uppercase, lowercase, first letter capitalized); but I don't understand how to have two different styles for the acronyms list and the glossary, and present the entries differently.Here is the code I use to capitalize the first letter into the glossary; but this affects the acronym list and the glossary. It's OK for the glossary, but I want the acronym entries in uppercase for the whole words...

Here is a full 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}

Viewing all articles
Browse latest Browse all 71

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>