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

Spell checking inside acronyms #2058

Closed
joellidin opened this issue May 25, 2021 · 5 comments
Closed

Spell checking inside acronyms #2058

joellidin opened this issue May 25, 2021 · 5 comments

Comments

@joellidin
Copy link

I am using acronyms when I am writing in latex. Similar to #2055, I have noticed that text inside the acronym functions gets highlighted by the built-in spell checker. For example, if I have defined an acronym \newacronym{ML}{ML}{Machine Learning} and use any one of the \acrfull{ML}, \acrlong{ML} or \acrshort{ML} commands "ML" would be highlighted. If I instead would use the glossary (e.g., gls{ML}), it does not get highlighted, so I suppose it should not for the acronyms either.

@lervag
Copy link
Owner

lervag commented May 29, 2021

Thanks, this should be relatively simple to implement. But I would appreciate a more detailed example, i.e. a mimimal LaTeX sample that compiles. Please also refer to the proper documentation and package that defines the \acrfull and similar commands.

@joellidin
Copy link
Author

Of course. I should have been clearer. Here is a minimal example usage of the acronyms from the glossaries package (https://www.ctan.org/pkg/glossaries).

\documentclass[a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[acronyms]{glossaries}

\makenoidxglossaries
\newacronym{rl}{RL}{reinforcement learning}
\newacronym{ml}{ML}{machine learning}

\begin{document}
\Acrfull{rl} is a fun subfield of \acrlong{ml}. \acrshort{ml} is fun.
\printnoidxglossary[type=acronym]
\end{document}

In this example rl and ml gets highlighted both when defining the acronyms and when using the acronym commands in the document.

lervag added a commit that referenced this issue May 30, 2021
@lervag
Copy link
Owner

lervag commented May 30, 2021

There, I think that should do it. It's not perfect, so feel free to continue adding requirements or opening new issues. It is a great help if you add concrete examples, as I can directly add them to test files and this makes it much easier to develop.

@lervag lervag closed this as completed May 30, 2021
@joellidin
Copy link
Author

It works like a charm! Thank you very much, and thank you for an awesome plugin. I will definitively keep that in mind for future issues.

@lervag
Copy link
Owner

lervag commented May 31, 2021

Great, and thanks for the kind words! :)

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

No branches or pull requests

2 participants