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:
  1. (...) 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.
Reason: added code markup

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

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

  1. \documentclass{book}
  2.  
  3. \usepackage[acronym,shortcuts]{glossaries}
  4.  
  5. \makeglossaries
  6.  
  7. %%% Glossaries/Acronyms
  8. \newacronym{tedc}{TEDC}{tunable electrical dispersion compensation}
  9.  
  10. \begin{document}
  11.  
  12. Some text. \Ac{tedc}.
  13.  
  14. \printglossaries
  15.  
  16. \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

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

Thanks! I'll give it a try ASAP.

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

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:
  1. \documentclass{book}
  2. \usepackage{acro}
  3.  
  4. \DeclareAcronym{tedc}{TEDC}{tunable electrical dispersion compensation}
  5.  
  6. \begin{document}
  7.  
  8. Some text. \Ac{tedc}.
  9. \printacronyms
  10.  
  11. \end{document}


Regards
site moderator & package author


Return to “General”

Who is online

Users browsing this forum: No registered users and 4 guests