1

I use the acro package to manage acronyms. Usually I have defined them to use capitals for both the short and long version. However, in some cases in the text I would like to use the long version without capitals.

\documentclass[]{article}

\usepackage{acro}

\DeclareAcronym{CD}{
        short = CD ,
        long = Compact Disc
}

\begin{document} 
\acl{CD} % expected result: Compact Disc

\MakeLowercase{\acl{CD}} % expected result: compact disc
\end{document}

Compilation fails because the \MakeLowercase command somehow changes the acronym CD to cd before accessing the long version.

  • It doesn't seem like \acl is expandable. So to make it work I guess your best bet is to define an alternate long form which is lower case and use that one. – Skillmon Jan 8 '18 at 9:01
  • There are the \Ac variants of all the acro commands which uppercase the first character. Not exactly the desired description, but could be easily used to generate "Compact disc" and "compact disc". – Dai Bowen Jan 8 '18 at 13:24
  • Why don't you just write it out as 'compact disc' in the text? – thymaro Jan 9 '18 at 8:29
3

Use the optional argument and the option long-format:

\documentclass{article}

\usepackage{acro}

\DeclareAcronym{CD}{
  short = CD ,
  long = Compact Disc
}

\begin{document} 
\acl{CD} % expected result: Compact Disc

\acl[long-format=\MakeLowercase]{CD} % expected result: compact disc

\end{document}
  • I am slowly starting to not see any more how a command is more useful that just writing 'compact disc'. I mean, I am well aware LaTeX is all about wysiwymand I love it for that, but sometimes you just gotta be pragmatic and see the simple solution. This is a very specific case where the text should show as 'compact disc' and the command with its option is so complex, that changing it's behaviour in the preamble isn't meaningful or it would render the command meaningless. What do you think about it? Can you think of a case where this approach would be more pragmatic than writing 'compact disc'? – thymaro Jan 9 '18 at 8:27
  • Oh, and, uhm, I still upvoted, since the suggested solution, of course, answers the question quite elegantly, regardless of it's grade of usefulness, which is to be left to OP. – thymaro Jan 9 '18 at 8:31
  • @thymaro if you don't find the package useful then don't use it. – clemens Jan 9 '18 at 10:41
  • hmm, don't get me wrong, that's not what I meant. I find the package highly useful. I just don't understand the benefit of writing \acl[long-format=\MakeLowercase]{CD} over just writing compact disc, in this case. What does one benefit from writing it with commands in this case? – thymaro Jan 9 '18 at 13:15
  • 1
    In the case that you are absolutely sure, how your acronyms are spelled, then it is of course not necessary to have a command for it. But in my case, I'm not 100% sure how to spell the acronyms. E.g. I could decide later to spell it like Compact-Disc (If this is correct or not is another question...) – W. Alpha Jan 9 '18 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.