10

I am using the acro package for acronyms because, for a phrase that is not a proper name, I can have the first letter of each word uncapitalized except when it starts off a sentence, in which case the very first letter of the phrase is capitalized. Like other packages, it allows user-specification of plural forms for the acronym and the long phrase. Unlike other packages, it provides these capabilities without having to externally make an index. It is not a full fledge glossary package, but it meets my needs for acronyms.

For the acro package, is there a way to italicize the first occurrence of the phrase, when the acronym is introduced, but without italicizing the acronym itself? The vanilla way of introducing a phrase and its acronym is \ac{label}, which expands to the phrase followed by its acronym in brackets. The command \textit{\ac{label}} causes both the phrase and the acronym to be italicized.

I know that the acronym package (as opposed to the acro package) does the proper italicization with \acfi{label}, at least according to ftp://ftp.tex.ac.uk/pub//tex/macros/lat ... cronym.pdf. However, this is not recognized using the acro package.

I'm not sure if a MWE is needed for this question, but here is a toy file:

  \documentclass{article}
     \usepackage{acro}
     \DeclareAcronym{abc}{
        short=ABC,
        long=alpha bettick crisps
     }
  \begin{document}

     The objective of this report is to test acronyms like
     \ac{abc}.  \acresetall \Ac{abc} are delicious.

     \acresetall
     \textit{\ac{abc}}.

     \cleardoublepage
     \printacronyms[%
        name = {Abbreviations},
        sort = false
     ]

  \end{document}
pluton
  • 16,421
user36800
  • 875

1 Answers1

8

You can use the format/first-long key wich controls the format for the long form on first usage (with \ac, \acf or \acflike and their uppercase, plural and indefinite forms).

\acsetup{format/first-long=\itshape}

A complete example:

\documentclass{article}
\usepackage{acro}

\DeclareAcronym{abc}{ short=ABC, long=alpha bettick crisps }

\acsetup{format/first-long=\itshape}

\begin{document}

The objective of this report is to test acronyms like \ac{abc}. \acresetall\Ac{abc} are delicious.

\ac{abc}.

\cleardoublepage \printacronyms[% name = {Abbreviations}, sort = false, ]

\end{document}

The text in the document:

enter image description here

The entry in the list:

enter image description here

Using

\acsetup{format/first-long=\itshape}

will italicize the long form of the acronym everywhere (including the list of acronyms).

One can do this on a per acronym basis (thanks to cgnieder) using the format/first-long or long-format keys in the acronym declaration:

\documentclass{article}
\usepackage{acro}

\DeclareAcronym{abc}{ short=ABC, long=alpha bettick crisps } \DeclareAcronym{def}{ short=DEF, long=delta elphic furs, format/first-long=\itshape }

\begin{document}

The objective of this report is to test acronyms like \ac{abc}. \acresetall\Ac{abc} are delicious. The objective of this report is to test acronyms like \ac{def}. \acresetall\Ac{def} are delicious.

\cleardoublepage \printacronyms[% name = {Abbreviations}, sort = false, ]

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • Thanks, Gonzalo. At the risk of sounding demanding, I don't suppose one could control this on a per-acronym basis? I don't think its needed when the long phrase is a proper name. And there are some times when I don't want to emphatically pound the table (so to speak), which italics looks like.

    P.S. This thread is crossposted at http://latex-community.org/forum/viewtopic.php?f=44&t=23865

    P.P.S. Odd that a carriage return is interpretted as clicking on the post submission button when composing here.

    – user36800 Sep 17 '13 at 15:09
  • @user36800 you can switch styles at desired points in your document. Please see my updated answer. – Gonzalo Medina Sep 17 '13 at 15:19
  • @user36800 you can specify long-format=<whatever> on a per acronym basis by setting it in \DeclareAcronym: \DeclareAcronym{aa}{ short = aa , long = AAAAAA , long-format = \itshape } – cgnieder Sep 17 '13 at 16:03
  • @cgnieder Ah.... mind if I add that to my answer? – Gonzalo Medina Sep 17 '13 at 16:08
  • @GonzaloMedina feel free to add it :) – cgnieder Sep 17 '13 at 16:09
  • BTW: One can also add first-long-format on a per acronym basis. (IIRC this acts in addition to a possibly specified long-format and not as a replacement.) – cgnieder Sep 17 '13 at 16:13
  • @cgnieder added. Thanks! By the way, lately I've seen some of your recent packages; unfortunately I haven't had the time to look at them in detail, but they are great! – Gonzalo Medina Sep 17 '13 at 16:25