valentjn / ltex-ls

LTeX Language Server: LSP language server for LanguageTool :mag::heavy_check_mark: with support for LaTeX :mortar_board:, Markdown :pencil:, and others
https://valentjn.github.io/ltex
Mozilla Public License 2.0
717 stars 33 forks source link

Add support for apacite commands #267

Open briochemc opened 11 months ago

briochemc commented 11 months ago

Is your feature request related to a problem? Please describe.

I am using a LaTeX template class from the American geophysical union (AGU) and they use "apacite" which (quoting from their template) "uses < > for prenotes and [ ] for postnotes".

For example, to print "(see, e.g., XXX for details)", I write the follow LaTeX:

\cite<see, e.g.,>[for details]{XXX}

Because these commands are not recognised, ltex reports a false positive with almost each citation command.

Adding the commands below would benefit all users of apacite.

Describe the solution you'd like

Add the following commands

Describe alternatives you've considered

I tried adding the following to my settings, but it does not seem to work:

    "ltex.latex.commands": {
        "\\cite<>[]{}": "dummy",
        "\\cite<>{}": "dummy",
        "\\cite{}": "dummy",
        "\\citeA{}": "dummy"
    },

Not why it does not work... Maybe the < and > are not parsed correctly? Either way my current workaround is just to close my eyes and ignore the false positives 😅