5

I am trying to write a List of Acronyms and I am trying to work out how to edit the output format of the \printacronyms lists. The way I would like them to look is as below, it is not essential that the spacing be exactly as shown below but that is the general idea.

Please find below an MWE for your convenience, thank you

Hyphenated style

\documentclass{scrreprt}
\usepackage{acro}

% probably a good idea for the nomenclature entries:
%\acsetup{first-style=long}

% class `abbrev': abbreviations:
\DeclareAcronym{ny}{
  short = NY ,
  long  = New York ,
  class = abbrev
}
\DeclareAcronym{la}{
  short = LA ,
  long  = Los Angeles ,
  class = abbrev
}
\DeclareAcronym{un}{
  short = UN ,
  long  = United Nations ,
  class = abbrev
}

% class `nomencl': nomenclature
\DeclareAcronym{angelsperarea}{
  short = \ensuremath{a} ,
  long  = The number of angels per unit area ,
  sort  = a ,
  class = nomencl
}
\DeclareAcronym{numofangels}{
  short = \ensuremath{N} ,
  long  = The number of angels per needle point ,
  sort  = N ,
  class = nomencl
}
\DeclareAcronym{areaofneedle}{
  short = \ensuremath{A} ,
  long  = The area of the needle point ,
  sort  = A ,
  class = nomencl ,
  cite =  ,
}

\begin{document}

\ac{ny}, \ac{la} \ac{ny} and \ac{un} are abbreviations whereas
\ac{angelsperarea}, \ac{numofangels} and \ac{areaofneedle} are part of the
nomenclature

\printacronyms

\printacronyms[include-classes=nomencl,name=Nomenclature]

\end{document}

Update Further problem (Solved)

I have implemented the wrapped labeling environment and it looks perfect, however I want to print the acronyms irrespective of whether I use them or not, so I changed the \acsetup{list-type=acronyms,only-used=false} command as shown. The problem is that now I only get a maximum of 4 acronyms in each print list, this does not happen however if I simply \printacronyms. Could you help make sense of this please?

Please find updated MWE:

\documentclass{scrreprt}
\usepackage{acro}

% \DeclareAcronym{ny}{
% short = NY ,
% short-plural = ,
% long = New York ,
% long-plural = ,
% class = city ,
% cite = NewYork
% }

\DeclareAcronym{pwr}{
    short = PWR ,
    short-plural = s ,
    long = Pressurised Water Reactor ,
    long-plural = s ,
    class = reactors ,
}

\DeclareAcronym{ebr}{
    short = EBR-I ,
    short-plural =  ,
    long = Experimental Breeder Reactor I ,
    long-plural =  ,
    class = reac.exist ,
}

\DeclareAcronym{lwr}{
    short = LWR ,
    short-plural = s ,
    long = Light Water Reactor ,
    long-plural = s ,
    class = reactors ,
}

\DeclareAcronym{epr}{
    short = EPR ,
    short-plural =  ,
    long = European Pressurised Reactor ,
    long-plural =  ,
    class = reac.exist ,
}

\DeclareAcronym{candu}{
    short = CANDU ,
    short-plural =  ,
    long = CANada Deuterium Uranium ,
    long-plural =  ,
    class = reac.exist ,
}

\DeclareAcronym{acr}{
    short = ACR ,
    short-plural = s ,
    long = Advanced CANDU Reactor ,
    long-plural = s ,
    class = reactors ,
}

\DeclareAcronym{sfr}{
    short = SFR ,
    short-plural = s ,
    long = Sodium Fast Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{lfr}{
    short = LFR ,
    short-plural = s ,
    long = Lead Fast Reactor ,
    long-plural = s ,
    class = reactors ,
}

\DeclareAcronym{gfr}{
    short = GFR ,
    short-plural = s ,
    long = Gas Fast Reactors ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{msr}{
    short = MSR ,
    short-plural = s ,
    long = Molten Salt Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{scwr}{
    short = SCWR ,
    short-plural = s ,
    long = Supercritical Water Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{vhtr}{
    short = VHTR ,
    short-plural = s ,
    long = Very High Temperature Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{htgr}{
    short = HTGR ,
    short-plural = s ,
    long = High Temperature Gas cooled Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{htr}{
    short = HTR ,
    short-plural = s ,
    long = High Temperature Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{mhr}{
    short = GT-MHR ,
    short-plural = s ,
    long = Gas Turbine-Modular Helium Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{pmr}{
    short = PMR ,
    short-plural = s ,
    long = Prismatic Modular Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{pbmr}{
    short = PBMR ,
    short-plural = s ,
    long = Pebble Bed Modular Reactor ,
    long-plural = s ,
    class = reactor ,
}

\DeclareAcronym{heu}{
    short = HEU ,
    short-plural =  ,
    long = High Enriched Uranium ,
    long-plural =  ,
    class = reac.term ,
}

\DeclareAcronym{leu}{
    short = LEU ,
    short-plural =  ,
    long = Low Enriched Uranium ,
    long-plural =  ,
    class = reac.term ,
}

\DeclareAcronym{pcs}{
    short = PCS ,
    short-plural = s ,
    long = Power Conversion System ,
    long-plural = s ,
    class = reac.term ,
}

\DeclareAcronym{ihx}{
    short = IHX ,
    short-plural = s ,
    long = Intermediate Heat Exchanger ,
    long-plural = s ,
    class = reac.term ,
}


\newenvironment{acronyms}
  {\labeling[~\dots]{myheadings}}
  {\endlabeling}

\acsetup{list-type=acronyms,only-used=false}

\begin{document}

\addchap*{List of Acronyms}
    \addcontentsline{toc}{section}{List of Acronyms}

    \printacronyms[include-classes=reactors,name=Reactor Types]
    \printacronyms[include-classes=reac.exist,name=Reactor Names]
    \printacronyms[include-classes=reac.term,name=Reactor Terms]


\end{document}

Solved

Turns out that putting an extra s for the class name (\printacronyms[include-classes=reactors,name=Reactor Types]) for reactor causes this error. The class was simply called reactor.

6

You can use KOMA-Script's labeling environment as underlying list environment. The syntax is

\begin{labeling}[<separator>]{<longest item>}
  \item[<item>] ...
  \item[<item>] ...
\end{labeling}

In order to use it you have to wrap it in an environment without arguments and tell acro to use it with the list-type option:

\newenvironment{acronyms}
  {\labeling[--]{thelongestword}}
  {\endlabeling}
\acsetup{list-type=acronyms}

A complete example:

\documentclass{scrreprt}
\usepackage{acro}

% class `abbrev': abbreviations:
\DeclareAcronym{ny}{
  short = NY ,
  long  = New York ,
  class = abbrev
}
\DeclareAcronym{la}{
  short = LA ,
  long  = Los Angeles ,
  class = abbrev
}
\DeclareAcronym{un}{
  short = UN ,
  long  = United Nations ,
  class = abbrev
}

% class `nomencl': nomenclature
\DeclareAcronym{angelsperarea}{
  short = \ensuremath{a} ,
  long  = The number of angels per unit area ,
  sort  = a ,
  class = nomencl
}
\DeclareAcronym{numofangels}{
  short = \ensuremath{N} ,
  long  = The number of angels per needle point ,
  sort  = N ,
  class = nomencl
}
\DeclareAcronym{areaofneedle}{
  short = \ensuremath{A} ,
  long  = The area of the needle point ,
  sort  = A ,
  class = nomencl
}

\newenvironment{acronyms}
  {\labeling[--]{thelongestword}}
  {\endlabeling}
\acsetup{list-type=acronyms}

\begin{document}

\ac{ny}, \ac{la} \ac{ny} and \ac{un} are abbreviations whereas
\ac{angelsperarea}, \ac{numofangels} and \ac{areaofneedle} are part of the
nomenclature

\printacronyms[exclude-classes=nomencl]

\printacronyms[include-classes=nomencl,name=Nomenclature]

\end{document}

enter image description here

  • Hello again, thanks for the help you offered, it seems that when I use the command \printacronyms[include-classes=reac.exist,name=Reactor Names] it only prints 4 acronyms on the list, however if I only \printacronyms it prints all of them, would you know why this could be? Thank you – Fiztban Feb 13 '14 at 12:38
  • Solved it was something infinitely silly but which gave a strange output result – Fiztban Feb 13 '14 at 13:20
  • @cgnider I have almost the same case, using a KOMA-script's class (scrbook in my case) with the acro package, I made the lists of acronyms and all is OK but how to add those lists at the toc? – Aradnix Oct 24 '14 at 17:51
  • @Aradnix with KOMA-Script you could for example set acro's option list-heading=addsec (you know KOMA-Script's command \addsec I guess?) – clemens Oct 24 '14 at 17:53

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.