0

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{submitTest\,()}, I believe from chktex.

Is it possible to prevent this message for textes take place in \textit{}?


Example code piece:

\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage[table]{xcolor}

\begin{document} \textit{testJob()} \end{document}


$ chktex --version
ChkTeX v1.7.6 - Copyright 1995-96 Jens T. Berger Thielemann.
Compiled with POSIX extended regex support.
$ chktex base.tex
ChkTeX v1.7.6 - Copyright 1995-96 Jens T. Berger Thielemann.
Compiled with POSIX extended regex support.
Warning 36 in base.tex line 5: You should put a space in front of parenthesis.
\textit{testJob()}
               ^
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.
alper
  • 1,389
  • 1
    Please provide an MWE that generates the warning message you've encountered. BTW, what is chktex? – Mico Apr 24 '22 at 12:46
  • @Mico I have added example code piece it applies for all \textit{nounNoun()} pattern – alper Apr 24 '22 at 12:49
  • I am not able to generate a You should put a space in front of parenthesis. warning message when I run your MWE. – Mico Apr 24 '22 at 12:56
  • I was able to get that message using chktex in linux please see my updated question – alper Apr 24 '22 at 12:59
  • Thanks for explaining that chktex is an external Unix utility. (I thought it was a LaTeX package...) The chktex utility is availabe on MacOS as well. Anyway, I can see no merit whatsever in this warning message, unless one somehow believes that ( must always be preceded by whitespace. Since it looks like the lack of whitespace before () in your document is deliberate, you should certainly feel free to disregard the warning message. – Mico Apr 24 '22 at 13:16
  • 2
    I would simply not use chktex but you can pass it the -n36 option so it omits check 36 (the number given in the message you showed). This message is not from TeX and does not relate to TeX processing in any way, it's simply a bad attempt to check English Grammar. – David Carlisle Apr 24 '22 at 13:27
  • @DavidCarlisle Thanks, its best for me to disable chktex within emacs , since it keeps highlights text that has chktex warning, and its a lot of these all over. Also which Grammer do you advice to look for? – alper Apr 24 '22 at 13:30
  • I was able to completely disable chktex inside emacs using (setq flycheck-disabled-checkers '(tex-chktex)) – alper Apr 24 '22 at 13:39
  • 2
    Although I'm not familiar with this message (and don't use chktex, I assume it's intended to point out that t is a "tall" letter, and in italic, it's likely to bash into the opening parenthesis, or at least be too close. Instead of inserting a space, I'd add an italic correction \/. which is designed to overcome such problems. Actually, in your case, the parentheses are going to be italic also, so it isn't really a problem. (A "theorem font" might have upright parentheses with italic text, to coordinate with embedded math; there it would matter.) – barbara beeton Apr 24 '22 at 14:23
  • @barbarabeeton, It is intended to warn of accidentally forgetting to space around parentheses in prose. At least in formal English there are no cases (that I can think of) where this is valid. In math and computer languages (as in this case) it's obviously perfectly fine. As David Carlisle says, it's a simplistic attempt to check English grammar. – Ivan Andrus Apr 25 '22 at 16:20
  • My impression is that you're specifying function names: does they appear in math mode? Do you really want slanted parentheses? – egreg Apr 25 '22 at 16:59
  • @egreg In my journal paper I was referring them as : the \textit{function_name()} function in order to indicate a function I defined in Python. I see similiar approach with slanted parentheses in https://man7.org/tlpi/download/TLPI-52-POSIX_Message_Queues.pdf , second page. I am not sure is it write way to do it – alper Apr 25 '22 at 17:27
  • @alper -- I do understand the reasoning behind the check, and the difference between prose and code. But egreg has gone directly to the point I was trying to make -- do you really want slanted parentheses? That may be a style question for the particular journal (the AMS would probably prefer upright parens, and that is the context of my experience). And if the parens are upright, then an italic correction is in order. – barbara beeton Apr 25 '22 at 18:53
  • slanted parentheses stands for \textit{()} right, as italic parantheses? So I can go for \textit{func_name}\textup(\textup) , where upright parens will show up right? – alper Apr 25 '22 at 19:05
  • @DavidCarlisle sorry for the late comment but I just found out that this warning is coming from lacheck, (as tex-lacheck in Emacs). – alper Oct 24 '22 at 11:06

1 Answers1

1

I'll point you to my answer to a similar question for several ways to suppress this warning. The only difference is that instead of editing the NumDash section, you could add \textit to WipeArg (to ignore all warnings inside \textit. If you were to do that though, I would suggest creating a semantic macro, like \code and adding that instead. (I would suggest that anyway since I believe in semantic markup.) There are many reasons to use \textit and only some of them would want to ignore errors.

But if turning it off in Emacs is what you wanted then great! Though I'm curious how it got turned on without you knowing.

Ivan Andrus
  • 2,042