LaTeX forum ⇒ GeneralFirst Letter of an Acronym as Capital

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

First Letter of an Acronym as Capital

Postby mvd » Mon Jul 11, 2011 8:24 pm

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:
(...) 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 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook
User avatar
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

First Letter of an Acronym as Capital

Postby meho_r » Mon Jul 11, 2011 10:18 pm

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.:

\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

Postby mvd » Tue Jul 12, 2011 10:02 am

Thanks! I'll give it a try ASAP.

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

First Letter of an Acronym as Capital

Postby cgnieder » Fri Oct 05, 2012 12:43 am

I'm normally not jumping on old topics. In this case however I want to present an alternative solution: the acro package:
\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


Return to “General”

Who is online

Users browsing this forum: No registered users and 8 guests