Skip to content

Correct a/an suggestions for \ac{} acronyms #228

Description

@shoneg

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:

This is an LLM.

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:

This is an LLM.

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}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    1-feature-request ✨Issue type: Request for a desirable, nice-to-have feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions