Skip to content

Linters

Jerome Lelong edited this page Dec 25, 2018 · 24 revisions

Linting

ChkTeX

The ChkTeX utility is a LaTeX semantic checker. Once installed, and the relevant setting enabled it is automatically run on any open TeX documents. It output is parsed by the extension and displayed in the Problems panel.

Auto load of .chktexrc configuration files is performed in the following order

  1. Manually configured -l setting in chktex.args
  2. The .chktexrc file (if exists) in the same folder as the main LaTeX file
  3. The .chktexrc file (if exists) at the project root folder.

Relevant Settings

Overview

Setting key Description Default Type
latex-workshop​.chktex​.args​.active Arguments to be passed to ChkTeX for current file ["-wall", "-n22", "-n30", "-e16", "-q"] array of strings
latex-workshop​.chktex​.args​.root Arguments to be passed to ChkTeX for entire project ["-wall", "-n22", "-n30", "-e16", "-q"] array of strings
latex-workshop​.chktex​.enabled Enable LaTeX linting with ChkTeX false boolean
latex-workshop​.chktex​.interval Time interval in ms that ChkTeX is run 300 integer
latex-workshop​.chktex​.path Location of ChkTeX executable "chktex" string

Details

latex-workshop.chktex.args.active

Linter arguments to check LaTeX syntax of the current file state in real time with ChkTeX.

Arguments must be in separate strings in the array. Additional arguments, i.e., -I0 -f%f:%l:%c:%d:%k:%n:%m\n will be appended when constructing the command. Current file contents will be piped to the command through stdin.

type default value
array of strings ["-wall", "-n22", "-n30", "-e16", "-q"]

latex-workshop.chktex.args.root

Linter arguments to check LaTeX syntax of the entire project from the root file with ChkTeX.

Arguments must be in separate strings in the array. Additional arguments, i.e., -f%f:%l:%c:%d:%k:%n:%m\n %DOC% will be appended when constructing the command.

type default value
array of strings ["-wall", "-n22", "-n30", "-e16", "-q"]

latex-workshop.chktex.enabled

Enable linting LaTeX with ChkTeX.

The active document will be linted when no document changes for a defined period of time.

The full project will be linted from the root on file save.

type default value
boolean false

latex-workshop.chktex.interval

Defines the time interval in milliseconds between invoking LaTeX linter on the active file.

type default value
integer 300

latex-workshop.chktex.path

Define the location of ChkTeX executive file.

This command will be joint with latex-workshop.chktex.args.* and required arguments to form a complete command of ChkTeX.

"latex-workshop.chktex.path": "chktex"

type default value
string "chktex"

Table of Contents

Clone this wiki locally