Grammar & Spell Checking Blog Posts with LTeX

Friction Log

  1. Install ltex-ls

    brew install ltex-ls
    
  2. Get path to ltex-ls

    readlink -f $(brew --prefix ltex-ls)
    # /opt/homebrew/Cellar/ltex-ls/15.2.0
    
  3. Install LTeX - LanguageTool grammar/spell checking VS Code Extension

  4. Update ltex.ltex-ls.path in VS Code’s settings

    LTeX settings

  5. Reset & Restart LTeX Extension

  6. Test it out!

    I used the following text:

    This is an mistake.
    

    LTeX hint

    It can even fix it!

    LTeX fix

Results

LTeX errors

I’m glad I spent the hour installing & correcting things! This would’ve been a lot less work if I followed a few rules:

  1. Always wrap shell commands & package names in backticks. NPM is a word, but npm is a command.

  2. Always wrap shell output in code fences:

    Any invalid prose will throw false-positives here.

    While you can put anything here
    
    ERROR: MakingUpStuff.js#34:10
    
  3. Avoid clever words like Vue-ify, templatize, etc.

I’d love to set up a Husky pre-commit hook, but ltex-cli doesn’t seem to correctly process .mdx files outside of VS Code 🤔