Repository navigation
Lints
satex lint checks the input file with every rule below. --all also checks the packages and classes it loads. --rules lists the codes, --explain CODE prints one rule's explanation. lint_off and lints.⟨code⟩ in satex.yaml turn rules off and tune them. The same findings come from satex query diagnostics (queries) and the language server. See Chktex-Coverage for the chktex warning each rule follows, and Primitive-coverage and Domains for how satex gets the facts a rule reads.
Every rule has a stable number: its category's letter and a count, such as C012. The letters are C correctness, X security, S style, P performance and A precision (of the analysis). Output shows it before the code: the text and GitHub formats, SARIF's rule id and the editor's diagnostic code. --explain, lint_off and the suppression comments take the number in place of the code. A new rule gets the next free number of its category in src/data/lint-numbers.txt. A removed rule keeps its line there, so a number never changes meaning. A rule that moves to another category keeps its number, so suppressions and links that name it stay valid.
Every rule, with a link to its explanation below. The shape gives the severity: ◆ error, ▲ warning, ● info. The badge gives the category. The engine column names the engines a rule is about, when not all of them. The origin names the chktex warnings a rule follows. On the site the table comes in pages, and the columns icon in its header hides columns or wraps long summaries. Hovering a rule's name anywhere on the site shows its card.
| no. | code | kind | engine | quick fix | summary | since | origin |
|---|---|---|---|---|---|---|---|
| C001 | already-defined |
◆ correctness | — | S U | command already defined | 0.1.0 | — |
| C043 | assertion-refuted |
◆ correctness | — | — | assertion fails | 0.2.0 | — |
| C002 | bibtex-command-under-biblatex |
◆ correctness | — | U | BibTeX command under biblatex | 0.2.0 | — |
| C003 | build-bibliography-disabled |
◆ correctness | — | — | build never runs BibTeX or biber | 0.1.0 | — |
| C004 | build-command-placeholders |
◆ correctness | — | — | engine command lacks %S or %O | 0.1.0 | — |
| C005 | build-engine-mismatch |
◆ correctness | — | — | build uses the wrong engine or output | 0.1.0 | — |
| C006 | build-shell-escape-missing |
◆ correctness | — | — | build forbids needed shell escape | 0.1.0 | — |
| C007 | caused-library-error |
◆ correctness | — | — | package error caused by the document | 0.2.0 | — |
| C025 | environment-mismatch |
◆ correctness | — | U | wrong environment closed | 0.1.0 | chktex 9, 10, 15 |
| C046 | invalid-directive |
◆ correctness | — | — | unreadable satex directive | 0.2.0 | — |
| C066 | malformed-bibliography-entry |
◆ correctness | — | S | entry breaks the database's grammar | 0.2.6 | — |
| C008 | math-still-open |
◆ correctness | — | — | math mode left open | 0.2.0 | chktex 16 |
| C055 | metadata-after-class |
◆ correctness | — | U | DocumentMetadata after documentclass | 0.2.5 | — |
| C047 | missing-end |
◆ correctness | — | S | document has no end | 0.2.0 | — |
| C009 | missing-graphic |
◆ correctness | — | — | image missing for this output | 0.1.0 | — |
| C010 | new-redefines |
◆ correctness | — | — | declaration redefines a command | 0.2.0 | — |
| C011 | not-defined |
◆ correctness | — | S | renewing an undefined command | 0.1.0 | — |
| C012 | option-clash |
◆ correctness | — | U | package loaded with clashing options | 0.1.0 | — |
| C013 | raised-error |
◆ correctness | — | S U | TeX error in the document | 0.1.0 | — |
| C014 | undefined-color |
◆ correctness | — | — | color used before it is defined | 0.2.0 | — |
| C015 | undefined-control-sequence |
◆ correctness | — | U | undefined command | 0.1.0 | — |
| C016 | undefined-environment |
◆ correctness | — | U | undefined environment | 0.1.0 | — |
| C017 | undefined-glossary-entry |
◆ correctness | — | — | glossary entry never declared | 0.1.0 | — |
| C018 | unguarded-recursion |
◆ correctness | — | — | recursion that never stops | 0.1.0 | — |
| C052 | bibliography-entry-missing-field |
▲ correctness | — | — | cited entry lacks a required field | 0.2.0 | — |
| C071 | broken-bibliography-crossref |
▲ correctness | — | — | crossref to no entry, or to an earlier one | 0.2.6 | — |
| C019 | build-missing-custom-dependency |
▲ correctness | — | — | glossary files have no latexmk rule | 0.1.0 | — |
| C020 | catcode-escapes-group |
▲ correctness | — | — | category code change outlives its group | 0.1.0 | — |
| C069 | conflicting-bibliography-fields |
▲ correctness | — | S U | fields that exclude each other | 0.2.6 | — |
| C021 | conflicting-color-definition |
▲ correctness | — | — | color name defined twice | 0.2.0 | — |
| C022 | delimiter-not-followed |
▲ correctness | — | U | \left or \right before a brace | 0.2.0 | chktex 43 |
| C023 | duplicate-bibliography-entry |
▲ correctness | — | — | key declared twice | 0.1.0 | — |
| C067 | duplicate-bibliography-field |
▲ correctness | — | S | field given twice in one entry | 0.2.6 | — |
| C050 | duplicate-bibliography-load |
▲ correctness | — | S | database loaded twice | 0.2.0 | — |
| C051 | duplicate-bibliography-work |
▲ correctness | — | U | one work under two keys | 0.2.0 | — |
| C024 | duplicate-label |
▲ correctness | — | U | label defined twice | 0.1.0 | — |
| C026 | expl-syntax-left-on |
▲ correctness | — | — | ExplSyntaxOn never turned off | 0.1.0 | — |
| C027 | expl3-constant-set |
▲ correctness | — | — | expl3 constant set again | 0.2.0 | — |
| C028 | expl3-signature-mismatch |
▲ correctness | — | — | expl3 argument signature mismatch | 0.1.0 | — |
| C057 | graphic-without-alt |
▲ correctness | — | — | graphic without alternative text | 0.2.5 | — |
| C029 | ignored-verbatim-tail |
▲ correctness | — | U | text lost after verbatim end | 0.2.0 | chktex 31 |
| C068 | invalid-bibliography-field-value |
▲ correctness | — | S | value is not what the field takes | 0.2.6 | — |
| C030 | math-script-braces |
▲ correctness | — | S | script needs braces | 0.2.0 | chktex 3, 25 |
| C065 | missing-bibliography |
▲ correctness | — | U | citations without a bibliography | 0.2.5 | — |
| C031 | missing-dependency |
▲ correctness | — | S | package missing from the dependency file | 0.1.0 | — |
| C063 | misspelled-magic-comment |
▲ correctness | — | U | misspelled magic comment | 0.2.5 | — |
| C064 | package-call-error |
▲ correctness | — | — | a package command fails on some call | 0.2.5 | — |
| C061 | package-load-order |
▲ correctness | — | U | package overrides an earlier one | 0.2.5 | — |
| C058 | pdfua-without-title |
▲ correctness | — | S | PDF/UA without a title | 0.2.5 | — |
| C054 | reference-name-mismatch |
▲ correctness | — | U | name does not match the label | 0.2.4 | — |
| C056 | tagging-incompatible-package |
▲ correctness | — | — | package incompatible with tagging | 0.2.5 | — |
| C060 | tagging-unsupported-engine |
▲ correctness | xetex, tex | — | engine does not support tagging | 0.2.5 | — |
| C059 | tagging-without-language |
▲ correctness | — | S | tagging without a language | 0.2.5 | — |
| C032 | unbalanced-brackets |
▲ correctness | — | — | unbalanced brackets | 0.2.0 | chktex 17 |
| C033 | unbalanced-color-stack |
▲ correctness | pdftex, luatex | — | unbalanced color stack | 0.2.0 | — |
| C034 | unbalanced-pdf-content |
▲ correctness | pdftex, luatex, xetex | — | unclosed PDF literal | 0.1.0 | — |
| C053 | undefined-bibliography-string |
▲ correctness | — | — | undefined @string constant | 0.2.0 | — |
| C035 | undefined-citation |
▲ correctness | — | U | citation key not in the bibliography | 0.1.0 | — |
| C048 | undefined-cref-format |
▲ correctness | — | U | cleveref has no name for this label | 0.2.0 | — |
| C036 | undefined-optional-content |
▲ correctness | — | — | unknown optional content group | 0.1.0 | — |
| C037 | undefined-reference |
▲ correctness | — | U | reference to an undefined label | 0.1.0 | — |
| C038 | uninstalled-package |
▲ correctness | — | — | package not installed | 0.2.0 | — |
| C070 | unknown-bibliography-entry-type |
▲ correctness | — | — | entry type the style does not define | 0.2.6 | — |
| C049 | unknown-code-language |
▲ correctness | — | — | unknown listings language | 0.2.0 | — |
| C062 | unknown-package-name |
▲ correctness | — | U | package name misspelled | 0.2.5 | — |
| C039 | unresolved-file |
▲ correctness | — | U | file not installed | 0.1.0 | chktex 27 |
| C045 | assumption-made |
● correctness | — | — | document assumes a condition | 0.2.0 | — |
| C040 | expected-load |
● correctness | — | — | file read before a package it expects | 0.2.0 | — |
| C041 | math-mode-mismatch |
● correctness | — | — | math delimiter in the wrong mode | 0.2.0 | chktex 49 |
| C042 | unintended-escape |
● correctness | — | U | command followed by escaped punctuation | 0.2.0 | chktex 21 |
| C044 | assertion-proved |
● correctness | — | — | assertion always holds | 0.2.0 | — |
| X001 | build-shell-escape-unneeded |
▲ security | — | — | build allows unused shell escape | 0.1.0 | — |
| X002 | shell-escape |
▲ security | — | — | document runs a program | 0.1.0 | — |
| S001 | accent-on-dotted-letter |
▲ style | — | U | accent on a dotted i or j | 0.2.0 | chktex 7 |
| S002 | command-terminated-space |
▲ style | — | S | space eaten after a command | 0.2.0 | chktex 1 |
| S003 | dimension-times |
▲ style | — | U | x instead of a times sign | 0.2.0 | chktex 29 |
| S004 | double-space |
▲ style | — | S U | double space | 0.2.0 | chktex 30, 39 |
| S060 | doubled-punctuation |
▲ style | — | U | doubled punctuation | 0.2.4 | — |
| S005 | ellipsis-dots |
▲ style | — | U | three periods, not an ellipsis | 0.2.0 | chktex 11 |
| S054 | et-al |
▲ style | — | U | et al. spelled by hand | 0.2.0 | — |
| S006 | expl3-scope |
▲ style | — | — | expl3 scope prefix mismatch | 0.2.0 | — |
| S007 | expl3-type |
▲ style | — | — | expl3 type suffix mismatch | 0.2.0 | — |
| S008 | group-local-definition |
▲ style | — | — | definition lost when its group closes | 0.1.0 | — |
| S067 | low-contrast-color |
▲ style | — | U | text color with too little contrast | 0.2.5 | — |
| S009 | math-operator-name |
▲ style | — | U | operator name in math italic | 0.2.0 | chktex 35 |
| S010 | missing-italic-correction |
▲ style | — | U | missing italic correction | 0.2.0 | chktex 6 |
| S011 | missing-nonbreaking-space |
▲ style | — | U | missing tie before a reference | 0.2.0 | chktex 2 |
| S063 | overfull-box |
▲ style | — | — | hbox too wide for its width | 0.2.5 | — |
| S062 | overfull-line |
▲ style | — | — | line wider than the text block | 0.2.5 | — |
| S012 | parenthesis-spacing |
▲ style | — | U | parenthesis takes the wrong space | 0.2.0 | chktex 36, 37 |
| S013 | quote-direction |
▲ style | — | U | quotation mark points the wrong way | 0.2.0 | chktex 32, 33, 34 |
| S061 | sentence-capital |
▲ style | — | U | sentence starts lowercase | 0.2.4 | — |
| S014 | sentence-spacing |
▲ style | — | U | wrong space after a period | 0.2.0 | chktex 12, 13 |
| S015 | space-before-command |
▲ style | — | U | line may break before a mark | 0.2.0 | chktex 24, 42 |
| S016 | space-before-punctuation |
▲ style | — | S | space before punctuation | 0.2.0 | chktex 26 |
| S017 | stray-italic-correction |
▲ style | — | S U | stray italic correction | 0.2.0 | chktex 5, 28 |
| S018 | unknown-suppress-code |
▲ style | — | — | suppression names no rule | 0.1.0 | — |
| S019 | user-pattern |
▲ style | — | — | matches a project pattern | 0.2.0 | chktex 20, 44 |
| S064 | wider-than-line |
▲ style | — | U | box wider than its lines | 0.2.5 | — |
| S020 | wrong-dash |
▲ style | — | U | wrong dash length | 0.2.0 | chktex 8 |
| S021 | wrong-quote-character |
▲ style | — | U | wrong character used as a quote | 0.2.0 | chktex 18, 19 |
| S022 | zero-italic-correction |
▲ style | — | S | useless italic correction | 0.2.0 | chktex 4 |
| S059 | bare-reference |
● style | — | U | reference without a name | 0.2.4 | — |
| S023 | build-bibliography-unneeded |
● style | — | — | build runs BibTeX without a bibliography | 0.1.0 | — |
| S024 | build-engine-options |
● style | — | — | engine command lacks file:line or SyncTeX | 0.1.0 | — |
| S025 | build-unused-custom-dependency |
● style | — | — | unused latexmk dependency | 0.1.0 | — |
| S053 | clones |
● style | — | U | repeated block of source | 0.2.0 | — |
| S026 | comment-marker |
● style | — | — | TODO marker in a comment | 0.2.0 | chktex 22 |
| S027 | computer-modern-in-t1 |
● style | pdftex | U | T1 text relies on cm-super | 0.1.0 | — |
| S028 | csquotes-available |
● style | — | U | hand-set quotes, csquotes not loaded | 0.2.0 | chktex 18 |
| S029 | dead-definition |
● style | — | S U | definition replaced before use | 0.1.0 | — |
| S030 | duplicate-color-value |
● style | — | — | two names for one color | 0.2.0 | — |
| S031 | duplicate-package |
● style | — | S | package loaded twice | 0.1.0 | — |
| S032 | hand-set-quantity |
● style | — | U | hand-set number and unit | 0.2.0 | — |
| S052 | hand-written-author |
● style | — | U | author name typed before a citation | 0.2.0 | — |
| S051 | hand-written-reference |
● style | — | U | number typed after a reference name | 0.2.0 | — |
| S069 | ignored-bibliography-field |
● style | — | S | field the style never reads of this type | 0.2.6 | — |
| S033 | inconsistent-precision |
● style | — | — | different decimals in a column | 0.2.0 | — |
| S068 | indistinct-colors |
● style | — | U | colors alike with color blindness | 0.2.5 | — |
| S057 | itemize-described |
● style | — | U | labelled items in an itemize | 0.2.1 | — |
| S056 | itemize-numbered |
● style | — | S U | numbered items in an itemize | 0.2.1 | — |
| S034 | math-punctuation |
● style | — | — | punctuation on the wrong side of a formula | 0.2.0 | chktex 40 |
| S035 | math-shift-dollars |
● style | — | S | $$ instead of [ | 0.2.0 | chktex 45, 46 |
| S036 | microtype-available |
● style | pdftex, luatex | U | microtype not loaded | 0.1.0 | — |
| S037 | numbers-not-aligned |
● style | — | — | numbers not aligned | 0.2.0 | — |
| S038 | ot1-font-encoding |
● style | pdftex | U | accents built with \accent in OT1 | 0.1.0 | — |
| S058 | package-successor |
● style | — | U | package has a successor | 0.2.1 | — |
| S039 | prefer-cleveref |
● style | — | U | hand-written name before a reference | 0.2.0 | — |
| S040 | primitive-tex-command |
● style | — | U | plain TeX primitive in LaTeX | 0.1.0 | chktex 41 |
| S041 | quote-ligature |
● style | — | U | quotes run together | 0.2.0 | chktex 23 |
| S042 | quote-punctuation |
● style | — | U | punctuation inside the quote | 0.2.0 | chktex 38 |
| S066 | redundant-package-load |
● style | — | S | package loaded already | 0.2.5 | — |
| S070 | spelled-out-macro |
● style | — | U | word typed out that a command of the document sets | 0.2.6 | — |
| S043 | stray-space |
● style | — | S | space from a line end in a macro | 0.1.0 | — |
| S044 | table-rules |
● style | — | — | vertical rules or hline in a table | 0.2.0 | — |
| S065 | tagged-math-without-mathml |
● style | — | — | formulas without MathML | 0.2.5 | — |
| S055 | uncited-bibliography-entry |
● style | — | U | database entry never cited | 0.2.0 | — |
| S045 | unit-in-cells |
● style | — | — | unit repeated in every cell | 0.2.0 | — |
| S046 | unreferenced-numbered-display |
● style | — | U | numbered display never referenced | 0.2.0 | — |
| S047 | unused-bibitem |
● style | — | — | bibitem never cited | 0.1.0 | — |
| S048 | unused-color |
● style | — | — | color never used | 0.2.0 | — |
| S049 | unused-definition |
● style | — | U | macro never used | 0.1.0 | — |
| S050 | unused-label |
● style | — | U | label never referenced | 0.1.0 | — |
| P001 | package-after-preamble |
◆ performance | — | U | package loaded after the preamble | 0.1.0 | — |
| P002 | includeonly-available |
● performance | — | U | parts built whole | 0.2.0 | — |
| P003 | preamble-cost |
● performance | — | U | slow preamble | 0.1.0 | — |
| P004 | recursive-macro |
● performance | — | — | recursive macro | 0.1.0 | — |
| P005 | unused-dependency |
● performance | — | U | unused entry in the dependency file | 0.1.0 | — |
| P006 | unused-package |
● performance | — | U | unused package | 0.1.0 | — |
| A003 | unread-document |
◆ precision | — | — | document not fully read | 0.2.1 | — |
| A001 | analysis-imprecision |
● precision | — | — | analysis had to widen | 0.1.0 | — |
| A002 | assertion-unknown |
● precision | — | — | assertion not decided | 0.2.0 | — |
An error is in every run of the document. Where the run was not certain at a finding's place, a rule's error is shown weaker and says why: a warning on a path the run could not decide or after an assumption, a note after an analysis gap. When a finding is certain has the rule.
Each rule declares the facts it needs. Most need the whole run. A few need only the files' text, or the text and the standard meaning of a few names: which files \input, \include and \subfile read, and which environments, such as verbatim, take their content as plain text. The keys tier also reads what the text's commands name, by their standard meaning: \label defines a label, \ref and \cref refer to one, \cite cites a key of the databases \bibliography and \addbibresource name, \usepackage loads a package, and \includegraphics includes a file that graphics finds with one of its extensions. A later pass can still change these findings, so the editor does not keep them between passes, as it keeps text and names ones. These rules run first, on a rough copy of the document, before the run starts. lints.early in satex.yaml lists the names, and the rough copy reports this as the assumption early-standard-names.
| needs | rules |
|---|---|
| text |
build-command-placeholders, misspelled-magic-comment, build-engine-options
|
| names |
user-pattern, clones, comment-marker
|
| keys |
missing-graphic, unresolved-file, duplicate-package
|
An early finding is provisional. satex lint prints it on stderr at once, marked early. The editor shows it before the run ends, on satex/settled with data.provisional. A file opened for the first time also gets the early set as its diagnostics, each marked provisional, so any client shows them. The run's findings then replace the early ones. A finding the run makes too is confirmed and keeps its place and message. One the run does not make is retracted: satex lint names it on stderr, and the editor drops it. A % TODO in a file that only a skipped \iffalse branch inputs is such a case. lints.early.enabled: false turns early findings off.
An engine error can arise inside a package while the document's own call caused it. satex lint then shows it at that call, as caused-library-error. The message names the package line, e.g. error in expl3-code.tex:24703: Argument has an extra }, caused here. The call is the innermost place in the user's own files on the input stack. These are the main file, the files it reads, and other files below its directory. One row stands for each call line and error code, with a count when it repeats. An error on a path satex approximated may not be TeX's. It is a precision note, which the text output folds into a count and an editor does not show. An exact error after such a one may be its echo, so it is a warning that names the earlier one. A finding that something is absent from the whole document, such as an undefined reference or an unused label, is a precision note too when the run left a project file unread. query diagnostics gives the call as origin. A runaway over an argument the document itself leaves open is the document's error. It is a raised-error at the call, e.g. File ended while scanning use of \pgfkeys@@set: the argument of \pgfkeys opened here never closes, the file ends inside it.
A comment in the document silences findings. Without codes it silences every rule, with codes (comma-separated) only those. lint_off in satex.yaml turns a rule off everywhere.
-
% satex-disable-next-line CODE,…silences the next line. -
% satex-disable-line CODE,…at the end of a line silences that line. -
% satex-disable CODE,……% satex-enable CODE,…silences a region. -
% satex-disable-file CODE,…silences the whole file.
They apply to every output format and to --fix. An unknown code is reported as unknown-suppress-code.
satex lint --style lists the rules the project breaks so often that they may be its style, as an editor asks about them (lints.style-prompt in satex.yaml, see the style prompt).
A comment can state a property for satex to check. TeX skips the comment. satex runs it where it reads it, on every path.
%\satex@assert{\thepage < 5}
%\satex@assume{\value{section} <= 3 and \ifdefined\mymacro}
%\satex@configure{limits.site_forks=8, opaque_conditionals=[ifdraft]}-
\satex@assert{⟨condition⟩}: Checks a condition on every path that reaches it. -
\satex@assume{⟨condition⟩}: Drops the paths where a condition fails. -
\satex@configure{⟨key⟩=⟨value⟩, …}: Changes settings ofsatex.yamluntil the group ends. -
\satex@scratch{begin ⟨file⟩:⟨from⟩-⟨to⟩} or {end}: Marks the lines a scratch document merges back. The run reads past it. -
⟨condition⟩is ⟨test⟩s joined byorandand,andbinding tighter, each maybe afternot. -
⟨test⟩is ⟨operand⟩ ⟨relation⟩ ⟨operand⟩, or a TeX conditional such as\ifdefined\x. -
⟨operand⟩is a TeX number (\value{page},\c@page,\numexpr…), a dimension when one side has a unit (\wd0 < 3cm),\the⟨counter⟩the counter's value (\thepage). -
⟨relation⟩is one of<=><=>=!===. -
⟨key⟩is a setting ofsatex.yaml, dotted or written with/. -
⟨value⟩is what the setting takes, as insatex.yaml. -
\satex@assert{cond}checkscond. It isassertion-provedwhen it holds on every path that reads it. It isassertion-refuted, an error, when it fails on a path that approximated nothing. The message names what the operands are there. Otherwise it isassertion-unknown, with the reason: a value the run does not know, a path that approximated, or no path that reads it. -
\satex@assume{cond}drops the paths wherecondfails. On the others it narrows the registers a conjunction of comparisons reads, as an\ifnumarm does. It is listed asassumption-made. -
\satex@configure{key=value, …}changes settings ofsatex.yamluntil the current TeX group ends. Keys are dotted, or written with/. A setting the run reads only at its start keeps its value.
\thepage < 5 compares the page number whether \pagenumbering prints it in arabic or roman numerals. Only the document's own files are read for directives. A package's comments and text a conditional skips are not. A directive that cannot be read is invalid-directive.
A finding's fix says what to do. Where that is mechanical it carries the edits, e.g. removing a \usepackage line or one name in \usepackage{a,b,c}, a \label{…}, or turning \newcommand into \renewcommand. The text output marks them [fix] or [unsafe fix]:
-
safe fixes keep the document's meaning: a duplicate
\usepackage, a definition replaced before it is read,\renewcommandof an undefined name. -
unsafe fixes may change what the document means, so check them before you keep them: removing a package that may have side effects, an unused label,
\newcommandturned into\renewcommand.
A possible finding (one only some runs have) offers its fix as unsafe: it is right only where the finding holds.
--fix applies the safe fixes, --unsafe-fixes adds the unsafe ones, --diff prints the edits instead of writing them. Only project files change. Overlapping fixes wait for the next round. The document is re-analyzed after each round, up to eight.
Errors that stop LaTeX get fixes too. A package a letter off an installed one is respelled (graphix to graphicx), one no installed name is near is deleted. A command only a package defines (\toprule, \SI, \mathbb) loads that package, an arrow tip or shape loads its TikZ library. A second load with new options moves them to the first, a load after \begin{document} moves into the preamble, \DocumentMetadata moves above \documentclass. A \ref or \cite key one typo off a label or entry is respelled. A duplicate label is renamed, and no reference with it. Citations without any bibliography get \bibliography (or biblatex's \addbibresource) for the .bib files beside the document.
Some findings can be repaired in more than one way: a runaway argument may end at its line or at its paragraph. The first fix is the one --fix applies, the others come as alternatives, each its own code action in an editor, never part of a fix-all.
--format json gives each fix as applicability and edits (path, 1-based start/end, replacement), --format sarif as fixes, --format lsp as diagnostics with quickfix code actions.
In the rule list, S marks a rule with a safe fix and U one with an unsafe fix. A rule with both is safe where its fix cannot change what the document means and unsafe where it might. Each finding names its own kind.
One group per category, each with its first rules. A group's button shows the rest.
C001 default: error correctness S U since 0.1.0
command already defined
\newcommand refuses to redefine and raises Command … already defined. The finding names the definition it ran into: the package that made it, or its place in the document.
The same definition again is no conflict: \providecommand keeps the first, and the fix uses it. A package's command is that package's: \renewcommand overrides it where the package uses it too (amsmath's \text inside its own math), so another name is often the better fix. Else use \renewcommand if the redefinition is intended, or pick another name.
C043 default: error correctness since 0.2.0
assertion fails
The condition of %\satex@assert is false on a path that approximated nothing, so a run of the document reaches it false. The finding names the values the condition read there.
See Assertions.
C002 default: error correctness U since 0.2.0
BibTeX command under biblatex
biblatex makes the commands of a BibTeX bibliography raise errors where it has its own: the style is its style option, not \bibliographystyle, and the databases are named in the preamble with \addbibresource and printed with \printbibliography, not with \bibliography (biblatex manual, §3.7.1 and §3.7.2). Only a call the run reached and that raised the error is reported.
Fix by deleting \bibliographystyle (choose a style with \usepackage[style=…]{biblatex}), and by writing \printbibliography for \bibliography with an \addbibresource per database in the preamble.
See biblatex §3.7.
C003 default: error correctness since 0.1.0
build never runs BibTeX or biber
$bibtex_use = 0 tells latexmk never to run BibTeX or biber (latexmk(1), $bibtex_use), so the .bbl file the bibliography is read from is never made and every citation stays undefined.
Fix by removing the setting. latexmk's default, 1, runs them whenever the .bib files exist.
C004 default: error correctness since 0.1.0
engine command lacks %S or %O
latexmk substitutes %S with the source file and %O with the options it passes itself (latexmk(1), "FORMAT OF COMMAND SPECIFICATIONS"). A command without %S compiles nothing, and one without %O loses -jobname, -output-directory and the options given on latexmk's own command line.
Fix by ending the command with %O %S.
See latexmk § FORMAT OF COMMAND SPECIFICATIONS.
C005 default: error correctness since 0.1.0
build uses the wrong engine or output
latexmk's $pdf_mode picks the engine: 1 runs $pdflatex, 4 $lualatex, 5 $xelatex, and 0, 2 and 3 run $latex for DVI (latexmk(1), $pdf_mode). The document contradicts it when a % !TeX program line names another engine, when it uses a primitive only another engine has (\directlua is LuaTeX's, \XeTeXrevision XeTeX's), or when it sets \pdfoutput to the other output than latexmk waits for.
Fix by setting $pdf_mode to the engine the document is written for.
See latexmk § $pdf_mode.
C006 default: error correctness since 0.1.0
build forbids needed shell escape
The run reached \write18, which only hands its text to the shell when the engine is started with -shell-escape (or -shell-restricted and a program TeX Live allows). latexmk starts the engine with the command in $pdflatex, $lualatex, $xelatex or $latex, whichever $pdf_mode selects (latexmk(1), $pdf_mode). arara's pdflatex, lualatex and xelatex rules take shell: yes (arara manual, "The official rules").
Fix by adding -shell-escape to the command, e.g. $pdflatex = 'pdflatex -shell-escape %O %S';, or set_tex_cmds('-shell-escape %O %S'); for every engine at once.
See latexmk § $pdf_mode, arara § The official rules.
C007 default: error correctness since 0.2.0
package error caused by the document
An engine error such as Argument has an extra } arises inside package code. The cause is the document's own call into that code. The finding sits at that call and names the package line where the error arose. A runaway over the document's own unclosed argument is not one: raised-error reports it. Each call and error code is one finding, with a count when it repeats.
When satex had to approximate on the way, the error may not be TeX's: it is a precision note, not a finding. An exact error after such a one may be its echo, as TeX's recovery left a state that may not be TeX's. The finding is then a warning that names the earlier error.
C025 default: error correctness U chktex 9, 10, 15 since 0.1.0
wrong environment closed
Environments nest like brackets: the name \end gives has to match the one \begin most recently opened. chktex tracks this as warnings 9 ('%s' expected, found '%s'), 10 (Solo '%s' found) and 15 (No match found for '%s') for brackets and environments alike. satex only records \begin/\end occurrences, so this rule covers environments and not generic {}, [] or () nesting.
An error raised inside the environment before the \end may have ended it early, through TeX's recovery or the analysis's approximation of its input. The finding is then a note that names that error, as is one the analysis reached on only some of its paths.
LaTeX stops with \begin{…} on input line … ended by \end{…}, an error.
Fix by naming the environment that is actually open, or by closing the inner environments first.
See chktex 9, chktex 10, chktex 15, source2e § ltmiscen.dtx.
C046 default: error correctness since 0.2.0
unreadable satex directive
A directive is a comment, so TeX skips it: %\satex@assert{cond}, %\satex@assume{cond} or %\satex@configure{key=value, ...}. A condition compares two TeX numbers (\thepage < 5, \value{section} >= 2) or two dimensions when one has a unit (\wd0 <= 3cm), with <, <=, =, !=, >= or >. It may also be a TeX conditional such as \ifdefined\foo. and, or and not combine tests. \the<counter> is the counter's value, however \pagenumbering prints it.
See Assertions.
C066 default: error correctness S since 0.2.6
entry breaks the database's grammar
An entry is @type{key, name = value, …}. A value is a number, a constant, {…} or "…" with balanced braces, or several joined by #. Where an entry breaks this (a missing comma, a brace or quote that never closes, a } too many inside quotes), BibTeX says I was expecting a ,' or a }' and skips the rest of the entry: the fields after the break are lost, and an unclosed brace swallows the entries that follow. biber stops with a syntax error. biber also wants the comma after the key: @misc{key} is an error to it, not to BibTeX.
Every entry of a loaded database is checked, cited or not. The message names the line where the reader gives up, which may be after the slip.
Fix by repairing the entry. The quick fix adds the comma after a lone key.
See btxdoc § The database files.
C008 default: error correctness chktex 16 since 0.2.0
math mode left open
A $ that is never closed leaves TeX in math mode. The next \par makes TeX report Missing $ inserted and close the formula itself (tex.web § 1047 insert_dollar_sign), and everything up to there is set as mathematics.
The rule reports what the interpreter already saw: the missing-dollar diagnostic it raised, or, where no \par followed, a last character still carrying a math mode (unless a limit stopped the run before the text's end). It reports one finding, never both.
Fix by closing the formula.
See chktex 16, tex.web § 1047.
C055 default: error correctness U since 0.2.5
DocumentMetadata after documentclass
\DocumentMetadata sets up the PDF management and tagging code before anything else is loaded, so it has to be the first command of the document. After \documentclass it raises an error, and none of its keys take effect: no tagging, no PDF standard, no language. A second call after a first one before the class is fine: it only sets more keys.
Fix by moving the call above \documentclass.
See latex-lab § documentmetadata-support.
C047 default: error correctness S since 0.2.0
document has no end
Every path of the run reads the document to its end without meeting TeX's \end: plain TeX's \bye, or LaTeX's \end{document}. TeX then stops with *** (job aborted, no legal \end found) and writes no last page. A file that is no document of its own (a chapter \input by another) ends this way by design and is not reported.
Fix by ending the document with \bye (plain TeX) or \end{document} (LaTeX).
C009 default: error correctness since 0.1.0
image missing for this output
\includegraphics names a file that graphicx cannot find, with any extension in \Gin@extensions, beside the document or on \graphicspath. Which extensions count is the driver's (pdftex.def, dvips.def, xetex.def), so it follows the output.
Fix by adding the file, or by producing the format the driver reads.
C010 default: error correctness since 0.2.0
declaration redefines a command
A LaTeX \new… command declares a fresh name, and some do not check that it is: \newif\begin makes \begin a conditional (and defines \gintrue and \ginfalse from what follows its first two letters), \newcount and \newtoks overwrite whatever the name meant. Every later use of the name then does something else, and the error a run reports is somewhere after it, often far away. Reported where the document's own \new… call made the definition of a name its own files spell.
Fix by giving the declaration the name it was meant to have (a conditional's name begins with if), or by declaring the argument it lacks.
C011 default: error correctness S since 0.1.0
renewing an undefined command
\renewcommand requires an existing definition and raises Undefined control sequence.
Fix with \newcommand, or load the package that was supposed to define it.
C012 default: error correctness U since 0.1.0
package loaded with clashing options
LaTeX loads a package once. A second \usepackage with options the first one did not have raises Option clash for package.
Fix by giving all the options to the first load, or by using \PassOptionsToPackage before it.
C013 default: error correctness S U since 0.1.0
TeX error in the document
Running the document reaches \errmessage, which every LaTeX error (\PackageError, \msg_error:nn, the kernel's own) ends in: a real run stops there. A more specific rule that explains the same error reports it instead. An error reached only on a path satex could not decide, or after it lost track of the mode, is not one a real run need reach, and is not reported. A runaway in package code over an argument the document leaves open is the document's error too: it is shown at the call that opens it.
The common errors come with a fix read off the source. Safe ones write out what TeX's recovery does: a } that closes no group is deleted, a \\ with no line to end too, a bare length gets its pt, \csname its \endcsname before the first command that does not expand. The others guess the intent and need a review: an argument that never closes is closed at the end of its line (or of its paragraph, offered too), a math-only token is set as a formula, an & past the last column repeats the last column of the table's preamble, an & in text becomes \&, text before a \begin{document} the file lacks gets one, \item outside a list gets an itemize, a second script of one kind on a nucleus braces the first scripted nucleus ({x^2}^3). A { still open at \right is closed right before it (safe), at \end too (a review).
C014 default: error correctness since 0.2.0
color used before it is defined
xcolor reaches every color through \color@⟨name⟩ (xcolor § 2.5). A name the run never defined there raises Undefined color when xcolor itself looks it up. The rule reads the same lookup the run made: a name a \color, \textcolor or \colorlet reached while nothing had defined it.
Fix by defining the color first, or by correcting its name.
See xcolor § 2.5.
C015 default: error correctness U since 0.1.0
undefined command
The name has no meaning at the point it is used, so a real run would stop with Undefined control sequence. When the message says "not on every path", the definition sits in a conditional arm that this use does not depend on.
Fix by loading the package that provides it, defining it before the use, or correcting the spelling.
C016 default: error correctness U since 0.1.0
undefined environment
\begin{name} expands \name, and nothing defines it. A real run reports Environment name undefined.
Fix by loading the package that provides the environment or by defining it with \newenvironment{name}{…}{…}.
C017 default: error correctness since 0.1.0
glossary entry never declared
\gls and its relatives name an entry that no \newglossaryentry, \newacronym, \acro or \DeclareAcronym declares. A real run stops with Glossary entry ... has not been defined.
Fix by declaring the entry, or by correcting the key.
See glossaries § Defining glossary entries.
C018 default: error correctness since 0.1.0
recursion that never stops
The run saw the macro's expansion reach the macro again, could not see the recursion end, and found no conditional (no \if…, \else or \fi) to end it, in any macro of the cycle or in one their replacement texts name. A macro nothing expands is judged by the names its replacement text holds, and it calls a name only where the name stands to be expanded: not inside braces, not as the target of a definition or after \string, and not as a quark (\def\q{\q}, compared and never expanded). A real run expands until TeX runs out of memory: TeX capacity exceeded, sorry [main memory size].
Fix by adding the test that stops it, or by removing the self-reference.
C052 default: warning correctness since 0.2.0
cited entry lacks a required field
The style's data model requires fields per entry type: the .bst's output.checks (BibTeX warns empty journal in knuth84), or biblatex's mandatory constraints (biber warns under --validate-datamodel). An empty field counts as missing. A field counts under the name biber gives it (journal is journaltitle, school is institution), and a type under the one biber reads it as (@phdthesis is a @thesis). BibTeX renames nothing.
A crossref parent hands its fields down: all of them with BibTeX, what biblatex's inheritance rules say with biber (a @proceedings' title arrives as booktitle, not as title). xref hands down nothing. Nothing is reported for biber while the document declares a source map or inheritance rules of its own. Only cited entries are checked.
Fix by adding the field.
See btxdoc § Using BibTeX, biblatex §2.1.
C071 default: warning correctness since 0.2.6
crossref to no entry, or to an earlier one
crossref names the entry a cited one inherits its missing fields from. Where no database declares that key, BibTeX stops with A bad cross reference and biber warns I didn't find a database entry for crossref: nothing is inherited. BibTeX compares keys without case, biber with it.
BibTeX reads the databases once, in order. A parent that stands before its child and is not cited itself is passed by before the child names it, and BibTeX reports the same bad cross reference. btxdoc asks for the parent after every entry that refers to it. biber has no such order.
Fix by adding the entry, by correcting the key, or by moving the parent below its children.
See btxdoc § The entries, biblatex §2.4.1.
C019 default: warning correctness since 0.1.0
glossary files have no latexmk rule
latexmk runs BibTeX, biber and makeindex by itself, but a glossary is sorted by a program it does not know about (makeglossaries, makeindex with a glossary style, bib2gls). Without a custom dependency (latexmk(1), "CUSTOM DEPENDENCIES") the glossary files are never made and the glossary stays empty. The glossaries manual gives the rule, e.g.
add_cus_dep('glo', 'gls', 0, 'makeglossaries');
sub makeglossaries { system("makeglossaries '$_[0]'"); }
See latexmk § CUSTOM DEPENDENCIES, glossaries § bib2gls.
C020 default: warning correctness since 0.1.0
category code change outlives its group
\catcode is local, so a change made inside a group is undone by the closing brace. One still in force at the end of the document was made at the outer level, and everything read after it is tokenized differently.
Fix by wrapping the change in {…} or \begingroup…\endgroup, or by restoring the old value explicitly. satex query catcodes shows the current table.
C069 default: warning correctness S U since 0.2.6
fields that exclude each other
Some fields say the same thing twice, and the reader takes one. A .bst checks its pairs itself (either.or.check): BibTeX warns can't use both author and editor fields for a @book, and can't use both volume and number fields. biber renames BibTeX's field names to biblatex's (journal to journaltitle): where an entry gives both, the old name is dropped. A date carries the year and the month: biber warns Overwriting field 'year' with year value from field 'date' where a year or month beside it says something else.
The pairs come from the style: the .bst's checks, biblatex's source map.
Fix by keeping one. The quick fix deletes the field biber drops, safely where both say the same.
See btxdoc § The entries, biblatex §2.2.5.
C021 default: warning correctness since 0.2.0
color name defined twice
Two \definecolor-family calls store different colors under the same name. Only the last one is ever read back. Silent where the first is a package's: a default the document recolors on purpose.
Fix by giving the second color its own name, or by removing the earlier definition.
See xcolor § 2.5.
C022 default: warning correctness U chktex 43 since 0.2.0
\left or \right before a brace
\left, \right and \middle scan a delimiter: one character with a \delcode, or one control sequence made by \delimiter (tex.web § 1161). A {, a } or a $ is none of those, so TeX reports Missing delimiter (. inserted) and sets nothing.
The rule asks what each command means rather than matching its name, so it covers \middle and any \let alias, which chktex's name list does not.
Fix by writing \{ and \} for brace delimiters, or \left. where no delimiter is wanted.
See chktex 43, tex.web § 1161.
C023 default: warning correctness since 0.1.0
key declared twice
Two \bibitems with one key make LaTeX warn Label … multiply defined and every citation resolves to the later one. Two .bib entries with one key make BibTeX stop with Repeated entry.
Fix by renaming or deleting one of them.
C067 default: warning correctness S since 0.2.6
field given twice in one entry
An entry that gives a field twice keeps one of the two. BibTeX reads the first and warns I'm ignoring knuth84's extra "title" field. biber reads the last and says nothing. A database moved between the two changes what is printed.
Fix by deleting one. The quick fix deletes the one the document's reader does not read, so the output stays as it is.
See btxdoc § The database files.
C050 default: warning correctness S since 0.2.0
database loaded twice
A .bib file named twice (\bibliography{a,a}, \addbibresource twice, or \bibliography and \addbibresource both) is read twice. BibTeX reports every entry as a Repeated entry. biber warns about each duplicate key.
Fix by dropping the second load.
C051 default: warning correctness U since 0.2.0
one work under two keys
Two entries with the same DOI, or the same title and year, are one work under two keys, in one database or in two. Citing both prints it twice in the bibliography.
Fix by merging them: the entry with more fields stays, gains the fields only the other has, and the citations of the other key cite the kept one.
C024 default: warning correctness U since 0.1.0
label defined twice
LaTeX warns Label … multiply defined and every reference resolves to the later one. The finding stands at the innermost command of the document's text that writes the label: the \begin inside a \sbox argument, not the \sbox. Only the kernel's \newlabel (and zref's) warn: a name another package writes to the .aux file twice, such as a tikzmark, is not checked.
Fix by renaming one of them. The fix renames the later one and no reference: those that resolved to it then resolve to the first, so it needs a check.
C026 default: warning correctness since 0.1.0
ExplSyntaxOn never turned off
With expl3 syntax on, spaces are ignored and _ and : are letters, so ordinary text stops working.
Fix by adding \ExplSyntaxOff after the code that needs it.
C027 default: warning correctness since 0.2.0
expl3 constant set again
A \c_… variable is a constant (interface3): it is made once, by \…_const:N… or \…_new:N, and never set. The run set this one again.
Fix by making it a variable (\l_… or \g_…) or by not changing it.
See interface3 § Naming functions and variables.
C028 default: warning correctness since 0.1.0
expl3 argument signature mismatch
An expl3 name carries its signature after the colon (interface3, "Naming conventions"): one letter per argument, N a single token, n a braced group.
What the function really consumes (the calls the run saw, or probe input for one the document defines) takes a different number of arguments, or an optional one or a star, which no expl3 signature has. \foo:nn⟨a⟩ that takes one argument leaves the second for whatever follows.
Fix by renaming the function to the signature it has, or its parameter text.
See interface3 § Naming conventions.
C057 default: warning correctness since 0.2.5
graphic without alternative text
With tagging on, every \includegraphics becomes a Figure structure element, which needs alternative text (PDF/UA, ISO 14289-1 §§ 7, 3). Without alt=, latex-lab warns and uses the file name instead, which a screen reader then reads out. A purely decorative graphic is marked artifact instead, and actualtext= stands for a graphic that shows text.
The rule reports where the run itself raised that warning. A graphic set while tagging is suspended (\SuspendTagging, \tag_stop:) raises none. There is no automatic fix: only the author knows what the graphic shows. The image dialog has a field for it.
See latex-lab § latex-lab-graphic, Matterhorn Protocol § 13.
C029 default: warning correctness U chktex 31 since 0.2.0
text lost after verbatim end
A verbatim environment that reads its body line by line throws away whatever follows \end{…} on the same line. fancyvrb does this and the kernel's verbatim does not, so chktex reports warning 31 for both.
satex reports only where the text was really lost. It knows which environments the run read verbatim, because opening one changed the category code of \, and reports the tail only where the run set none of it.
Fix by moving the text to the next line.
See chktex 31.
C068 default: warning correctness S since 0.2.6
value is not what the field takes
A name list is names joined by and, each First Last, Last, First or Last, Jr, First. BibTeX warns Too many commas in name at a third comma and has a comma at the end at a closing one. biber skips the entry at a third comma or at two in a row. An and at the start, at the end or twice in a row joins no name: BibTeX prints it as part of a name, biber skips the entry. others stands for the rest only as the last name.
With biblatex a value must also fit the datatype the data model declares for its field. biber warns about a date it cannot read (2001-05-21, a / range, ISO 8601-2), about a year or month that is no number (month = {jan} in braces is a word, bare it is the month constant), and about an ISBN whose check digit fails. Under --validate-datamodel it also rejects an integer field that is no number (volume = {IV}), an ISSN or ISMN with a wrong check digit and a value outside its field's pattern: these are notes. A value with a macro or braces in it is not judged.
The quick fix drops stray ands and closing commas, and unbraces a month constant.
See btxdoc § The entries, biblatex §2.3.
C030 default: warning correctness S chktex 3, 25 since 0.2.0
script needs braces
^ and _ attach the single next token to the atom before them (The TeXbook, chapter 16). x^12 sets the exponent 1 and then a 2 of its own size, and (a+b)^2 puts the exponent on the closing parenthesis alone.
The rule lexes the source with TeX's own mouth where the run really was in math mode, so a ^ under another catcode regime is not one, and \left( … \right)^2 is one atom the script attaches to.
Fix by putting the script between { and }.
See chktex 3, chktex 25, The TeXbook, chapter 16.
C065 default: warning correctness U since 0.2.5
citations without a bibliography
The document cites, but no \bibliography, \addbibresource or thebibliography says where the entries stand: every citation prints ?, and BibTeX stops with I found no \bibdata command.
The quick fix names the .bib files beside the main file: with biblatex \addbibresource in the preamble and \printbibliography at the end, else \bibliographystyle{plain} and \bibliography at the end.
C031 default: warning correctness S since 0.1.0
package missing from the dependency file
depp names the TeX Live package of every file a run reads by where it sits in the tree (tex/⟨format⟩/⟨package⟩/) and writes them to DEPENDS.txt. The project's dependency file lacks one of them, so an installation made from it (a minimal Docker image, a texlive.withPackages) cannot build the document.
Fix by adding the package to the dependency file, or by rerunning depp.
C063 default: warning correctness U since 0.2.5
misspelled magic comment
Editors and satex read % !TeX program = …, % !TeX root = … and their kin before the run: the engine, the root file, the encoding. A typo in the head or the key (% !rex program, % !TeX progam) turns the line into a plain comment, so the document builds with another engine or root than you meant.
The rule reports a comment that is one or two letters away from a known head (magic.prefixes) or key. Fix by writing the head or key as it should be.
C064 default: warning correctness since 0.2.5
a package command fails on some call
When you analyze a package or class itself, satex calls each command it defines once, the way a static analyzer checks a function: every mandatory argument holds unknown text and optional ones are left out. A TeX error that call raises (an undefined command, a missing number, a runaway argument) is one some document using the package will meet.
The rule reports it at the definition, with TeX's message. Unknown text over-approximates every argument, so the error may need a particular argument: check what the command does with it.
C061 default: warning correctness U since 0.2.5
package overrides an earlier one
A package loaded later redefines a command an earlier package made, and the document uses that command. The later definition wins, often by accident. The finding names the command and both packages, as the run saw them. A command the document defines itself, or one the later package gives the same meaning again, is none.
Where the earlier package defines the command without checking that it is new, loading the later package first keeps the earlier version. The fix then moves the later \usepackage above the earlier one. The rule stays quiet where the later package names the earlier one in its own file: it adapts it on purpose, often after \@ifpackageloaded.
C058 default: warning correctness S since 0.2.5
PDF/UA without a title
PDF/UA requires a document title in the XMP metadata (dc:title), shown by the viewer in place of the file name. pdfmanagement writes it from the document property hyperref/pdftitle. With tagging on, latex-lab's title code fills that property from \title{…}. Without it, only \hypersetup{pdftitle={…}} does. The run ended with the property empty.
Fix with \title{…} under tagging, or \hypersetup{pdftitle={…}}. Where \title is there but latex-lab's title code did not take it, the fix writes \title[pdftitle={…}]{…} from the title as the run rendered it.
See Matterhorn Protocol § 06, latex-lab § latex-lab-title.
C054 default: warning correctness U since 0.2.4
name does not match the label
Subsection~\ref{sec:a} or Chapter~\ref{sec:a} for a section, or Figure~\ref{tab:b}, names the wrong kind of thing. The general word for a deeper unit is fine (a subsection is a section), and so is Appendix for a section or chapter. Names come from the counter, \<counter>name (babel) and cleveref.
Fix by writing the label's own name, or \Cref.
See cleveref § 2.
C056 default: warning correctness since 0.2.5
package incompatible with tagging
The LaTeX tagging project keeps a status for each package and class, and TeX Live ships it as latex-tagging-status.ltx (what \DocumentMetadata{check-tagging-status} reports from). satex runs that file and looks up every file the run loaded. A file marked currently incompatible or no support breaks the structure tree or the tagged content in ways the run does not report: the PDF may fail validation, or read wrongly in a screen reader.
Fix by replacing the package (the status page names alternatives), or by switching tagging off until it is supported.
See LaTeX tagging project § tagging-status.
C060 default: warning correctness xetex, tex since 0.2.5
engine does not support tagging
The tagging code supports pdfLaTeX and LuaLaTeX. Under XeLaTeX (and other DVI-based routes) tagpdf cannot mark interword spaces as real space characters, so text extracted from the PDF runs together, and the structure code is not tested there.
Fix by compiling with LuaLaTeX, which the tagging project recommends, or pdfLaTeX.
See LaTeX tagging project § usage-instructions.
C059 default: warning correctness S since 0.2.5
tagging without a language
A tagged PDF names its natural language in the catalog's /Lang, which screen readers use to pick a voice (PDF/UA, ISO 14289-1 §§ 7, 2). \DocumentMetadata{lang=…} sets it. Without the key, LaTeX guesses at \begin{document} from babel's main language, or en without babel, and warns (lang-missing). The guess is wrong for a document in another language that does not load babel.
The fix writes the language LaTeX guessed, which changes nothing in the PDF and silences the warning: check that it is the right one.
See Matterhorn Protocol § 11, latex-lab § documentmetadata-support.
C032 default: warning correctness chktex 17 since 0.2.0
unbalanced brackets
TeX gives (, ), [ and ] no meaning of their own, but a document uses them for structure, so a count that does not match lost a bracket (chktex 17).
This rule counts the brackets the run really set, so one a macro produced counts and one a macro read as an argument does not. A bracket in math is a delimiter, and one read verbatim is program text. The finding points at the first bracket left over.
Fix by adding the bracket that is missing.
See chktex 17, The TeXbook, chapter 2.
C033 default: warning correctness pdftex, luatex since 0.2.0
unbalanced color stack
\pdfcolorstack⟨stack⟩ push and pop nest like q/Q in the page's own content stream (pdfTeX manual, § 8.9.8): a viewer that reads the stack back after the page still expects it empty. A stack number the run could not decide is left out, since satex would otherwise be guessing which stack a push or pop belongs to.
Fix by balancing every push with a pop in the same group.
See pdftex § 8.9.8.
C034 default: warning correctness pdftex, luatex, xetex since 0.1.0
unclosed PDF literal
\pdfliteral and \special{pdf:…} (what ocgx2, ocg-p and pdfbase use to write raw PDF) drop q/Q and BMC/BDC/EMC straight into the page's content stream. q/Q save and restore the graphics state: color, line width, the current transform. BMC/BDC/EMC bracket marked content, an optional content group among them. Both have to nest within the page (PDF 32000, §§ 8, 4, 2, 14, 6). One left open leaks its state into everything typeset after it. A viewer may also just reject the page.
satex does not break pages into content streams itself, so it checks the order the run executes the literals in.
Fix by closing what is opened in the same group, or by using one environment for both ends.
See PDF 32000 § 8.4.2, PDF 32000 § 14.6.
C053 default: warning correctness since 0.2.0
undefined @string constant
A bare word in a field value is a constant: an @string of the databases, or one the style predefines (jan). Any other is undefined: BibTeX warns I don't have a string and writes nothing for it.
Fix by defining the constant, or by writing the value in braces.
See btxdoc § The database files.
C035 default: warning correctness U since 0.1.0
citation key not in the bibliography
No \bibitem and no entry of the .bib databases \bibliography names declares this key, so LaTeX prints ? and warns Citation … undefined. Citations are observed rather than listed: a citation command writes its key to the .aux for the bibliography program (\citation{⟨key⟩}) and reads the name the entry defines when the file is read back (\b@⟨key⟩). Any line written so is a citation. Without any bibliography every citation is undefined. Nothing is reported while a named database cannot be found, or while a file of the document was not read.
Fix by adding the entry, or by correcting the key. The quick fix respells a key near a declared one's, else adds a stub entry to the first database, to fill in.
C048 default: warning correctness U since 0.2.0
cleveref has no name for this label
cleveref prints a reference with the format of the label's type: \cref the cref one, \Cref the Cref one, \crefrange the range ones. \crefname makes them all. cleveref names the common types itself, and a theorem's from its heading, but a counter of the document's own (a \newcounter stepped with \refstepcounter) has none. The reference then prints ?? 1, and cleveref warns that the cref reference format for label type task is undefined.
The finding is that warning, raised by cleveref's own code in the run, at the first reference of each type. Where it was raised on only some paths of the analysis, or after code the run could not follow, it is a hint.
Fix by naming the type after \usepackage{cleveref}: \crefname{task}{task}{tasks}.
See cleveref § 8.1.2.
C036 default: warning correctness since 0.1.0
unknown optional content group
/OC /name BDC refers to /name in the page's /Properties resources, which maps it to an optional content group (PDF 32000, § 8.11.3.2). A name that no \pdfpageresources, \pdfobj or pdf: object mentions is unknown to the viewer, and the content is shown or hidden at its whim. The rule is silent while the run observed no such resources at all.
Fix by declaring the group, or by correcting the name.
See PDF 32000 § 8.11.3.2.
C037 default: warning correctness U since 0.1.0
reference to an undefined label
No \label in the document or its inputs declares this key, so the reference prints ??. When the run left a project file unread, the label may stand there: the finding is then a precision note.
Fix by adding the \label, or by correcting the key: a key near a known label's is offered respelled.
C038 default: warning correctness since 0.2.0
package not installed
The file was not found in any tree the run searched, and the distribution's package manager names a package that ships it. The load is therefore no typo: the package is only missing from this machine. A LaTeX package and the package that carries it often differ in name, so the finding names both.
Fix by running the command the finding gives, or satex install, which never runs as part of lint --fix. The question is off by default because it reads the package repository: turn on plugins.packages in satex.yaml.
See TeX Live manual § tlmgr, MiKTeX manual § miktex packages.
C070 default: warning correctness since 0.2.6
entry type the style does not define
A .bst defines a function per entry type. For any other type BibTeX warns entry type for "key" isn't style-file defined and formats the entry with the style's fallback, if it has one. The standard styles know no @online. biblatex's data model declares its types, and biber reads some BibTeX types as one of them (@phdthesis as @thesis): any other becomes a @misc, with a warning under --validate-datamodel.
Fix by using a type of the style.
See btxdoc § Entry types, biblatex §2.1.
C049 default: warning correctness since 0.2.0
unknown listings language
listings finds a language through the driver \lstlang@⟨language⟩$⟨dialect⟩, which \lstdefinelanguage defines and the language files (\lstlanguagefiles, lstlang1.sty and its siblings) declare. A name none of them defines raises Couldn't load requested language, and the listing is typeset without highlighting.
The rule reads the keys whose values the run formed such a driver from (language=), and checks every value of those keys against the run's definitions and the declarations of the language files. Where the run did not know the list of language files, the finding is a note.
Fix by correcting the name, or by defining the language with \lstdefinelanguage.
C062 default: warning correctness U since 0.2.5
package name misspelled
No file of this name is installed, and an installed package has a name a letter or two away. The load is then most likely a typo, and LaTeX stops with File … not found. A name the package manager can install is uninstalled-package instead, and a name with no close match stays unresolved-file.
Fix by loading the installed package the finding names.
C039 default: warning correctness U chktex 27 since 0.1.0
file not installed
The file was searched for in the document's directory, the configured search paths and the TEXMF trees, and not found. Case mismatches on case-insensitive filesystems are also reported: they work on Windows or macOS but break on Linux. satex query distribution shows which installation was searched. Where every installed file is listed, a class or package not found stops LaTeX (File … not found) and the finding is an error. In the playground, which fetches packages as they are named, it stays a warning.
Fix by installing the package, adding its directory to search_paths in satex.yaml, pointing texmf.roots at the right installation, or (for case mismatches) renaming the file to match the requested name. The quick fix deletes the load of a package not installed.
See chktex 27.
C045 default: info correctness since 0.2.0
document assumes a condition
%\satex@assume drops the paths where its condition is false and narrows the registers it compares on the others. What the run proves after it holds for the runs where the assumption does.
See Assertions.
C040 default: info correctness since 0.2.0
file read before a package it expects
A package or class read on its own may use names that another one defines, as a beamer theme uses beamer's. When load.expect_detect is on, SaTeX looks up which classes and packages on disk define those names, and reads the file again after the one that defines most of them. It keeps that run when it leaves fewer names undefined.
Fix by naming what the file expects in load.expect, or by loading it with \RequirePackage in the file itself.
C041 default: info correctness chktex 49 since 0.2.0
math delimiter in the wrong mode
LaTeX's four math delimiters each test the mode before they act. \( and \[ require that math is off, \) inner math and \] display math. Where the test fails they call \@badmath, which reports Bad math environment delimiter (source2e, ltmath.dtx).
The rule reads the mode each one really ran in, so it sees a \( nested in a $ … $ and a delimiter reached through a macro, where chktex follows the source and misses both.
Fix by pairing each delimiter with its own partner.
See chktex 49, source2e § ltmath.dtx.
C042 default: info correctness U chktex 21 since 0.2.0
command followed by escaped punctuation
\TeX\. Right? does not set TeX. Right?. \. is the dot accent, so it takes the R and sets TeXṘight? (chktex 21).
The rule looks for a control word followed with nothing between by \., \,, \;, \:, \! or \?, where a space and a word follow. It stays quiet in math mode, where \, is a thin space, inside a body the run read verbatim, and where the run really did set that mark there.
Fix by removing the backslash.
See chktex 21, The TeXbook, chapter 9.
C044 default: hint correctness since 0.2.0
assertion always holds
The condition of %\satex@assert is true on every path that reads it. The paths cover every run of the document, so the property holds, under the assumptions the run reports.
See Assertions.
X001 default: warning security since 0.1.0
build allows unused shell escape
-shell-escape lets every package and every .aux or .bbl line the document reads run any program as you. The run reached no \write18, so the permission buys nothing and only widens what a hostile input file can do.
Fix by removing -shell-escape from the engine command (or shell: yes from the arara directive).
X002 default: warning security since 0.1.0
document runs a program
\write18 hands its text to the shell. A run only does that when the engine was started with --shell-escape, or with --shell-restricted and the program is one TeX Live allows. shell_escape in satex.yaml says which of the three this build is.
Fix by running with the flag the document needs, or by removing the call.
S001 default: warning style U chktex 7 since 0.2.0
accent on a dotted i or j
An accent is placed over the whole character, so an i keeps its dot under it (The TeXbook, chapter 9). \i and \j are the dotless letters, and math has \imath and \jmath (fntguide § 5).
The rule reads the character the \accent or \mathaccent primitive really took, and how far the argument reaches from the source, so \^{}i is left alone. In OT1 \'i is a composite for \'\i and in T1 the glyph í, so neither is reported.
Fix by writing the dotless letter under the accent.
See chktex 7, The TeXbook, chapter 9, fntguide § 5.
S002 default: warning style S chktex 1 since 0.2.0
space eaten after a command
TeX reads a control word and then discards the spaces after it (The TeXbook, chapter 3), so \TeX ok sets TEXok.
A space the source has after a control word and the run never turned into glue is one TeX swallowed. The rule reports it only where the command put a character on the page and the next word starts against it, so \rm text and \noindent text stay silent.
Fix by writing \TeX{} ok, or \TeX\ ok where a space belongs. Where the joined word is meant (\TeX book for TeXbook), write \TeX{}book: no space is swallowed there, so the rule stays silent and the intent shows.
See chktex 1, The TeXbook, chapter 3.
S003 default: warning style U chktex 29 since 0.2.0
x instead of a times sign
640x480 sets the letter x between the numbers. The sign for a product is \times, a binary operator with the spacing of one (The TeXbook, chapter 16).
The rule reads the characters the run set, so it finds a dimension a macro assembled as well as one typed out. It names \times where the letter was already in math mode and $\times$ where it was in text.
Fix by writing the operator.
See chktex 29, The TeXbook, chapter 16.
S004 default: warning style S U chktex 30, 39 since 0.2.0
double space
TeX reads a run of spaces as one space token (The TeXbook, chapter 8), so two spaces in the source set one on the page. satex reports only the spaces that really reached it.
Two do when a tie stands beside an ordinary space, as in Dr.~ Smith, and when the run appended two glues in a row, as in a {} b. That second case is chktex's warning 30, off by default, so it comes as a note.
Fix by deleting the ordinary space.
See chktex 39, chktex 30, The TeXbook, chapter 8.
S060 default: warning style U since 0.2.4
doubled punctuation
etc.. sets two periods where one does both jobs. ,,, ;;, ?., !., ,., ;. and :. are the same slip. It counts a period a command set too. Three periods (ellipsis-dots) and e.g., are fine.
Fix by deleting the extra mark.
S005 default: warning style U chktex 11 since 0.2.0
three periods, not an ellipsis
Three . characters are set with the spacing of three periods, which is tighter than an ellipsis (The TeXbook, chapter 18). \ldots sets them on the baseline and \cdots at the height of a binary operator.
The rule reads the periods that reached the page, so an ellipsis a command produced is already excluded. In math it names \cdots between the operators chktex lists.
Fix by writing the command.
See chktex 11, The TeXbook, chapter 18.
S054 default: warning style U since 0.2.0
et al. spelled by hand
et al. shortens et alii. et is a whole word, so only al. takes a period. et. al., et.al., et al and the spelled-out et alii or et alia read as slips. The fix writes et al. and keeps a tie the source had.
A number in brackets typed after it, as in Smith et al. [3], is a citation typed by hand, so it does not follow the bibliography. Write \cite, or \textcite (biblatex) and \citet (natbib), which print the authors too.
Text in math, verbatim or a comment is never read. The space after al. is the business of sentence-spacing.
See The LaTeX Companion § 16.3.
S006 default: warning style since 0.2.0
expl3 scope prefix mismatch
A variable named \l_… is local and \g_… global (interface3). The run set this one the other way: a \l_ variable by a global function (\tl_gset:Nn), or a \g_ variable by a local one. Declarations (\…_new:N) are global for every variable and do not count.
Fix by renaming the variable or using the function of the other scope.
See interface3 § Naming functions and variables.
S007 default: warning style since 0.2.0
expl3 type suffix mismatch
A variable's name ends in its type (_tl, _seq, _int, … in interface3). The run made or set this one with another module's function, as \seq_set_split:Nnn on a _tl variable. A string and a comma list are token lists, so token list functions on them are fine.
Fix by renaming the variable or using the functions of its type.
See interface3 § Naming functions and variables.
S008 default: warning style since 0.1.0
definition lost when its group closes
\def and \newcommand are local. Inside {…}, \begingroup…\endgroup or an environment, the definition disappears at the closing brace.
Fix by moving the definition out of the group, or by prefixing it with \global.
S067 default: warning style U since 0.2.5
text color with too little contrast
Text needs a contrast ratio of at least 4.5:1 against its background to be readable for people with low vision (WCAG 2, success criterion 1.4.3). Large text needs 3:1: from 18pt, or 14pt in bold. The rule reads the color each character was set in, as the run computed it. The background is the page, \pagecolor, or the \colorbox the character sits in. Text over something satex does not read, such as a TikZ fill or a page background drawn at shipout, is left alone.
The fix darkens or lightens the color in its hue until it reaches the ratio. It rewrites the document's own \definecolor where there is one. The limits are lints.low-contrast-color.
See WCAG 2.2 § 1.4.3.
S009 default: warning style U chktex 35 since 0.2.0
operator name in math italic
Letters in math mode are set in math italic, one variable per letter, with the spacing of a product (The TeXbook, chapter 18), so $sin(x)$ sets a product of three variables.
satex decides this from the run, not from a list of names: the name the letters spell has to be a command this document has whose body sets exactly those letters. So \argmax from \DeclareMathOperator is suggested too, and \mathrm{sin} is left alone.
Fix by writing the command.
See chktex 35, The TeXbook, chapter 18.
S010 default: warning style U chktex 6 since 0.2.0
missing italic correction
A slanted letter leans over the space after it, and \/ adds the kern the font asks for (The TeXbook, chapter 4).
satex compares each character's \f@shape against the kernel's \itdefault and \sldefault (fntguide § 2), and the character's italic correction in its own font says whether the kern is worth having. So {\it …}, \emph{…} and a shape a package selects are all seen alike, where chktex knows only a list of names.
Fix by writing \/ after the last slanted character.
See chktex 6, The TeXbook, chapter 4, tex.web § 1113.
S011 default: warning style U chktex 2 since 0.2.0
missing tie before a reference
A reference should not begin a line on its own, so a tie belongs in front of it. ~ is an interword space TeX may not break at (The TeXbook, chapter 14).
The rule reads the reference and citation sites the run recorded, so it follows a \ref inside a macro of yours without a list of names, and it reports only where the space really became glue (tex.web § 1043).
Fix by writing Figure~\ref{fig:one}.
See chktex 2, The TeXbook, chapter 14, tex.web § 1043.
S063 default: warning style since 0.2.5
hbox too wide for its width
\hbox to ⟨width⟩{…}, and the LaTeX boxes built on it such as \makebox[⟨width⟩][s]{…}, pack their material to a given width (tex.web § 649). Material wider than that, after all its glue shrank, sticks out of the box, and TeX writes Overfull \hbox (…pt too wide) detected at line … to the log (§ 666). The rule reports that line's box by the same amount, only where its material and width were known on every visit.
Fix by widening the box, shortening its material, or giving it infinitely shrinkable glue (\hss) where sticking out is meant.
See tex.web § 664, tex.web § 666.
S062 default: warning style since 0.2.5
line wider than the text block
TeX breaks a paragraph into lines and packs each to the line width (tex.web § 889). A line whose natural width, less all its glue can shrink, still passes the width sticks out into the right margin, and TeX writes Overfull \hbox (…pt too wide) in paragraph to the log (§ 666).
satex runs TeX's own line breaker (§§ 813–890) on the paragraph, so it reports exactly the lines TeX reports, at the user's line that ended the paragraph, by the same amount. It stays silent where any width, font or parameter is not known, where character protrusion or font expansion (microtype) is on, and where the paragraph may be set differently on another path.
Fix the text, not the measure: allow a hyphenation point in the long word (\-, or \hyphenation{…}), let the paragraph space out (\begin{sloppypar} or \emergencystretch), or rephrase it. satex never rewrites the text itself.
See tex.web § 889, tex.web § 666, The TeXbook, chapter 14.
S012 default: warning style U chktex 36, 37 since 0.2.0
parenthesis takes the wrong space
A parenthesis takes the space of the text around it, never of the text inside it: text (inside) text, not text( inside )text.
The rule reads the characters the run set, skips math, where f(x) is right, and reports a space inside the parentheses only where a real space token became glue. A missing space is the noisier half, because word(s) is ordinary English, so those findings come as notes.
Code shown as text is not prose. Every prose rule skips text in math, in verbatim and in the typewriter family (\ttdefault, as \texttt and \url set), and this one a call too: a ( right after a name, around a list of single words or nothing, as in plot(x, y) or c(1, 2, 3). What an undefined command or environment leaves behind is unknown code as well, so every prose rule skips it: the command's arguments and the rest of its statement or line, an environment's body up to its \end.
Fix by moving the space to the other side of the parenthesis.
S013 default: warning style U chktex 32, 33, 34 since 0.2.0
quotation mark points the wrong way
A backtick opens a quotation and an apostrophe closes it (The TeXbook, chapter 2). A mark the other way round sets the wrong glyph, and `' sets an empty quotation.
satex reads the direction from the characters around the mark in the typeset text. An apostrophe inside a word, an elision such as '90s, and a prime in math are left alone, and `{}` counts as two marks because the group stops the ligature.
Fix by turning the mark the right way round.
See chktex 32, chktex 33, chktex 34, The TeXbook, chapter 2.
S061 default: warning style U since 0.2.4
sentence starts lowercase
In the languages of lints.sentence-capital.languages (by \languagename), a sentence starts with a capital. A finding needs ., ! or ?, a space, then a lowercase word. No sentence ends after a number, an ellipsis or an abbreviation: three letters or less (etc.), a period inside (e.g.), or listed in conventions.ties.abbreviations or lints.sentence-capital.exceptions (those go to sentence-spacing). A listed word (iPhone) or one with a capital inside may start a sentence.
Fix by writing the capital, or \Cref for a \cref.
S014 default: warning style U chktex 12, 13 since 0.2.0
wrong space after a period
How wide a space TeX sets follows the space factor of the character before it (tex.web § 1034). A period raises it to 3000, which asks for the wider space between sentences, but a period after an uppercase letter leaves it at 1000. Under \frenchspacing a period sets 1000 too, so nothing is reported.
So etc. and gets a sentence space and the ABC. Next a word space, both the wrong way round. The rule reads the characters the run set and reports only where a real space token became glue. A lowercase word counts as the sentence running on only when the source writes it right after the space, in the same line and group, unless the word before the period is a listed abbreviation.
Fix by writing etc.\ and, or the ABC\@. Next.
See chktex 12, chktex 13, tex.web § 1034.
S015 default: warning style U chktex 24, 42 since 0.2.0
line may break before a mark
\label records the page its own position falls on, and \index and \footnote mark the word they stand after (source2e, ltxref.dtx). A space in front of one is glue TeX may break the line at, so the mark can land on the next line.
The rule finds the label sites the run recorded, so a \label your own macro calls counts too, and reports the space only where the run turned it into glue.
Fix by deleting the space, so the command touches the word.
See chktex 24, chktex 42, source2e § ltxref.dtx.
S016 default: warning style S chktex 26 since 0.2.0
space before punctuation
Punctuation belongs against the word it follows. A space in front of a comma or a period is glue, and the reader sees it on the page.
The rule reports only a real space token that became glue in horizontal mode (tex.web § 1043). A thin space a language package inserts before : comes from that package's own code, which the run keeps out of the text, so French typography is not reported.
Fix by deleting the space.
See chktex 26, tex.web § 1043.
S017 default: warning style S U chktex 5, 28 since 0.2.0
stray italic correction
\/ appends a kern as wide as the italic correction of the last character on the current list (The TeXbook, chapter 4). The rule reports two places where that kern does not belong: a second \/ with nothing typeset in between, which finds a kern rather than a character (tex.web § 1113), and one in front of a period or a comma (chktex 28).
satex reads the characters the document set, so it sees through a closing brace: in \textit{word\/}. the next character set is the period.
Fix by deleting the \/.
See chktex 5, chktex 28, tex.web § 1113.
S018 default: warning style since 0.1.0
suppression names no rule
A satex-disable…/satex-enable magic comment named a code that satex lint --rules does not list, most often a typo. It suppresses nothing, since matching a finding's own code is all these comments do.
Fix by correcting the code, or removing it if the rule was renamed or never existed.
S019 default: warning style chktex 20, 44 since 0.2.0
matches a project pattern
chktex keeps two lists of its own in chktexrc: UserWarn, literal strings to report (warning 20), and UserWarnRegex, regular expressions (warning 44).
satex reads both from lints.user-pattern in satex.yaml, and both are empty by default. A regex is written as the regex crate reads it, and one that does not compile is skipped. A match inside a comment or a verbatim body is not reported.
Fix by writing what the project's own rule asks for, or by removing the pattern from satex.yaml.
S064 default: warning style U since 0.2.5
box wider than its lines
A box or rule set in a paragraph, such as an \includegraphics, a tabular or a tikzpicture, that is wider than the line width (\linewidth) cannot fit on any line: it sticks out into the margin however the paragraph breaks (tex.web § 889). The rule reports the call that set it, by how much it passes the line, where its width and the line width were known on every visit.
An \includegraphics whose width= is the reason gets the fix width=\linewidth, where every other key leaves that its final width (no height, scale, angle, bb or a key satex does not know, no comment). It changes the picture's size, so it is unsafe. Otherwise scale the material down (\resizebox, a smaller font), or let it stick out on purpose (\makebox[\linewidth]{…}), which TeX does not report.
See tex.web § 889, graphics § 4.4.
S020 default: warning style U chktex 8 since 0.2.0
wrong dash length
TeX's text fonts turn - into a hyphen, -- into an en-dash and --- into an em-dash (The TeXbook, chapter 2).
The rule reads the characters the document set, following chktex's counts: one or three hyphens between letters, two between digits, three between spaces. lints.wrong-dash in satex.yaml changes them and its except list names spellings to leave alone. A source scan misses that -{}- sets two hyphens, the group having broken the ligature, and that every - in math is a minus sign.
Fix by writing the run of hyphens the surrounding text calls for.
See chktex 8, The TeXbook, chapter 2.
S021 default: warning style U chktex 18, 19 since 0.2.0
wrong character used as a quote
TeX sets a quotation from two backticks and two apostrophes, which the font's ligature program pairs into the marks (The TeXbook, chapter 2).
What a straight " sets depends on the encoding, so the rule reads \encodingdefault: OT1 has a right double quote there, T1 and TU the typewriter one. ´ is an acute accent, not the apostrophe '. A prime in math is never reported, and the rule is silent outside an English \languagename.
Fix by opening with two backticks and closing with two apostrophes, or with \enquote{…} from csquotes.
See chktex 18, chktex 19, The TeXbook, chapter 2.
S022 default: warning style S chktex 4 since 0.2.0
useless italic correction
\/ appends a kern as wide as the italic correction the font gives the last character on the current list (tex.web § 1113). Where that correction is zero the \/ does nothing.
Every character carries the font it was set in (fntguide § 2), and satex reads the correction out of that font's TFM. That is a measurement, where chktex decides from a list of command names. In math, and after a space, the kern is zero whatever the font.
Fix by deleting the \/.
See chktex 4, tex.web § 1113, The TeXbook, chapter 4.
S059 default: info style U since 0.2.4
reference without a name
see \ref{sec:x} sets see 2: a number, not what it numbers.
A finding needs a \ref to a label of a named kind (a sectioning unit, a figure, anything with a \<counter>name or cleveref name) with no word, \S or section sign before it. Equations in parentheses, items, footnotes and the next \ref of a list never count.
The fix writes what the document uses: its own one-argument reference command (as last defined), else \cref (\Cref opening a sentence), else \autoref, else \<counter>name~\ref, else \S~\ref for a section.
See cleveref § 2, hyperref § 4.
S023 default: info style since 0.1.0
build runs BibTeX without a bibliography
The latexmkrc sets $bibtex_use, $bibtex or $biber, but the document names no bibliography database (\bibliography, \addbibresource), so the setting never takes effect (latexmk(1), $bibtex_use).
Fix by removing the setting.
S024 default: info style since 0.1.0
engine command lacks file:line or SyncTeX
-file-line-error makes the engine report file:line: message instead of ! message, which editors and satex's log reading can jump to. -synctex=1 writes the data that links the PDF back to the source.
Fix by adding them to the command, e.g. $pdflatex = 'pdflatex -file-line-error -synctex=1 %O %S';.
See pdftex § -file-line-error, luatex § -synctex.
S025 default: info style since 0.1.0
unused latexmk dependency
add_cus_dep(from, to, …) makes latexmk run a program when a file with the from extension is newer than the to file it produces (latexmk(1), "CUSTOM DEPENDENCIES"). The document writes no glossary or index, and no file with the from extension is in the project, so the rule never runs.
Fix by removing the rule, or keep it if another document of the project needs it.
See latexmk § CUSTOM DEPENDENCIES.
S053 default: info style U since 0.2.0
repeated block of source
Two figures that differ only in the width, the file, the caption and the label are one macro used twice. Copies drift apart when one is edited and the other is not.
The rule reads the document's own files token by token, as TeX reads them, with comments and spaces dropped. A run of letters and other characters is a value. Blocks that match up to their values are clones, and so are blocks that match after a few inserted or deleted tokens (lints.clones.similarity). The finding stands at the first block and names the other places. Its message lists each hole, the places where the blocks differ, with the values there.
A clone shares at least min_tokens tokens, and its values take at most max_value_share of it, so paragraphs and lists of items are no clones. Library code is never read. Two of the document's macros with the same body are reported too.
A clone is reported only when a macro saves text: the shared characters each further place drops must exceed parameter_cost (12) per argument at every call by min_saved (20). Two places of a short line with three values are no clone. Fifty characters with one short value are. A clone needing more than max_parameters (TeX allows 9) is not reported at all.
Fix by defining one macro with a parameter per hole and using it at every place. It is unsafe: the macro's name is a guess.
S026 default: info style chktex 22 since 0.2.0
TODO marker in a comment
chktex's warning 22 prints every comment it finds, which is noise in a document of any size.
This rule reports only the comments carrying a marker that says the note is unfinished work. The defaults are TODO, FIXME, XXX and HACK, matched as whole words and case-sensitively, and lints.comment-marker in satex.yaml sets its own list. A % inside a body the run read verbatim is a character, not a comment.
Fix by doing what the note asks and deleting it.
See chktex 22.
S027 default: info style pdftex U since 0.1.0
T1 text relies on cm-super
Computer Modern in T1 is the EC family, which TeX Live ships as scalable Type 1 fonts only through cm-super. Without it the PDF gets bitmap fonts that look blurred on screen. Latin Modern is the same design with T1 glyphs of its own.
The rule reads the encoding and the family of every character the document set, so it fires on the characters really set in T1 cmr.
Fix by loading \usepackage{lmodern}, or by making sure cm-super is installed.
See lmodern § Latin Modern, fntguide § 5.
S028 default: info style U chktex 18 since 0.2.0
hand-set quotes, csquotes not loaded
\enquote{…} sets the marks the current language wants, nests an inner quotation inside an outer one, and keeps one spelling for the whole document (csquotes §§ 3, 1).
The rule fires where the run set quotation marks itself and csquotes is not loaded. Apostrophes inside a word and primes in math do not count.
Fix by loading \usepackage{csquotes} and writing \enquote{…}.
See chktex 18, csquotes § 3.1.
S029 default: info style S U since 0.1.0
definition replaced before use
The name is defined, and defined again, with no use in between: the first replacement text never reaches the typesetter. Both definitions are made on every path, so this is not a conditional fallback. The first is no \providecommand, which yields to a later definition on purpose, and no empty declaration (\newcommand\x{} before a \def\x, \tl_new:N), and both are statements the file reads in order: a definition inside a macro body runs whenever the macro is called, so a default that a key handler or a later call overrides is left alone.
Fix by deleting the first definition, or by checking which one was meant.
S030 default: info style since 0.2.0
two names for one color
Two \definecolor-family calls, the later one the document's own, store the same model and components under different names. Not wrong, but one name likely means to be the other.
Silent unless the run could read both colors back exactly, and for a \colorlet given exactly another color's name: an alias, such as a role named after the color it takes.
See xcolor § 2.5.
S031 default: info style S since 0.1.0
package loaded twice
The second request is ignored by LaTeX. It costs nothing at run time but it hides which load carries the options. A request with options the first did not have is an option clash instead (option-clash).
Fix by deleting the later \usepackage.
S032 default: info style U since 0.2.0
hand-set number and unit
2ms sets the number and the unit as one word, so the line may break between them and the unit is italic in math. The SI brochure (9th ed., §§ 5, 4, 3) asks for a non-breaking space and an upright unit, and siunitx does both.
The rule reads what the run typeset: a digit run followed by letters with no space token between them, where the unit is an SI symbol and the document set it itself.
Fix by loading \usepackage{siunitx} and writing \qty{⟨number⟩}{⟨unit⟩}.
See SI brochure § 5.4.3, siunitx § \qty.
S052 default: info style U since 0.2.0
author name typed before a citation
In Knuth \cite{knuth84} the name is typed by hand. natbib's \citet and biblatex's \textcite print the author from the entry and the citation after it, so the two always agree.
A finding needs a citation of one key whose entry, in a database the run read, has that author's last name right before it. Knuth and Plass and Knuth et al. count, as does a citation in brackets, Knuth~[\cite{k}]. It needs natbib or biblatex too: without \textcite, \citet or \citeauthor, there is nothing better to write.
Fix by writing \textcite{knuth84}, \citet{knuth84} or \citeauthor{knuth84}~\cite{knuth84}. These shorten a long author list as the style says (biblatex's maxcitenames, natbib's .bst).
Plass et al. before a citation whose entry starts with another name, or has fewer than three authors, gets a hint without an edit: the name or the key may be the slip.
See biblatex § 3.9.1, The LaTeX Companion § 16.3.
S051 default: info style U since 0.2.0
number typed after a reference name
see Section 2 stays 2 when a section is added in front of it. \ref prints the number the label has in this run, so it never goes stale.
A finding needs a word that names a kind of thing the document labels (a counter's name, its \<counter>name text such as Figure, a cleveref name, or an abbreviation with a period such as Eq.), then a number or a letter typed in the source, as in Figure 2, Eq. (5) or Appendix A. The words come from the run, so babel's names count too. Text in math, verbatim or a comment is never read, and neither is a number \ref set.
Where one label of that kind prints that very number, the fix writes \cref (\Cref after a capital word), and loads cleveref when the document does not. cleveref then prints the word itself. Otherwise the finding asks for a label.
An \item of a numbered list counts too, labelled or not, in enumitem's inline lists as well: see item (b) or in step 2, where one item prints (b) or Step~2. Its words are the list counter's (enumi, its cleveref name item) and the word its label format writes (Step). The fix puts a \label right after that \item and refers to it. A number with no word before it, in 3.), is never read.
See The LaTeX Companion § 2.4, cleveref § 2.
S069 default: info style S since 0.2.6
field the style never reads of this type
A style reads a fixed set of fields per entry type: what the .bst's function for the type and the functions it calls name, or what biblatex's data model lists for the type. A field the style knows but does not read of this type is left out without a word: the booktitle of an @article, the journal of a @book. biber says Invalid field 'booktitle' for entrytype 'article' under --validate-datamodel. Often the entry has the wrong type.
With BibTeX a field under biblatex's name is not read either (journaltitle where the style reads journal). A field no part of the style knows (abstract, file, a reference manager's own) is a note to yourself and not reported.
Fix by deleting the field or by changing the type. The quick fix renames a field to the name the style reads.
See btxdoc § The entries, biblatex §2.1.
S033 default: info style since 0.2.0
different decimals in a column
1.5, 2.25 and 3 in one column claim three different precisions, and do not line up even at their decimal mark. Give them one precision. An S column of siunitx rounds them with round-mode = places, round-precision = ….
See siunitx § 4.6.
S068 default: info style U since 0.2.5
colors alike with color blindness
Two colors the document uses side by side look alike to readers with a color vision deficiency. Side by side means in one environment below the document, such as a figure or a TikZ picture, or as text colors in one paragraph. satex simulates protanopia, deuteranopia and tritanopia with the matrices of Machado, Oliveira and Fernandes (2009). It then measures the distance of the two colors in CIELAB. A pair that differs clearly for normal vision but comes closer than lints.indistinct-colors.below under a simulation is reported, with the deficiency named.
The fix suggests a color of the Okabe-Ito palette, which stays apart under all three. It rewrites the document's own \definecolor where there is one. Telling the meanings apart by more than color also helps: line styles, marks or labels.
See WCAG 2.2 § 1.4.1.
S057 default: info style U since 0.2.1
labelled items in an itemize
An itemize whose every \item[…] names its item in words is a description: that list sets each label in bold and hangs the text after it, where itemize squeezes a long label into the space of a bullet. A label counts as words with at least lints.itemize-described.letters (4) letters, set or not by a command, and no digit.
S056 default: info style S U since 0.2.1
numbered items in an itemize
\item[1.], \item[2.], … in an itemize count by hand what enumerate counts itself: an item added or moved leaves the numbers wrong, and \label cannot refer to them. The fix turns the list into an enumerate and drops the labels. Labels of another shape ((a), iii)) or a count that does not start at 1 keep their look with enumitem's label and start keys, and a count that goes on from the list before with its resume. A list of fewer items than lints.itemize-numbered.items (2) is left alone.
S034 default: info style chktex 40 since 0.2.0
punctuation on the wrong side of a formula
A formula is part of the sentence around it. Punctuation that ends the sentence goes after the closing delimiter of inline math, and inside a display, where it is set on the display's own line (The TeXbook, chapter 18).
The rule reads the mode, so it treats every display alike, whether it came from \[, from $$ or from an equation environment, where chktex follows only \] and $$.
Fix by moving the punctuation to the other side of the delimiter.
See chktex 40, The TeXbook, chapter 18.
S035 default: info style S chktex 45, 46 since 0.2.0
$$ instead of [
$$ … $$ is plain TeX's display. LaTeX spells it \[ … \], which obeys the fleqn and leqno class options and the class's \everydisplay (source2e, ltmath.dtx). Inline $ … $ sets the same as \( … \) and is left alone.
Both spellings put the run in the same mode. satex takes the first character set in math mode, lexes the source before it with TeX's own mouth, and reports the math shift characters standing there, so math an environment opened is left alone.
Fix by writing \[ … \].
See chktex 45, chktex 46, source2e § ltmath.dtx.
S036 default: info style pdftex, luatex U since 0.1.0
microtype not loaded
pdfTeX and LuaTeX writing PDF support character protrusion and font expansion (pdfTeX manual, \pdfprotrudechars and \pdfadjustspacing), which make margins look straighter and let paragraphs break with fewer hyphens and less uneven spacing. microtype turns both on (microtype manual § 1). The rule fires when both are still off at the end of the run and the body set about a page of text in justified paragraphs, so a figure, a standalone picture or ragged slides are left alone. XeTeX only protrudes, and DVI output supports neither, so the rule stays silent there.
Fix by loading \usepackage{microtype}.
See microtype § 1, pdftex § \pdfprotrudechars.
S037 default: info style since 0.2.0
numbers not aligned
A column of numbers is read by comparing them, which works when each digit stands under the digit of the same place: the units under the units, the decimal marks under each other. An l or c column sets numbers of different lengths ragged, and an r column lines up only numbers with as many decimals. siunitx's S column aligns them at the decimal mark (§§ 7, 12 of its manual). Its header, not a number, goes in braces: {Time}.
The rule reads the table's source: a column whose cells below the header are all numbers, three or more, set in a column that does not align them.
See siunitx § 7.12.
S038 default: info style pdftex U since 0.1.0
accents built with \accent in OT1
OT1, LaTeX's default text encoding, has no accented letters: it builds each one with the \accent primitive (ot1enc.def, fntguide § 5). TeX does not hyphenate a word holding an \accent (The TeXbook, appendix H), and the PDF's text layer holds an accent and a letter instead of the character.
Every character carries the encoding it was set in, so a document whose default is T1 but which sets one stretch in OT1 is reported for that stretch alone.
Fix by loading \usepackage[T1]{fontenc}.
See source2e § ot1enc.def, fntguide § 5, The TeXbook, appendix H.
S058 default: info style U since 0.2.1
package has a successor
Some packages have a successor with the same commands and more. For example, wrapfig2 continues wrapfig. The rule names the successor and what changes. Its fix loads the successor instead. It stays quiet where the switch would break something: when another package also loads the old one (wrapfig2 refuses to load next to wrapfig), when the successor is loaded already, or when it is not installed.
The pairs are data, not code: lints.package-successor.successors lists each package, its successor and what changes, and a project adds its own or clears the list.
S039 default: info style U since 0.2.0
hand-written name before a reference
In Section~\ref{sec:x} the word Section is typed by hand. If the section becomes an appendix, the word is wrong. cleveref's \cref and \Cref print the word from the label's counter.
A finding needs a word, or an abbreviation with a period, right before a \ref. The word must name the kind of the label: its counter, the counter's \<counter>name or a \crefname text, singular, plural or a prefix. So see~\ref{x} gives no finding, and neither do a label the run never found, \eqref, \pageref and (\ref{x}). Sections~\ref{a} and~\ref{b} is one finding.
With cleveref loaded, a finding needs cleveref to print the same word (Sec. gives none where it prints Section), and the fix writes \Cref{sec:x}, or \cref after a lowercase word. Without cleveref, the fix also loads it after the last \usepackage of the preamble.
Fix by writing \Cref{sec:x} and loading cleveref.
See cleveref § 2.
S040 default: info style U chktex 41 since 0.1.0
plain TeX primitive in LaTeX
chktex warning 41 (You ought to not use primitive TeX in LaTeX code) flags the primitives in chktexrc's Primitives list. satex reports one only where the name still means the primitive, and names the LaTeX command for the same job.
For \csname the job is the one the run saw the name formed for (defined, aliased, tested or used), and the suggestion is etoolbox's command for it when the document has it.
Fix by using LaTeX's interface for the same job.
See chktex 41, l2tabu § 1.
S041 default: info style U chktex 23 since 0.2.0
quotes run together
Three backticks in a row set a left double quote followed by a left single quote, glued together (The TeXbook, chapter 2). The reader cannot tell which quotation is the outer one.
satex counts only marks TeX really joined, so a group between two of them already keeps them apart and the rule says nothing.
Fix by putting a thin space \, between the double mark and the single one, with the double mark on the outside.
See chktex 23, The TeXbook, chapter 2.
S042 default: info style U chktex 38 since 0.2.0
punctuation inside the quote
Under the logical convention the closing mark comes directly after the quoted words, and punctuation that belongs to the sentence stands outside it. A full stop written before the closing mark puts it inside the quotation, which claims the stop was part of what was quoted. American practice is the other way round, which is why chktex has this check off by default and satex reports it as a suggestion.
Fix by moving the punctuation after the closing mark.
See chktex 38.
S066 default: info style S since 0.2.5
package loaded already
The class or an earlier package loads this package already, with the options the document asks for. LaTeX ignores the second request. The document's own request twice is duplicate-package, and one with new options is option-clash.
Fix by deleting the request. Keep it if the document should still work with another class that does not load the package.
S070 default: info style U since 0.2.6
word typed out that a command of the document sets
A name the document keeps in one place, \newcommand\model{TinyNet} or a glossary entry name={cellR}, should be written through it everywhere. A copy typed out by hand stays behind when the name changes, and a glossary misses the use.
The rule reads the characters the run set. A word whose characters come from the replacement text of one of the document's own macros is that macro's word, when the macro sets that one word and nothing else. The same word typed in the document's prose is reported, once per place. "The same" is a level of the one equivalence ladder every comparison of text uses (lints.spelled-out-macro.equivalence): exact, glyphs (the default: a ligature is its letters, any spaces one space), case or letters. Words shorter than min-length (3) are left alone.
Fix by writing the command there: \model{} or \gls{cellr}. It is unsafe: the command may set more than its word in another context.
S043 default: info style S since 0.1.0
space from a line end in a macro
Inside a macro's replacement text, TeX turns the end of a line into a space token unless a control word already skipped it or a % swallowed the rest of the line (tex.web § 347).
The finding follows the modes the run read that space in (§ 1043: a space is glue only in horizontal mode). It says the macro inserts a space where every reading was horizontal, and that it may where some might have been. Only a space that a character, box or rule follows in its list is reported. The glue that ends a paragraph goes (§ 816), and glue before it only widens the end of the last line. One an \unskip takes is gone too (§ 1105), as at \end{center}.
Fix by writing % at the end of that line.
See tex.web § 347, tex.web § 816, tex.web § 1043.
S044 default: info style since 0.2.0
vertical rules or hline in a table
booktabs gives a table three rules of different weights, \toprule, \midrule and \bottomrule, with space around them, and asks for no vertical rules at all (§ 2 of its manual): the columns are separated by their space, and \hline sets every rule alike and too close to the text. A table of fewer rows than lints.table-rules.rows (3) is left alone.
See booktabs § 2.
S065 default: info style since 0.2.5
formulas without MathML
The tagging code attaches MathML to each formula. It reads it from <jobname>-mathml.html or <jobname>-luamml-mathml.html. Under LuaLaTeX luamml writes the second one, but only when unicode-math is loaded (latex-lab warns unicode-math-missing otherwise). pdfLaTeX cannot write either. The rule fires when the run looked for these files, found none, and wrote none. The formulas are then tagged with their LaTeX source as alternative text, which PDF/UA-2 accepts less well than MathML.
Fix by compiling with LuaLaTeX and loading unicode-math, or by making the MathML file once with such a run.
See latex-lab § latex-lab-math.
S055 default: info style U since 0.2.0
database entry never cited
An entry no \cite names is left out of the bibliography. That is what a shared database is for, so this is only a note. \nocite{*} cites everything.
Fix by citing the entry, or by deleting it.
S045 default: info style since 0.2.0
unit repeated in every cell
A unit repeated in every cell of a column says the same thing on each line and pushes the numbers out of alignment. The SI brochure (9th ed., §§ 5, 4, 1) heads such a column with the quantity and its unit, as Time / ms. With siunitx, {Time / \unit{ms}} over an S column of bare numbers.
See SI brochure § 5.4.1, siunitx § \unit.
S046 default: info style U since 0.2.0
numbered display never referenced
\begin{equation} and its relatives step a counter and print a number beside the display. The starred forms set the same mathematics and spend no number.
satex decides numbered by running the document: \refstepcounter redefines \@currentlabel (clsguide § counters), so an environment whose body redefined it stepped a counter. \@captype and \@listctr say the number went to something inside, and amsmath's \notag, \nonumber and \tag say the display governs itself.
Fix by writing the starred environment and dropping the label that nothing reads.
See amsmath § 3.1, clsguide § counters.
S047 default: info style since 0.1.0
bibitem never cited
A thebibliography written by hand lists what it lists, cited or not. A database only contributes what is cited, so its entries are not reported. \nocite{*} cites everything.
Fix by citing the entry, or by deleting it.
S048 default: info style since 0.2.0
color never used
The document names a color with \definecolor, \providecolor or \colorlet and never reads it back through \color, \textcolor or a \colorlet source.
Silent for a color a package defines: a library may define more colors than any one document uses. So is a name with @, which code built and no document text wrote, and xcolor's . for the current color.
See xcolor § 2.5.
S049 default: info style U since 0.1.0
macro never used
Nothing expands this name. A name some other definition of it gives a meaning that is read is used: a default a later call overrides is no unused name, and dead-definition covers a definition replaced before any use.
Fix by deleting it, or by checking why nothing calls it yet.
S050 default: info style U since 0.1.0
label never referenced
Fix by deleting the \label, or by checking the \ref that was meant to use it.
P001 default: error performance U since 0.1.0
package loaded after the preamble
\usepackage belongs in the preamble. After \begin{document} LaTeX stops with Can be used only in preamble and the package cannot set anything up.
Fix by moving the load into the preamble.
P002 default: info performance U since 0.2.0
parts built whole
\includeonly names the parts a build reads. The others keep their page numbers and labels from their .aux files (source2e, ltfiles.dtx). A draft build of one chapter then skips the rest. The rule fires when the document \includes at least two parts, no \includeonly is in force, and the body is most of what the build interprets. It also has to set a book's worth of paragraph text, lints.build-cost.characters in satex.yaml: a shorter document builds whole in seconds.
Fix by listing the parts being written in \includeonly while drafting.
P003 default: info performance U since 0.1.0
slow preamble
The packages the document asks for and the files read before \begin{document}, reported when the preamble takes most of the tokens the build interprets and is no small one.
A format holds the preamble already interpreted, so a build that starts from one skips all of it. mylatexformat dumps one from the document's own preamble, and TeX reads a %&(format) line before anything else (web2c manual, "Format files").
Fix by dumping the preamble into a format and starting every build from it.
See The LaTeX Companion § formats.
P004 default: info performance since 0.1.0
recursive macro
Recursion is normal in TeX, but an unguarded one loops until TeX runs out of memory, and the analysis has to widen at it. Everything the recursion would have defined becomes unknown.
Fix, if the recursion is unintended, by breaking the cycle. Otherwise make sure a conditional terminates it.
P005 default: info performance U since 0.1.0
unused entry in the dependency file
Every installation made from the dependency file carries the package, but the run reads nothing from it. It may still be needed for what satex does not read (fonts, hyphenation patterns, Lua libraries, programs), so this is a hint, not a verdict.
Fix, if the package really is unused, by deleting its line.
P006 default: info performance U since 0.1.0
unused package
Every name the package defines is unused, and no code outside it reads a setting it made (a class's \textheight is read for every page). It may still act through hooks or fonts, so this is a hint, not a verdict.
Fix, if the package really is unused, by deleting the \usepackage: it is read on every build.
A003 default: error precision since 0.2.1
document not fully read
A file the document's own \input, \include or \subfile names exists but the run never read it, or a scan read on past the document's end. Every finding about what that part defines, typesets or references is then missing, and findings that something is never defined or never used may be wrong.
There is nothing to fix in the document: this is a gap of the analysis. Report it. Raising the limits in satex.yaml may close it.
A001 default: info precision since 0.1.0
analysis had to widen
Undecided conditionals are analyzed arm by arm, so they are not reported here. This rule reports the two places where the analysis is incomplete instead: a recursion that was widened, and a budget that was reached. Findings that depend on such a point may be incomplete.
There is nothing to fix in the document. Raising the limits in satex.yaml or narrowing the analysis with load.packages: false can reduce it.
A002 default: info precision since 0.2.0
assertion not decided
The condition of %\satex@assert is neither true on every path nor false on an exact one: a value it reads is not known, a path approximated, or no path reads the assertion. %\satex@assume can narrow what it reads.
See Assertions.
