cgnieder / acro

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

Incompatible with Abstract in IEEE CompSoc Journal Style on macOS #233

Closed sbondorf closed 2 years ago

sbondorf commented 2 years ago

The style used for IEEE Computer Society journal articles (and potentially others) \documentclass[journal,compsoc]{IEEEtran} demands to put the abstract inside \IEEEtitleabstractindextext{ ... }. On macOS (v12 with MacTeX 2021), acronyms in the abstract are all compiled to their long versions. This problem couldn't be reproduced on Linux.

cgnieder commented 2 years ago

I'm not sure I can help. This MWE

\documentclass[journal,compsoc]{IEEEtran}

\usepackage{acro}

\DeclareAcronym{MA}{
  short =MA,
  long = my acronym
}

\title{Title}
\author{author}

\begin{document}

\IEEEtitleabstractindextext{text \ac{MA} text}

\maketitle

text \ac{MA} text
text \ac{MA} text

\end{document}

gives

image

which seems to be alright actually (using an up to date TL21).

sbondorf commented 2 years ago

That part works, indeed. The problem appears within the abstract. Just change the example to use the same text as in the body, then all acronyms in the abstract are compiled to their long versions.

\IEEEtitleabstractindextext{text \ac{MA} text text \ac{MA} text}

Gives you on macOS:

Screen Shot 2022-01-15 at 12 10 42
cgnieder commented 2 years ago

In the newest versions of acro the package patches \maketitle to not mark acronyms as used within \maketitle. Sadly I seem to have forgotten to document this properly…

It looks like you don't want this behaviour. It can be disabled but then due to the nature of \maketitle the acronym will not appear as first appearance anywhere. So within \maketitle \acf might be needed and a reset after \maketitle probably as well:

\documentclass[journal,compsoc]{IEEEtran}

\usepackage{acro}

\DeclareAcronym{MA}{
  short =MA,
  long = my acronym
}

\title{Title}
\author{author}

\acsetup{patch/maketitle=false}

\begin{document}

\IEEEtitleabstractindextext{text \acf{MA} text \ac{MA} text}
\maketitle
\acresetall

text \ac{MA} text
text \ac{MA} text

\end{document}