General ⇒ Capitalize first letter of names in Glossaries list
-
- Posts: 52
- Joined: Sat Jun 07, 2008 11:56 am
Capitalize first letter of names in Glossaries list
I'm using the glossaries package. It prints my glossary at the end of the document, but all the entry names are in lowercase. I'd like to know how I can make the first letter of each entry name in the glossary uppercase. The same for the list of acronyms would also be appreciated.
Note: I don't want to know how to make the first letter uppercase in the text (I know about \Gls instead of \gls), only in the glossary list at the end.
Thanks,
Rich
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
-
- Posts: 52
- Joined: Sat Jun 07, 2008 11:56 am
Capitalize first letter of names in Glossaries list
Code: Select all
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
Any ideas?
Capitalize first letter of names in Glossaries list
Code: Select all
\documentclass{article}
\usepackage[acronym]{glossaries}
\makeglossaries
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\newglossaryentry{sample}{name=sample,description=a sample entry}
\newacronym{abc}{abc}{a sample acronym}
\begin{document}
\gls{sample}. \gls{abc}.
\printglossaries
\end{document}
Code: Select all
\documentclass{article}
\usepackage[acronym]{glossaries}
\makeglossaries
\newglossaryentry{sample}{name=sample,description=a sample entry}
\newacronym{abc}{abc}{a sample acronym}
\begin{document}
\gls{sample}. \gls{abc}.
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\printglossary
\renewcommand{\glsnamefont}[1]{\MakeUppercase{#1}}
\printglossary[type=acronym]
\end{document}
Code: Select all
\documentclass{article}
\usepackage[acronym,smallcaps]{glossaries}
\makeglossaries
\newglossaryentry{sample}{name=sample,description=a sample entry}
\newacronym{abc}{abc}{a sample acronym}
\begin{document}
\gls{sample}. \gls{abc}.
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\printglossary
\renewcommand{\glsnamefont}[1]{\textmd{#1}}
\printglossary[type=acronym]
\end{document}
Nicola Talbot
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
-
- Posts: 52
- Joined: Sat Jun 07, 2008 11:56 am
Capitalize first letter of names in Glossaries list
I found out why I was getting an error with \makefirstuc: there are math symbols in my list of acronyms. E.g. I have an entry like this:
Code: Select all
\newacronym{velocity}{$\sigma$}{node velocity}
E.g. I have like DTN, RWP, opnet (this is displayed in small caps, but I want the o to be big).
Just a small annoyance, though. If you know the answer I'd love to hear it!
Thanks again,
Rich
Capitalize first letter of names in Glossaries list
You could trystinkinrich88 wrote: I found out why I was getting an error with \makefirstuc: there are math symbols in my list of acronyms. E.g. I have an entry like this:
Code: Select all
\newacronym{velocity}{$\sigma$}{node velocity}
Code: Select all
\newacronym{velocity}{\null$\sigma$}{node velocity}
Code: Select all
\documentclass{article}
\usepackage[acronym,smallcaps]{glossaries}
\makeglossaries
\newglossaryentry{sample}{name=sample,description=a sample entry}
\newacronym{abc}{abc}{a sample acronym}
\newacronym[sort=sigma]{velocity}{\null$\sigma$}{node velocity}
\begin{document}
\gls{sample}. \gls{abc}. \gls{velocity}.
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\printglossary
\renewcommand{\glsnamefont}[1]{\textmd{\makefirstuc{#1}}}
\printglossary[type=acronym]
\end{document}
Nicola Talbot
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
-
- Posts: 52
- Joined: Sat Jun 07, 2008 11:56 am
Re: Capitalize first letter of names in Glossaries list

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Capitalize first letter of names in Glossaries list
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Capitalize first letter of names in Glossaries list
I would like to define the acronym in the text using lowercase letters as follows:
sample acronym (SA)
degrees of freedom (DOF)
While recurrences will be displayed as:
SA
DOF
but, at the acronyms list, I would like it to appear with uppercase letters as:
SA - Sample Acronym
DOF - Degrees of Freedom
Using your code with the following slight changes, I can't get it right:
Code: Select all
\documentclass{article}
\usepackage[acronym]{glossaries}
\makeglossaries
\newglossaryentry{sample}{name=sample,description=a sample entry}
\newacronym{sa}{SA}{Sample Acronym}
\newacronym{dof}{DOF}{Degrees of Freedom}
\begin{document}
This is a \gls{sample}. And this is a \gls{sa} while another one will be \gls{dof}.
Recurrences are \gls{sa} and \gls{dof}.
\renewcommand{\glsnamefont}[1]{\makefirstuc{#1}}
\printglossary
\printglossary[type=acronym,style = super]
\end{document}