17

I use chktex to check my bachelor's thesis for mistakes. I get a lot of warnings and I would like to get rid of them. For example, I have a line

\large{\iflanguage{english}{Duration}{Bearbeitungszeit}: \timestart{} -- \timeend{}}

which gives

Warning 8 in titlepage.tex line 75: Wrong length of dash may have been used.
\large{\iflanguage{english}{Duration}{Bearbeitungszeit}: \timestart{} -- \timeend{}}   
                                                                      ^^

I would like to tell chktex that I manually checked this line and that it is ok (and should not throw warnings).

For example, I would like to use something like

% chktex: manually checked
\large{\iflanguage{english}{Duration}{Bearbeitungszeit}: \timestart{} -- \timeend{}}

Does chktex have such a feature?

3
  • shouldn't it be warning that \large doesn't take an argument?:-) Commented Oct 22, 2014 at 8:13
  • @DavidCarlisle: This is the template I got from my institute. The cited line is from the title page. It looks good and it works, so I don't want to touch it. What would be the correct way to write it? \large within the {...}? Commented Oct 22, 2014 at 11:24
  • well as written the outer {} are doing nothing and \large applies to the rest of the document (or current group). That may or may not be OK depending if there is any following text or if it should be large, mainly I'm just surprised that anything claiming to be a latex syntax checker didn't pick that up, not saying you need to change the document Commented Oct 22, 2014 at 11:35

1 Answer 1

16

I'd never heard of chktex but texdoc chktex says

6.1.4 Per Line and File Suppressions

There are many cases in which ChkTEX will give a warning about a construct which, although it usually indicates a mistake, is intentional. In these cases it can be extremely annoying to have this message appear everytime ChkTEX is run. For this reason you can use LaTeX comments to suppress a certain message on a single line. This can be done by adding a (case-insensitive) comment at the end of the line of the form

                            % checktex ##

turns out the documentation isn't totally accurate

man chktex

reveals it should be chktex not checktex and I can confirm this works:

\large{\iflanguage{english}{Duration}{Bearbeitungszeit}: \timestart{} -- \timeend{}}% chktex 8 

But of course it should have told you to do

{\large\iflanguage{english}{Duration}{Bearbeitungszeit}: \timestart{} -- \timeend{}}% chktex 8 
3

You must log in to answer this question.

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