GeneralFirst Letter of an Acronym as Capital

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
mvd
Posts: 2
Joined: Mon Jul 11, 2011 8:16 pm

First Letter of an Acronym as Capital

Post by mvd »

Hi all,

I have all acronyms defined with lower case, e.g.,
\acro{TEDC}{tunable electrical dispersion compensation}.

However, when I start a new sentence:

Code: Select all

(...) dispersion compensation. \ac{TEDC} using (.)))
in the output pdf file I get
(...) dispersion compensation. tunable electrical dispersion compensation (TEDC) (...)

What should I do to set the first character of an acronym to Capital size in the beginning of a sentence, i.e.,

(...) dispersion compensation. Tunable electrical dispersion compensation (TEDC) (...)

??

Thanks for your help!
Last edited by cgnieder on Fri Oct 05, 2012 12:36 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

First Letter of an Acronym as Capital

Post by meho_r »

I suppose you're using acronym package. I'm not sure if there is an easy way to do that. However, you might try glossaries package, which has implemented this feature. E.g.:

Code: Select all

\documentclass{book}

\usepackage[acronym,shortcuts]{glossaries}

\makeglossaries

%%% Glossaries/Acronyms
\newacronym{tedc}{TEDC}{tunable electrical dispersion compensation}

\begin{document}

Some text.  \Ac{tedc}.

\printglossaries

\end{document}
As you can see, \Ac command makes sure that first letter is capitalized.

Note that, if your file is named, e.g., myfile.tex, you'll need to run the sequence:
1. latex myfile
2. makeglossaries myfile
3. latex myfile
to get glossaries/acronyms displayed correctly.

You'll need to change \acro commands for defining acronyms, but, thanks to shortcuts package option, you don't have to change \ac commands in text.
mvd
Posts: 2
Joined: Mon Jul 11, 2011 8:16 pm

Re: First Letter of an Acronym as Capital

Post by mvd »

Thanks! I'll give it a try ASAP.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

First Letter of an Acronym as Capital

Post by cgnieder »

I'm normally not jumping on old topics. In this case however I want to present an alternative solution: the acro package:

Code: Select all

\documentclass{book}
\usepackage{acro}

\DeclareAcronym{tedc}{TEDC}{tunable electrical dispersion compensation}

\begin{document}

Some text. \Ac{tedc}.
\printacronyms

\end{document}
Regards
site moderator & package author
Post Reply