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

Latex: No spell checking within escaped $ #1083

Closed
jgoeders opened this issue May 11, 2022 · 2 comments · Fixed by #1085
Closed

Latex: No spell checking within escaped $ #1083

jgoeders opened this issue May 11, 2022 · 2 comments · Fixed by #1085

Comments

@jgoeders
Copy link

In the sample .tex code below, the first and third instance of dolllar is identified as incorrectly spelling. However, when you have any text between $ symbols it is not checked.

dolllar 

Spelling checks between escaped \$1,000 dolllar symbols do not work \$1,000. 

dolllar 

Normally between $ symbols is math mode and it would be correct to not spell check; however, in this case the symbols are escaped and I am actually trying to use the $ (dollar) symbol in my document.

Currently nearly my entire large .tex document is not spell checked because I have a $ symbol near the beginning and near the end.

@Jason3S Jason3S transferred this issue from streetsidesoftware/vscode-spell-checker May 14, 2022
@Jason3S
Copy link
Collaborator

Jason3S commented May 14, 2022

@jgoeders,

This is really an issue with how the exclusions are defined in the LaTeX dictionary settings.

Jason3S added a commit that referenced this issue May 14, 2022
@Jason3S
Copy link
Collaborator

Jason3S commented May 14, 2022

@jgoeders,

It should be fixed with the next release.

image

It might be a few days before this is fixed in the VS Code extension. In the mean time, you can redefine the pattern locally:

VS Code Settings

image

"cSpell.languageSettings": [
    {
        "languageId": "latex",
        "patterns": [
            {
                "name": "LaTexMath",
                "pattern": "/(?<!\\\\)[$][^$]*[$]/g",
                "description": "Match against LaTex Math Macros"
            }
        ]
    }
]

cspell.json

You could also add the following cspell.json file to your project.

{
"languageSettings": [
    {
        "languageId": "latex",
        "patterns": [
            {
                "name": "LaTexMath",
                "pattern": "/(?<!\\\\)[$][^$]*[$]/g",
                "description": "Match against LaTex Math Macros"
            }
        ]
    }
]
}

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