0

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:

ChkTeX v1.7.6 - Copyright 1995-96 Jens T. Berger Thielemann.
Compiled with PCRE regex support.
Warning 1 in test.tex line 3: Command terminated with space.
The quick {\itshape brown fox\/} jumps over the {\bfseries lazy dog}.
                   ^
No errors printed; One warning printed; No user suppressed warnings; No line suppressed warnings.
See the manual for how to suppress some or all of these warnings/errors.

I know what ChkTeX means and I can remove/suppress this warning by

  • inserting {} just after \itshape (though it inserts an extra space),
  • per line suppression, % chktex 1, or
  • adding \itshape in the Silent section of the custom chktexrc file.

But my question is why \itshape is not listed in Silent of the default chktexrc, while \bfseries and \slshape etc. are there.

Is there some typesetting reason to separate \itshape from other commands like \bfseries and \slshape? Or is it just missing in the default chktexrc, which is an issue that should be fixed in the ChkTeX repository?

1
  • 3
    this has come up before, it is mis-reporting by chktex so you should configure that rather than distort your document. I would guess it has a general rule to warn about spaces after command names (a very dubious choice as that warning will be wrong more often than not) then special cases certain commands such as \bfseries not to warn, so adding \itshape to the silent section sounds like a good plan. Dec 22, 2021 at 8:12

1 Answer 1

3

Full disclosure: I am the current maintainer of ChkTeX.

I don't know of any reason for \itshape not to be in Silent, but it was written a long time ago (several maintainers ago) and I have not done a good job of keeping it up to date. Frankly, like @david-carlisle, I don't find that particular warning that helpful and so I have turned off. That means I don't find any of these false positives and so I don't add them to the default chktexrc. It's sort of a self-perpetuating cycle.

I think you should do or more of the following:

  1. Turn off the warning if you don't find it helpful in general.
  2. Add \itshape to Silent in your local chktexrc.
  3. Open a bug report.
    • Unfortunately, I haven't given ChkTeX the time it needs lately and so I have several bugs to get through at the moment.
    • Though I did just add this since it's so simple. :)
  4. Add line or file suppressions if it's an exception to the rule and/or you just can't be bothered to do anything else.
5
  • thanks for stopping by:-) Dec 22, 2021 at 23:54
  • Thanks! For now, I add \itshape to Silent with no worries thanks to your recommendation.
    – tueda
    Dec 23, 2021 at 2:54
  • Commands that should not be terminated by a space are very rare: those that only produce a fixed text, such as \LaTeX or author-defined shorthands. Flagging commands that are not followed by a space, but with a long list of exceptions, doesn't seem the best strategy.
    – egreg
    Dec 23, 2021 at 7:26
  • Personally, I often make commands that should not be terminated by a space (proper names, project names, programs etc. with style changes and also shorthands), so they are not rare compared with commands that (1) don't care about following spaces and (2) are warned by ChkTeX (not inside math, taking no arguments and not listed as exceptions). I can check, of course, whether they are properly typeset with my eyes, but no warnings with linter checks give me relief.
    – tueda
    Dec 23, 2021 at 16:22
  • @tueda, it's good to know that someone finds this warning useful. It's hard for me to know. :) Dec 24, 2021 at 0:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .