Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use the glossaries package to generate my acronym list. Since I use the acronyms in the text I have to write the description lowercase. Thus, I have a lowercase description in the acronym list. Can I change that behaviour?

\documentclass[a4paper]{article}
%
\setlength{\parindent}{0pt}
%
\usepackage{xcolor}
\usepackage{hyperref}% Must now be the second-last package that is loaded
\usepackage[acronym]{glossaries}% Must be last package, loaded after hyperref
%
\newglossaryentry{htdoc}{name={hypertext document},description={Text file with references to other content via hyperlinks}}
%
\newglossaryentry{web}{name={World Wide Web},first={World Wide Web (WWW)}, text={WWW},description={A distributed system of linked hypertext documents}}
%
\newacronym{test}{Test}{Lowercase is what I want}
%
\makeglossaries

\begin{document}

% Test of glossary entries
% 1. Capitalization
Here is the acronym in the text \gls{test}
% HTML should not appear in acronym list because not cited and not added
%
\printglossaries
%
\end{document}

That is what I get: Result

share|improve this question
    
I don't really get your point. Could you post a minimal working example (MWE), please? –  Benedikt Bauer Oct 31 '12 at 20:53
    
@BenediktBauer I edited the incomplete description so you don't need an MWE hopefully since I am in a reall hurry (some hours left to finalize 300 pages). Sorry about that. –  louis cypher Oct 31 '12 at 21:12
3  
If you are in a hurry it is far better to provide a complete small document as that makes it much easier to answer the question so makes it more likely you get a timely reply. –  David Carlisle Oct 31 '12 at 21:19

3 Answers 3

up vote 6 down vote accepted

Something like this works for \printglossaries:

\let\firstchar\lowercase
\let\oldprintglossaries\printglossaries
\def\printglossaries{\let\firstchar\uppercase\oldprintglossaries}

\newacronym{test}{Test}{\firstchar{t}his is a test}

Working example

enter image description here

\documentclass[a4paper]{article}
%
\setlength{\parindent}{0pt}
%
\usepackage{xcolor}
\usepackage{hyperref}% Must now be the second-last package that is loaded
\usepackage[acronym]{glossaries}% Must be last package, loaded after hyperref
%
\newglossaryentry{htdoc}{name={hypertext document},description={Text file with references to other content via hyperlinks}}
\newglossaryentry{web}{name={World Wide Web},first={World Wide Web (WWW)}, text={WWW},description={A distributed system of linked hypertext documents}}
%
\let\firstchar\lowercase
\let\oldprintglossaries\printglossaries
\def\printglossaries{\let\firstchar\uppercase\oldprintglossaries}

\newacronym{test}{Test}{\firstchar{L}owercase is what I want}
\makeglossaries

\begin{document}

% Test of glossary entries
% 1. Capitalization
Here is the acronym in the text \gls{test}
% HTML should not appear in acronym list because not cited and not added
%
\printglossaries
%
\end{document}

NoIdx version

If you use \printnoidxglossaries instead, use these redefinition instead:

\let\firstchar\lowercase
\let\oldprintnoidxglossaries\printnoidxglossaries
\def\printnoidxglossaries{\let\firstchar\uppercase\oldprintnoidxglossaries}
share|improve this answer
    
Thanks very much! Can you explain why the first letter is in parens? (I'm actually preparing a MWE). I do not get it completely –  louis cypher Oct 31 '12 at 21:32
    
You mean \firstchar{t} ? the {} delimits the argument to \firstchar which is either \lowercase or \uppercase depending if it is executed in the main document or in the glossary. –  David Carlisle Oct 31 '12 at 21:38
    
Now I get it: you redefine printglossaries to oldprintglossaries and "pipe" it through your macro –  louis cypher Oct 31 '12 at 21:40
    
Actually the otherway round: oldprintglossaries is the orignal saved definition (the \let assignment) then redefine \printglossaries to switch the definition of \firstchar then call the original saved definition of printglossaries under its new name \oldprintglossaries –  David Carlisle Oct 31 '12 at 21:54
    
That works like a charm! –  louis cypher Oct 31 '12 at 21:54

You could use the description option of glossaries which is probably meant to add a different description to the list of acronyms than the long form of the acronym. But this means it also works if description and long form only differ in the first letter. This is obviously not as handy as David's solution since you have to type each form twice...

\documentclass[12pt]{article}
\usepackage[acronym,description]{glossaries}
\makeglossaries

\newacronym[description=This is a test]{test}{Test}{this is a test}

\newglossaryentry{web}{
  name={World Wide Web},
  first={World Wide Web (WWW)},
  text={WWW},
  description={A distributed system of linked hypertext documents}
}
\begin{document}

Here comes \gls{test}

Here comes \gls{web}

\printglossary[type=\acronymtype]

\printglossary
\end{document}
share|improve this answer
    
Thanks also for that one. That solves another problem of mine! –  louis cypher Oct 31 '12 at 21:55

I think you should define the description of all your acronyms as needed in the text, i.e., lower-case. Then, you can redefine the glossary style to produce the output you desire. If I understand you correctly, you want the first letter of the explanation to be capitalized. This can be achieved as follows (note: I am not really familiar with tex programming or the glossaries.sty code - this is what I managed to do after encountering the same problem):

\documentclass{article}

\usepackage[hyperfirst=false,toc,acronym,nogroupskip,nomain,indexonlyfirst]{glossaries}
\newglossarystyle{csuper}{%
%do everything as in the "super" style: (cf. glossaries-user.pdf Example 22 (Creating a new glossary style based on an existing style))
\setglossarystyle{super}%
%Here, I copied the code from glossary-super.sty which defines the \glossentry command.
%Note how the original use of "\glossentrydesc" was exchanged for "\Glossentrydesc".
  \renewcommand{\glossentry}[2]{%
    \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
    \Glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline
  }% 
%
%additionally, I usually want the glossary to be wider and to have dots similar to the table of contents:
\setlength{\glsdescwidth}{0.75\linewidth}%
\renewcommand*{\glspostdescription}{\dotfill}%
}
\setglossarystyle{csuper}

\newacronym{ccdf}{CCDF}{complementary cumulative distribution function}
\newacronym{awgn}{AWGN}{additive white Gaussian noise}
\newacronym{mer}{MER}{message error rate}

\makeglossaries

\begin{document}

Here is the acronym in the text \gls{awgn}. Bla bla blah \gls{mer}. At the Beginning of a sentence, we have to capitalize as follows. \Gls{ccdf} blah blah blah \gls{ccdf}.

Bla bla blah \gls{mer}. Blah blah blah \gls{ccdf}.

\printacronyms[title=List of Acronyms]

\end{document}

Hope that helps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.