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

Glossaries, how to uppercase every first letter and only first letter (still supporting plural form)

$
0
0

From this question, how do I change it to have first letter of every word in uppercase with a command and only first word's first letter in uppercase with another command (still supporting plural form) form like below:

\documentclass[a4paper,12pt]{article}\usepackage{glossaries}\usepackage{glossary-mcols}\makeatletter\let\oldmakefirstuc\makefirstuc\renewcommand*{\makefirstuc}[1]{%  \def\gls@add@space{}%  \mfu@capitalisewords#1 \@nil\mfu@endcap}\def\mfu@capitalisewords#1 #2\mfu@endcap{%  \def\mfu@cap@first{#1}%  \def\mfu@cap@second{#2}%  \gls@add@space  \oldmakefirstuc{#1}%  \def\gls@add@space{ }%  \ifx\mfu@cap@second\@nnil    \let\next@mfu@cap\mfu@noop  \else    \let\next@mfu@cap\mfu@capitalisewords  \fi  \next@mfu@cap#2\mfu@endcap}\makeatother\newglossaryentry{word}{    name = {word},    description = {word description},    plural = {words},    descriptionplural = {words description}}\newglossaryentry{good word}{    name = {good word},    description = {good word description},    plural = {good words},    descriptionplural = {good words description},    parent = {word}}\makeglossaries\begin{document}1. \gls{word}% correct2. \Gls{word}% correct3. \glspl{word}% correct4. \Glspl{word}% correct5. \glsfirst{word}% correct6. \Glsfirst{word}% correct7. \glsplfirst{word}% gives error8. \Glsplfirst{word}% gives error, doesn't capitalize1p. \gls{good word}% correct2p. \Gls{good word}% correct, it capitalizes every words first letter3p. \glspl{good word}% correct4p. \Glspl{good word}% correct, it capitalizes every words first letter and does plural5p. \glsfirst{good word}% correct, it capitalizes every words first letter and does plural6p. \Glsfirst{good word}% wrong, it should capitalize only first's words first letter.7p. \glsplfirst{good word}% gives error, doesn't make plural8p. \Glsplfirst{good word}% gives error, doesn't capitalize first word's first letter and doesn't make plural\printglossary[style=mcoltreespannav]\end{document}

Result:Result:


Viewing all articles
Browse latest Browse all 71

Trending Articles