cgnieder / acro

acronyms for LaTeX
LaTeX Project Public License v1.3c
41 stars 9 forks source link

\scshape only has an effect in \ac{…}, not in \printacronyms #251

Open pzehner opened 2 years ago

pzehner commented 2 years ago

Hello, thank you for this convenient package!

This is a reopening of issue as #135. Using \scshape on short-format shows the short version of the acronym in small caps when using \ac, but the text is in lower case when using \printacronyms:

\documentclass{article}
\usepackage{fontspec}
\usepackage{acro}
\usepackage{enumitem}
\DeclareAcronym{test}{short=test,long=a test,short-format=\scshape}

\begin{document}

  Acronym: \ac{test}

  \printacronyms

\end{document}

It sounds like the fix of #135 does not work any more.

dbranford commented 1 year ago

Acro is working correctly here, you should be getting something like

LaTeX Font Warning: Font shape `TU/lmr/bx/sc' undefined
(Font)              using `TU/lmr/bx/n' instead on input line 18.

indicating bold small caps was requested, but tex is falling back on just bold (https://tex.stackexchange.com/q/27411/, https://texfaq.org/FAQ-bold-extras).

\DeclareAcronym{test}{short=test,long=a test,short-format=\normalfont\scshape} probably gives what you want, however it changes some niche cases like \textit{\acs{test}}. Alternatively you can redefine the list template to use something like \item[\textnormal{\acrowrite{short}}\acroifT{alt}{/\acrowrite{alt}}].

I don't think there's anything to fix directly, but https://github.com/cgnieder/acro/issues/258 could give a better interface with the ability to set \normalfont in the list only.