Questions tagged [chktex]
The chktex tag has no usage guidance.
30
questions
0
votes
0
answers
64
views
chktex: who knows about return code
I realized right now that chktex has return code 0 only if not even a warning is displayed.
With warnings seems to be 2.
What about other return codes? 1 for instance?
The documentation keeps this ...
0
votes
0
answers
34
views
chktex: how to add an output format with newline
I am using chktex to check my latex files.
Now I want to define my own output format instead of choosing from given ones
with -v<number>.
This is via the option -f.
The problem is, that I cannot ...
2
votes
2
answers
4k
views
ChkTeX does not handle lines over 509 bytes correctly
When longer paragraphs have no line breaks in the middle, I get the warning:
chktex: WARNING -- ChkTeX does not handle lines over 509 bytes correctly. Some errors and line numbers may be wrong in this ...
0
votes
1
answer
446
views
How can I prevent `You should put a space in front of parenthesis. ` message for text in textit
For following text \textit{submitTest()} I am getting a warning message which is:
You should put a space in front of parenthesis. [36]
This warning message is suppress when I replace it into: \textit{...
6
votes
3
answers
3k
views
ChkTeX: Wrong length of dash may have been used
For the string: 100K100-873 I am getting the following warning message in my emacs editor from ChkTeX check:
Wrong length of dash may have been used. [8]
How can I prevent this warning message?
Could ...
0
votes
1
answer
589
views
Why does ChkTeX complain when there is a space after \itshape but not when \bfseries is used?
If I use ChkTeX for the following LaTeX source:
\documentclass{article}
\begin{document}
The quick {\itshape brown fox\/} jumps over the {\bfseries lazy dog}.
\end{document}
then I get a warning:
...
0
votes
1
answer
117
views
Function `\endhead` and `\endfirst` head gets warning for `command terminated with space` in longtable by chktex
This is the code where I got the warning message. However, when I put {} to the command such as \endhead{}, the warning goes away. However I get errors for misplaced noalign.
\begin{center}
\begin{...
1
vote
1
answer
1k
views
Vertical rules in tables are ugly. ChkTex
When I run ChkTeX on
\begin{table}
\centering
\begin{tabular}{c|c|}
\tejastable{\kket{2}}{kket{2}} % \tejastable{\}{} % no need of \\
\tejastable{2}{3} % automatically goes to ...
1
vote
0
answers
176
views
Suppress chktex warning about custom capitalized command
Sometimes I define capitalized commands, e.g., \USA. Using this command at the end of a sentence produces a ChkTeX warning about using intersentence spacing. How can I suppress this warning uniformly ...
0
votes
1
answer
2k
views
Is there a way to disable ChkTex in a specific directory?
I use ChkTex inside VSCode with the Latex-Workshop Extension. I have never used ChkTex before.
Is there a way of setting ChkTex up to ignore a certain file or directory?
I know there is a .chktexrc ...
2
votes
0
answers
168
views
ChkTeX fails with nested math mode
MWE:
\begin{align}
\begin{array} {l}
abc
\end{array} \\
3 - 2 = 1
\pi
\end{align}
ChkTeX detects "Wrong length of dash" in 3 - 2 = 1 and "Command terminated ...
0
votes
1
answer
217
views
Silencing chktex NumDash warnings only within certain commands
I use numbers with hyphens in them with certain commands. For example:
\newcommand*{\orcid}[1]{\href{https://orcid.org/#1}{#1}}
If I use \orcid{0000-0002-1825-0097} on a line, chktex will warn me ...
1
vote
2
answers
2k
views
Non-breaking space (`~') should have been used in table
I am making a table with \ref{key} as only content in the first column. I am dynamically referring to item numbers in an \enumerate{}. CHKTeX gives me the warning Non-breaking space (`~') should have ...
5
votes
2
answers
2k
views
Avoid "command terminated with space" warning in \newcommand used in math mode
Consider a command definition
Warning 1 in test.tex line 2: Command terminated with space.
\newcommand{\ket}[1]{\left \lvert #1 \right \rangle}
^
This command is ...
5
votes
1
answer
2k
views
How to use chktexrc to control warnings on dashes?
I am trying to configure chktex with a local .chktexrc. Per the chktex manual:
You should also take a look at the “chktexrc” file. As it is self-documenting, you
should be able to get the meaning ...
1
vote
1
answer
1k
views
How to integrate chktex into TexStudio
How can I integrate the chktex linting and format checking script into TexStudio?
I would like to run chktex automatically on every build and see the output in the messages window.
1
vote
2
answers
2k
views
chktex warning: You ought to not use primitive TeX in LaTeX code
What is the meaning of the following chktex warning in this example?
41: You ought to not use primitive TeX in LaTeX code.
\documentclass{article}
\usepackage{amsmath}
\begin{document} ...
6
votes
1
answer
2k
views
\[ChkTeX\] 21: This command might not be intended. [21]
My document contains several math definitions similar to this:
some text \(\Gamma\) and the sentence continues
when I run chktex, I get a lot of warnings:
[ChkTeX] 21: This command might not be ...
6
votes
2
answers
5k
views
Automatically fixing chktex "Use \( ... \) instead of $ ... $"
I have a few documents that result in a lot of warnings because I've been using $...$ instead of \(...\) and a few other tiny details.
How can I automatically fix these chktex warnings? vscode ...
3
votes
1
answer
1k
views
Chktex complains about "no italic correction found", how to fix this?
I use the following code for custom theorems, as I like slanted text in thereoms better than italicized, using amsthm.
\newtheoremstyle{thm-sl}
{}{}
{\slshape} % slanted text instead of italicized
{}...
0
votes
1
answer
673
views
How to ignore shellcheck when using minted in sublime?
I want to ignore shellcheck when writing a LaTeX document while using minted package. I know, when using shellcheck I can easily ignore warnings or errors globally by placing a line right at the ...
8
votes
2
answers
2k
views
What is the chktex approved way of writing open intervals?
I am a big fan of the LaTeX linters lacheck and chktex. But in writing my document, I have come across an annoying warning from chktex which shouldn't be one. Consider the following minimal example ...
35
votes
1
answer
13k
views
Why does chktex lint "command terminated with space"?
Why does chktex lint "command terminated with space"?
Applying {} to the command will disable the lint, but this is tedious to do for all commands.
3
votes
1
answer
277
views
Using \crefformat with cleveref causes spurious chktex warnings
Cleveref has a useful feature in \crefformat where an equation can be referred to, for instance, an inequality. This adds an extra square-bracket argument to the \label command. For example:
\...
9
votes
1
answer
2k
views
No space with after parenthesis, but needed
While running chktex, I get this error
Warning 36 in file.tex line 2062: You should put a space after parenthesis.
pen(s)
I am writing the word pen but I am adding an s in parentheses as an option ...
34
votes
2
answers
6k
views
When is leading/opening whitespace of a line in a tex file important?
According to https://en.wikibooks.org/wiki/LaTeX/Basics#Spaces
... opening space is generally ignored.
First of all, I don't know what generally refers to.
I came across this using chktex a ...
3
votes
1
answer
535
views
Should I remove spaces at the beginning of a line containing only a footnote?
I've just stumbled upon chktex, the LaTeX lint. While using it, I've noticed that it keeps giving warnings about needing to remove spaces at the beginning of lines containing only \footnote{Some ...
7
votes
2
answers
2k
views
How to supress chktex errors in minted environment?
Is there a way to make chktex play nice with the minted package? Right now, it seems to assume that normal checks apply to the content of the minted environments and produces a lot of warnings.
3
votes
1
answer
2k
views
chktex disable warning about ~ for certain macros when using cleveref with varioref
Is there any way, other than adding per-line suppressions (i.e., %chktex 2) or per warning suppressions to get chktex to stop warning me when \vref and \eqref are preceded by spaces?
I am running ...
9
votes
1
answer
2k
views
Is there a way to make ChkTeX ignore TikZ code
ChkTeX does not like TikZ, and will report a bunch of errors. Is there a way to make ChkTex ignore TikZ code?