Is your feature request related to a problem? Please describe.
LTEX seems to lose the relevant context when checking LaTeX acronyms created with the acro package.
For example:
\DeclareAcronym{LLM}{
short = LLM,
long = large language model
}
This is a \ac{LLM}.
This is an \ac{LLM}.
With acro, the first occurrence is expanded to the long form, so the first sentence effectively becomes:
This is a large language model.
Subsequent occurrences use the short form:
Both sentences are therefore correct.
However, LTEX reports that an in the second sentence should be changed to a. The same sentence without the \ac{...} command is accepted:
So the problem only occurs when the acronym is wrapped in \ac{...}.
Describe the solution you'd like
Ideally, LTEX should preserve enough information about \ac{...} so that LanguageTool can make the correct a/an decision.
For \ac{LLM}, that would mean distinguishing between:
- the first occurrence, which represents
large language model and therefore requires a
- later occurrences, which represent
LLM and therefore require an
Describe alternatives you've considered
A static replacement for all \ac{...} commands does not seem sufficient.
If \ac{LLM} is always treated like a word starting with a consonant sound, the later an LLM case is reported incorrectly.
If it is always treated like a word starting with a vowel sound, the first a large language model case would be reported incorrectly.
Ignoring a/an checks around \ac{...} entirely would avoid the false positives, but would also hide real grammar errors.
Additional context
Minimal example:
\documentclass{article}
\usepackage{acro}
\DeclareAcronym{LLM}{
short = LLM,
long = large language model
}
\begin{document}
This is a \ac{LLM}.
This is an \ac{LLM}.
\end{document}
Is your feature request related to a problem? Please describe.
LTEX seems to lose the relevant context when checking LaTeX acronyms created with the
acropackage.For example:
With
acro, the first occurrence is expanded to the long form, so the first sentence effectively becomes:Subsequent occurrences use the short form:
Both sentences are therefore correct.
However, LTEX reports that
anin the second sentence should be changed toa. The same sentence without the\ac{...}command is accepted:So the problem only occurs when the acronym is wrapped in
\ac{...}.Describe the solution you'd like
Ideally, LTEX should preserve enough information about
\ac{...}so that LanguageTool can make the correcta/andecision.For
\ac{LLM}, that would mean distinguishing between:large language modeland therefore requiresaLLMand therefore requireanDescribe alternatives you've considered
A static replacement for all
\ac{...}commands does not seem sufficient.If
\ac{LLM}is always treated like a word starting with a consonant sound, the lateran LLMcase is reported incorrectly.If it is always treated like a word starting with a vowel sound, the first
a large language modelcase would be reported incorrectly.Ignoring
a/anchecks around\ac{...}entirely would avoid the false positives, but would also hide real grammar errors.Additional context
Minimal example: