TransWikia.com

Output Acronyms Fullname in Text Italic but in Acronyms Glossary Normal

TeX - LaTeX Asked by muka90 on January 26, 2021

I am using

begin{acronym}[PHEV]
  acro{PHEV}{emph{Plug-in Hybrid Electric Vehicle}}
  ... 
end{acronym}

in an extra tex file for my declarations of Acronyms. I use emph or textit to have the full name written so within my main text (ac{PHEV}).

In my main tex file I include them in the frontmatter of my document via

include{myacronyms.tex}

as a acronyms glossary. But here the acronyms full name also gets printed in italic. I want to prevent this.

Is there a workaround? Thank you!

One Answer

As far as I know the acronym package does not provide a user interface for changing the appearance of the long form.

However, introducing it only requires a small change in the internal macro AC@acl:

makeatletter
renewcommand*AC@acl[1]{%
  textit{expandafterAC@getcsname fn@#1endcsname@secondoftwo{#1}}%
}
makeatother

A better way IMHO is to define a user interface analoguous to acsfont for the short form.

The code below does this by introducing a new macro aclfont which can be changed how you need it:

documentclass{article}
usepackage{acronym}

makeatletter
renewcommand*AC@acl[1]{%
  aclfont{expandafterAC@getcsname fn@#1endcsname@secondoftwo{#1}}%
}
makeatother
newcommand*aclfont[1]{textit{#1}}

begin{document}

ac{PHEV} par
short: ac{PHEV} par
long: acl{PHEV}

begin{acronym}[PHEV]
  acro{PHEV}{Plug-in Hybrid Electric Vehicle}
end{acronym}

end{document}

enter image description here

Answered by cgnieder on January 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP