MakeIndex, Nomenclature, Glossaries and AcronymsCapital first letter in acronym list using glossaries.sty

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
OLi
Posts: 2
Joined: Wed Feb 17, 2016 6:00 pm

Capital first letter in acronym list using glossaries.sty

Post by OLi »

Hallo,

I created a list of acronyms using the gossaries package. After updating my MikTeX to the very last version everything works fine. The list is showing the abbreviation on the left and the corresponding explanation on the right. Now, I just want to have the first letter of the explanation capitalized but cannot figure out how to achieve this. This question was already answerred here http://www.latex-community.org/forum/vi ... f=5&t=9966 but the solution did not work for me.

My code Looks like this

Code: Select all

\documentclass[10pt,twoside,headinclude,
               headings=small,fleqn,leqno,english,
               final,bibliography=totocnumbered
]{scrartcl}

\usepackage{etex}
\usepackage[english]{babel}
\usepackage{babelbib}
\usepackage{graphicx}
\usepackage[left=2.5cm,right=2.5cm,top=3.17cm,bottom=2.22cm]{geometry}
\usepackage{indent}
\usepackage{textcomp}
\usepackage{prelim2e}
\usepackage[mediumspace]{SIunits}
\usepackage[all]{xy}
\usepackage{pgf}
\usepackage{circuitikz}
\usepackage{booktabs}
\usepackage[caption=false,font=footnotesize]{subfig}
\usepackage{paralist} 
\usepackage{multirow} 
\usepackage{calc} 
\usepackage{rotating} 
\usepackage{colortbl} 
\usepackage[bookmarks=true]{hyperref}

\usepackage[acronym,nonumberlist,toc,nopostdot]{glossaries}
\setglossarystyle{long}
\setacronymstyle{long-short}
\makeglossaries

\newacronym{TW}{TW}{this word}

\begin{document}
\tableofcontents
\printglossary[type=\acronymtype]

Within the text \gls{TW} should appear in small letters. In the list of acronyms, the Long form of \acrshort{TW} should appear with a capital first letter.

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Capital first letter in acronym list using glossaries.st

Post by Johannes_B »

Welcome,
you are loading a bunch of very old packages there.

I would argue that the description is a sentence and hence should start with a capital letter, also in the input.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
OLi
Posts: 2
Joined: Wed Feb 17, 2016 6:00 pm

Capital first letter in acronym list using glossaries.sty

Post by OLi »

I would argue that the description is a sentence and hence should start with a capital letter, also in the input.
But then I have it with a capital letter within my text.
you are loading a bunch of very old packages there.
I did not get any error Messages. But could there be compatibility problems?
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

Capital first letter in acronym list using glossaries.sty

Post by nlct »

With the basic glossaries package, you'd need to define a new glossary style that uses \Glossentrydesc instead of \glossentrydesc.

Code: Select all

\documentclass{article}

\usepackage{hyperref}
\usepackage[acronym,nonumberlist,toc,nopostdot]{glossaries}

\newglossarystyle{longuc}%
{%
  \setglossarystyle{long}%
  \renewcommand{\glossentry}[2]{%
    \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
    \Glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline
  }%
}

\setglossarystyle{longuc}
\setacronymstyle{long-short}
\makeglossaries

\newacronym{TW}{TW}{this word}

\begin{document}
\tableofcontents
\printglossary[type=\acronymtype]

Within the text \gls{TW} should appear in small letters. In the list
of acronyms, the Long form of \acrshort{TW} should appear with a
capital first letter.

\end{document}
With the extension package glossaries-extra it's easier to make these minor adjustments using the category attributes. For example:

Code: Select all

\documentclass{article}

\usepackage{hyperref}
\usepackage[acronym,nonumberlist]{glossaries-extra}

\setglossarystyle{long}
\setabbreviationstyle[acronym]{long-short}
\makeglossaries

\glssetcategoryattribute{acronym}{glossdesc}{firstuc}

\newacronym{TW}{TW}{this word}

\begin{document}
\tableofcontents
\printglossary[type=\acronymtype]

Within the text \gls{TW} should appear in small letters. In the list
of acronyms, the Long form of \acrshort{TW} should appear with a
capital first letter.

\end{document}
Post Reply