Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full name never printed if first usage is within \caption #6

Open
kirchhof opened this issue Jan 2, 2018 · 1 comment
Open

Full name never printed if first usage is within \caption #6

kirchhof opened this issue Jan 2, 2018 · 1 comment

Comments

@kirchhof
Copy link

kirchhof commented Jan 2, 2018

If an acronym is first mentioned in a caption, then the full name of that acronym will never be printed. Neither in the caption nor in the text.

Minimal working example:

\documentclass[12pt]{article}

\usepackage{acronym}

\acrodef{FSK}{Frequency-Shift Keying}

\begin{document}

\begin{figure}[t]
\caption{Here, the acronym is mentioned in a caption before it appears in text \ac{FSK}.}
\end{figure}

\noindent
This is the first usage of the acronym in text \ac{FSK}.

\end{document}

The expected output for that example is:

Figure 1: Here, we mention the acronym in a caption before it appears in text FSK.
This is the first usage of the acronym in text Frequency-Shift Keying (FSK).

The actual output for that example:

Figure 1: Here, we mention the acronym in a caption before it appears in text FSK.
This is the first usage of the acronym in text FSK.

If the figure definition is moved below the text line, the acronym's full name is printed correctly.

@oetiker
Copy link
Owner

oetiker commented Jan 3, 2018

The acronym gets expanded inside the list of figures which is processed first ... even when you do not print it ... (\listoffigures) ... it is not immediately clear to me how this could be taken care of automatically.

But there are workarounds as suggested by Heiko Oberdiek:

Keep in mind that figures and tables are usually floating objects, where the final placement in the typeset document can be before or after the corresponding position in the source file. Therefore, I would not use
\ac inside captions.

Instead, \acs{...} can be used to force the short form to keep the caption titles short. Or `\acf*{...}' can be used to get the full form to always provide the explanation of the acronym. The star prevents that
the acronym is marked as used.

If you want to have a different behaviour for the list of figures, use the optional argument of \caption.

marsmee added a commit that referenced this issue Apr 9, 2020
adjusted test file to detect the bug, improved readability of \@iaci
macro
@marsmee marsmee mentioned this issue Apr 9, 2020
marsmee added a commit that referenced this issue Apr 9, 2020
adjusted test file to detect the bug, improved readability of \@iaci
macro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants