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

how to use multiple acronym environments? #47

Open
AndrewAnnex opened this issue Dec 26, 2021 · 3 comments
Open

how to use multiple acronym environments? #47

AndrewAnnex opened this issue Dec 26, 2021 · 3 comments
Labels

Comments

@AndrewAnnex
Copy link

I am putting together my dissertation, which has three chapters originally prepared as individual latex projects for submission to a journal. Each chapter uses acronym and ends with an acronym environment (because of the journal's latex template). In my dissertation I call \acresetall before and after each \include command that is used to import the text for the three chapters.

However, each printed acronym environment includes all the acronyms used regardless of the section/chapter it is included in. For example an acronym used in chapter 1 is not referenced in chapter 2, but is printed in chapter 2's acronym environment output.

There is some overlap in the acronym environments, as I copied my first acronym list into my 2nd paper and so on, so there are acronyms defined in the later chapter's acronym list even though the particular acronym is not used in the chapter. I suppose I could just remove the irrelevant acronyms from each chapter list, but I haven't tried that yet to know if it would work.

Is there something else I can do to ensure each environment only prints the acronyms used within the relevant tex file, that doesn't require drastic changes to how I structure my project?

I think I can accomplish this by switching to use the glossaries package potentially, but I would have to redefine the calls to \ac and \acp and it may take a while for me to fully work that out.

rough example, result of which is that chapter2's acronym list will include the "PDF" acronym

chapter1.tex:

\chapter{1}
\ac{PDF}

\begin{acronym}
\acro{PDF}[PDF]{...}
\end{acronym}

chapter2.tex:

\chapter{2}
\ac{CDF}

\begin{acronym}
\acro{PDF}[PDF]{...}
\acro{CDF}[CDF]{...}
\end{acronym}

main.tex:

\documentclass[12pt]{report}
\usepackage[printonlyused]{acronym}

\begin{document}
\acresetall
\include{chapter1.tex}
\acresetall

\acresetall
\include{chapter2.tex}
\acresetall
\end{document}
@oetiker
Copy link
Owner

oetiker commented Dec 28, 2021

Hi @AndrewAnnex
that indicates that there is an error in acresetall :) PRs welcome!

@oetiker oetiker added the bug label Dec 28, 2021
@AndrewAnnex
Copy link
Author

unfortunately my dissertation is due very soon, and too soon for me to learn enough about latex package development and testing, but I did find out that removing unused acronyms in each environment prevents them from being listed incorrectly. I do use some acronyms across all three chapters so I still need to go through and verify that acronyms are expanded correctly for each first usage in each chapter, but I believe any issues there can be resolved using the appropriate command to explicitly state the acronym

@oetiker
Copy link
Owner

oetiker commented Dec 30, 2021

great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants