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.

When using the acronym package I would like to capitalize the first letter in the acronym description (e.g., Direct current). But when used in text I would like to have the word in lower letters.

\documentclass{article}
\usepackage{acronym}

\begin{document}
\begin{acronym}
\acro{DC}{direct current}
\end{acronym}

Batteries run on \ac{DC}.
\end{document}

Output:

DC direct current

Batteries run on direct current (DC).

share|improve this question
    
Welcome! Is the package glossaries an option for you? –  Marco Daniel May 31 '12 at 9:09
    
Hmm, I like \ac{DC} :) –  cgnieder Sep 10 '12 at 16:32

2 Answers 2

up vote 5 down vote accepted

You can patch the \AC@@acro macro that's responsible for printing the list of acronyms:

\documentclass{article}
\usepackage{acronym}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\AC@@acro}{] #3}{] \MakeUppercase #3}{}{}
\patchcmd{\AC@@acro}{] #3}{] \MakeUppercase #3}{}{}
\makeatother

%%% Alternative way (commented out because you may not have the package)
% \usepackage{regexpatch}
% \makeatletter
% \xpatchcmd*{\AC@@acro}{] #3}{] \MakeUppercase #3}{}{}
% \makeatother

\begin{document}
\begin{acronym}
\acro{DC}{direct current}
\end{acronym}

Batteries run on \ac{DC}.
\end{document}
share|improve this answer
    
Thanks for the help! –  Torstein I. Bø May 31 '12 at 10:15

A suggestion can be to define a new Command:

\documentclass{article}
\usepackage{acronym}

\begin{document}
\newcommand*\FirstLetter[2]{#1}
\begin{acronym}
\acro{DC}{\protect\FirstLetter{D}{d}irect current}
\end{acronym}
\renewcommand*\FirstLetter[2]{#2}

Batteries run on \ac{DC}.
\end{document}

Result:

DC Direct current

Batteries run on direct current (DC).

Do work without \protect inside \acronym you can make the definition with expl3:

\ExplSyntaxOn
\cs_new_protected:Npn \FirstLetter #1#2 { #1 }
\ExplSyntaxOff

\ExplSyntaxOn
\cs_set_protected:Npn \FirstLetter #1#2 { #2 }
\ExplSyntaxOff
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.