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.

My question is really a further question of this post.

I've used the following code from there in my tex doc.:

    \documentclass{article}
    \usepackage{acronym}
    \usepackage{etoolbox}
    \makeatletter
    \newif\if@in@acrolist
    \AtBeginEnvironment{acronym}{\@in@acrolisttrue}
    \newrobustcmd{\LU}[2]{\if@in@acrolist#1\else#2\fi}

    \newcommand{\ACF}[1]{{\@in@acrolisttrue\acf{#1}}}
    \makeatother

    \begin{document}
    \begin{acronym}
    \acro{SRS}{\LU{S}{s}patial \LU{R}{r}eference \LU{S}{s}ystem}
    \acro{DC}{\LU{D}{d}irect \LU{C}{c}urrent}
    \end{acronym}

    Batteries run on \ac{DC} and \ac{SRS} are different things.
    \end{document}

This works great. But what happens if you would normally want the acronym lower case but, since it appears at the start of a sentence, you want only the first letter of the first word to be capitalised?

I'm now using the same code fragments as above, but when I start the sentence with:

\ac{dc} lorum impsom...

It gives me:

direct current lorum impsom...

instead of:

Direct current lorum impsom...

Is this an easy fix?

FYI, I've already tried \Ac{} or \Acp{} but they didn't work. I suspect I need to create a new command, but I don't know how, which is why I'm coming to you lovely people.

Further, I'm having issues with pluralisation. If I want to pluralise something, I would normally use the \acp{} command. However, if I want capitals AND pluralisation, \ACP{} doesn't work.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

One possibility would be to switch to the acro package. It provides what you need:

\documentclass{article}
\usepackage{acro}
\acsetup{list-long-format=\capitalisewords}
\usepackage{mfirstuc}% provides \capitalisewords

\DeclareAcronym{SRS}{
  short = SRS ,
  long  = spatial reference system
}
\DeclareAcronym{DC}{
  short = DC ,
  long  = direct current
}

\begin{document}

Batteries run on \ac{DC} and \ac{SRS} are different things.
Batteries run on \ac{DC} and \ac{SRS} are different things.

\Acl{DC} bla ...

\printacronyms

\end{document}

enter image description here

share|improve this answer
    
Have tried using acro before but I had major issues. Unfortunately I don't document anything and my memory is appalling so I can't remember what the issues were. So I'm trying again. I think I've managed to get it to work but biblatex/biber has completely spazzed out and is preventing compilation, so once I've finished that I'll report back. –  E_L Nov 2 '12 at 15:49
1  
@E_L if you're having issues with acro it'd be nice if you reported them to bitbucket.org/cgnieder/acro/issues –  cgnieder Nov 2 '12 at 15:57
    
Will do @cgnieder. Like I said, I can't remember the original reasons I gave up on acro but if I find some clangers I let you know. –  E_L Nov 5 '12 at 9:17
    
I'm getting loads of errors: ! Undefined control sequence. l.38 \newacro {dc}[\AC@hyperlink{dc}{DC}]{\LU {D}{d}irect \LU {C}{c}urrent} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., '\hobx'), type 'I' and the correct spelling (e.g., 'I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. –  E_L Nov 5 '12 at 14:28
1  
That's because \capitalisewords from mfirstuc recognizes “analogue-to-digital” as one word. Leaving the hyphens out the package suggests something like \capitalisewords{analogue\space to digital converter} to produce “Analogue to Digital Converter” –  cgnieder Nov 6 '12 at 10:24

[This is an attempt at a solution, not a solution!]

The ability to choose between mixed cases in the acronym package is desperately lacking. The new command you alluded to in your original question would be really helpful. I've had a crack but can't get it to work, it needs to be something like:

\newrobustcmd{\LU}[4]{\if@in@acrolist#1\else#2\fi} % upper case in acronym list lower case elsewhere
\newcommand{\AC}[1]{{\@in@acrolisttrue\ac{#1}}} % for choosing upper case elsewhere
\newcommand{\UAC}[1]{{\@in@acrolisttrue\ac{#3}}} % for choosing upper/lower case elsewhere
\newcommand{\LAC}[1]{{\@in@acrolisttrue\ac{#4}}} % for choosing lower/upper case elsewhere

\begin{acronym}
\acro{Abr}[\LU{A}{a}{a}{A}br]{\LU{A}{a}{A}{a}bbreviation}
\end{acronym}

Getting the commands to work might involve using ## and \protect. Hope this inspires someone to give it a go.

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.