summaryrefslogtreecommitdiff
path: root/Build/source/texk/chktex
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2022-12-15 11:48:56 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2022-12-15 11:48:56 +0000
commit080967aa15a16e8712c9efd3a50fff831361b1fb (patch)
tree67faf21649cd6117d7826cbc34f186b7d41b3e13 /Build/source/texk/chktex
parente6632027a9fe1ee07fa80da2ff684bfbe6726d74 (diff)
chktex-1.7.8
git-svn-id: svn://tug.org/texlive/trunk@65275 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/chktex')
-rw-r--r--Build/source/texk/chktex/ChangeLog5
-rw-r--r--Build/source/texk/chktex/ChkTeX.pdfbin355998 -> 409006 bytes
-rw-r--r--Build/source/texk/chktex/ChkTeX.tex1842
-rw-r--r--Build/source/texk/chktex/Makefile.am4
-rw-r--r--Build/source/texk/chktex/Makefile.in2
-rw-r--r--Build/source/texk/chktex/TLpatches/ChangeLog5
-rw-r--r--Build/source/texk/chktex/TLpatches/TL-Changes11
-rw-r--r--Build/source/texk/chktex/TLpatches/patch-04-finderrs19
-rw-r--r--Build/source/texk/chktex/chktex-src/ChkTeX.c91
-rw-r--r--Build/source/texk/chktex/chktex-src/ChkTeX.h24
-rw-r--r--Build/source/texk/chktex/chktex-src/ChkTeX.tex.in127
-rw-r--r--Build/source/texk/chktex/chktex-src/FindErrs.c317
-rw-r--r--Build/source/texk/chktex/chktex-src/FindErrs.h12
-rwxr-xr-xBuild/source/texk/chktex/chktex-src/MakeChkTeXRC.pl71
-rw-r--r--Build/source/texk/chktex/chktex-src/Makefile.in32
-rw-r--r--Build/source/texk/chktex/chktex-src/NEWS42
-rw-r--r--Build/source/texk/chktex/chktex-src/OpSys.c88
-rw-r--r--Build/source/texk/chktex/chktex-src/OpSys.h34
-rw-r--r--Build/source/texk/chktex/chktex-src/Resource.c263
-rw-r--r--Build/source/texk/chktex/chktex-src/Resource.h6
-rw-r--r--Build/source/texk/chktex/chktex-src/Test.nore.out108
-rw-r--r--Build/source/texk/chktex/chktex-src/Test.pcre.out111
-rw-r--r--Build/source/texk/chktex/chktex-src/Test.posix-ere.out93
-rw-r--r--Build/source/texk/chktex/chktex-src/Test.tex81
-rw-r--r--Build/source/texk/chktex/chktex-src/Utility.c53
-rw-r--r--Build/source/texk/chktex/chktex-src/Utility.h8
-rw-r--r--Build/source/texk/chktex/chktex-src/chktexrc802
-rw-r--r--Build/source/texk/chktex/chktex-src/chktexrc.in989
-rw-r--r--Build/source/texk/chktex/chktex-src/configure.ac (renamed from Build/source/texk/chktex/chktex-src/configure.in)10
-rw-r--r--Build/source/texk/chktex/chktex-src/input/file8
-rw-r--r--Build/source/texk/chktex/chktex-src/m4/ax_cflags_strict_prototypes.m4170
-rw-r--r--Build/source/texk/chktex/chktex-src/m4/vl_prog_cc_warnings.m4111
-rw-r--r--Build/source/texk/chktex/chktex-src/tests/main.expected27
-rw-r--r--Build/source/texk/chktex/chktex-src/tests/main.tex14
-rwxr-xr-xBuild/source/texk/chktex/chktex-src/tests/run-tests.sh137
-rw-r--r--Build/source/texk/chktex/chktex-src/tests/sub1/file.tex8
-rw-r--r--Build/source/texk/chktex/chktex-src/tests/sub1/subsub/subsubfile.tex2
-rw-r--r--Build/source/texk/chktex/chktex-src/tests/sub2/file1.tex7
-rw-r--r--Build/source/texk/chktex/chktex-src/tests/sub2/file2.tex2
-rwxr-xr-xBuild/source/texk/chktex/chktex.test4
-rw-r--r--Build/source/texk/chktex/chktexrc794
-rwxr-xr-xBuild/source/texk/chktex/configure22
-rw-r--r--Build/source/texk/chktex/version.ac3
43 files changed, 3293 insertions, 3266 deletions
diff --git a/Build/source/texk/chktex/ChangeLog b/Build/source/texk/chktex/ChangeLog
index 2424c024905..696c2e7d46e 100644
--- a/Build/source/texk/chktex/ChangeLog
+++ b/Build/source/texk/chktex/ChangeLog
@@ -1,3 +1,8 @@
+2022-12-15 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * Import ChkTeX 1.7.8.
+ * Makefile.am, chktex.test, version.ac: adapted.
+
2021-07-13 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
* regex/regexec.c: Avoid MSVC compiler error.
diff --git a/Build/source/texk/chktex/ChkTeX.pdf b/Build/source/texk/chktex/ChkTeX.pdf
index 443bb4f722c..43d9b55485e 100644
--- a/Build/source/texk/chktex/ChkTeX.pdf
+++ b/Build/source/texk/chktex/ChkTeX.pdf
Binary files differ
diff --git a/Build/source/texk/chktex/ChkTeX.tex b/Build/source/texk/chktex/ChkTeX.tex
deleted file mode 100644
index 4af94f9fca8..00000000000
--- a/Build/source/texk/chktex/ChkTeX.tex
+++ /dev/null
@@ -1,1842 +0,0 @@
-%%
-%% ChkTeX v1.7.6, LaTeX documentation for ChkTeX program.
-%% Copyright (C) 1995-96 Jens T. Berger Thielemann
-%%
-%% This program is free software; you can redistribute it and/or modify
-%% it under the terms of the GNU General Public License as published by
-%% the Free Software Foundation; either version 2 of the License, or
-%% (at your option) any later version.
-%%
-%% This program is distributed in the hope that it will be useful,
-%% but WITHOUT ANY WARRANTY; without even the implied warranty of
-%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-%% GNU General Public License for more details.
-%%
-%% You should have received a copy of the GNU General Public License
-%% along with this program; if not, write to the Free Software
-%% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%%
-%% Contact the author at:
-%% Jens Berger
-%% Spektrumvn. 4
-%% N-0666 Oslo
-%% Norway
-%% E-mail: <jensthi@ifi.uio.no>
-%%
-%% NOTE: This file is written in LaTeX, and should be compiled
-%% before viewing. If you don't know how to do this, consult
-%% your local TeX guru. If you don't possess LaTeX, you are
-%% assumed to not need this program; so there's no text version
-%% of this file...
-%%
-%% You may still be able to view the DVI or PostScript versions of
-%% this file, though, they are included in the archive.
-%%
-
-
-
-\documentclass[a4paper]{article}
-%latex
-\usepackage{array, tabularx, verbatim, multicol}
-\usepackage[T1]{fontenc}
-\nonfrenchspacing
-\newcounter{errornum}
-\setcounter{errornum}{1}
-%endlatex
-\newcommand{\jtbt}{Jens~T. Berger~Thielemann}
-\newcommand{\Cmd}[1]{``\texttt{#1}''}
-\newcommand{\rsrc}{``\texttt{chktexrc}''}
-\newcommand{\chktex}{Chk\TeX}
-
-%latex
-\newcolumntype{Y}{>{\raggedright\arraybackslash}X}
-\newcommand{\fmted}[1]{%
- {\noindent\large%
- \begin{tabularx}{\linewidth}{lY}%
- \bf Warning \theerrornum: & \texttt{#1}%
- \end{tabularx}}\stepcounter{errornum}\nopagebreak[4]}
-
-\newenvironment{errdesc}[1]{\noindent\fmted{#1}\begin{quote}}{\end{quote}%
-\pagebreak[3]}
-
-\newenvironment{html}{\comment}{\endcomment}
-\newenvironment{rawhtml}{\comment}{\endcomment}
-
-\makeatletter
-\@namedef{errdesc*}#1{\begin{errdesc}{\textit{#1}}}
-\@namedef{enderrdesc*}{\end{errdesc}}
-\makeatother
-
-
-\newenvironment{errexam}
-{
-\vskip 0pt plus 5pt
-\begin{center}
-}
-{\end{center}}
-\columnseprule 0.1pt
-
-%!\newcommand{\BS}{\verb@\@}
-%!\newcommand{\chktex}{ChkTeX}
-%!\newcommand{\slash}{/}
-%endlatex
-
-
-\title{\chktex\ v1.7.6}
-\author{Jens~T. Berger~Thielemann}
-\date{\today}
-
-
-\begin{document}
-\maketitle
-
-%latex
-\newcommand{\BS}{\char`\\}
-%endlatex
-\section{Introduction}
-
-This program has been written in frustration because some constructs in
-\LaTeX\ are sometimes non-intuitive, and easy to forget. It is
-\emph{not} a replacement for the built-in checker in \LaTeX\@; however it
-catches some typographic errors \LaTeX\ oversees. In other words, it
-is Lint for \LaTeX. Filters are also provided for checking the
-\LaTeX\ parts of CWEB documents.
-
-It is written in ANSI C and compiles silently under GCC using
-\Cmd{-Wall -ansi -pedantic} and almost all warning flags. This means
-that you can compile \& use the program on your favorite machine.
-Full source included.
-
-The program also supports output formats suitable for further
-processing by editors or other programs, making errors easy to cycle through.
-For example, recent versions of AUC\TeX\ (the Emacs mode) interface
-beautifully with \chktex.
-
-The program itself does not have any machine requirements; However compiling
-for other platforms has not been done for a long time now so the code has been
-removed. If interest rises it can be resurrected.
-
-
-\section{Features}
-\chktex\ begins to get quite a few bells \& whistles now. However, you
-should be aware of that in most cases, all this is transparent to the user.
-As you will see, \chktex\ offers the ability to adapt to many environments
-and configurations.
-
-\begin{itemize}
-\item Supports over 40 warnings. Warnings include:
-%latex
- \begin{multicols}{2}
- \begin{flushleft}
-%endlatex
- \begin{itemize}
- \item Commands terminated with space. Ignores \Cmd{\BS{}tt}, etc.
- \item Space in front of references instead of \Cmd{\~{}}.
- \item Forgetting to group parenthesis characters when
- sub-\slash{}super\-scripting.
- \item Italic correction (\Cmd{\BS/}) mistakes (double,
- missing, unnecessary).
- \item Parenthesis and environment matching.
- \item Ellipsis detection; also checks whether to use
- \Cmd{\BS{}dots}, \Cmd{\BS{}cdots} or \Cmd{\BS{}ldots}.
- \item Enforcement of normal space after abbreviation. Detects
- most abbreviations automagically.
- \item Enforcement of end-of-sentence space when the last
- sentence ended with capital letter.
- \item Math-mode on/off detection.
- \item Quote checking, both wrong types (\Cmd{"}) and wrong
- direction.
- \item Recommends splitting three quotes in a row.
- \item Searching for user patterns.
- \item Displays comments.
- \item Space in front of \Cmd{\BS{}label} and similar commands.
- \item Use of \Cmd{x} instead of \Cmd{\$\BS{}times\$} between numbers.
- \item Multiple spaces in input which will be rendered as one
- space (or multiple spaces, where that is undesirable).
- \item Warns about text which may be ignored.
- \item Mathematical operators typeset as variables.
- \item No space in front of/after parenthesis.
- \item Demands a consistent quote style.
- \item Punctuation inside inner math mode/outside display math
- mode.
- \item Use of \TeX\ primitives where \LaTeX\ equivalents are
- available.
- \item Space in front of footnotes.
- \item Bogus characters following commands.
- \item Ability to suppress warnings on a single line.
- \end{itemize}
-%latex
- \end{flushleft}
- \end{multicols}
-%endlatex
-\item Fully customizable. Intelligent resource format makes it
- possible to make \chktex\ respect your \LaTeX\ setup. Even
- command-line options may be specified globally in the \rsrc\ file.
-\item Supports \Cmd{\BS{}input} command; both \TeX\ and \LaTeX\ version.
- Actually includes the files. \Cmd{TEXINPUTS}-equivalent search path.
-\item Intelligent warning/error handling. The user may promote/mute
- warnings to suit his preferences. You may also mute warnings in the
- header of a file; thus killing much unwanted garbage.
-\item Scripts included for checking CWEB files written in \LaTeX.
- (Requires perl v5).
-\item Supports both \LaTeX\ 2.09 and \LaTeXe{}.
-\item Flexible output handling. Has some predefined formats and lets
- the user specify his own format. Uses a \Cmd{printf()} similar
- syntax. \Cmd{lacheck} compatible mode included for interfacing with
- systems which only support lacheck.
-\item Written in ANSI C\@. \Cmd{configure} script included for easy
- setup and installation on UNIX systems.
-\end{itemize}
-
-Still, it is important to realize that the output from \chktex\ is
-only intended as a \emph{guide} to fixing faults. However, it is by
-no means always correct. This means that correct \LaTeX\ code may
-produce errors in \chktex, and vice versa: Incorrect \LaTeX\ code may pass
-silently through.
-
-
-
-\section{Legal stuff}
-
-\chktex{}, documentation, installations scripts, CWEB filters and other
-materials provided are copyright \copyright\ 1995--96 Jens~T.
-Berger~Thielemann, unless explicitly stated otherwise.
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your option)
-any later version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY\@; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE\@. See the GNU General Public License for
-more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to:
-\begin{quote}
- The Free Software Foundation, Inc. \\
- 51 Franklin Street \\
- Fifth Floor \\
- Boston \\
- MA 02110-1301 \\
- USA
-\end{quote}
-
-
-\section{Availability}
-
-This program is on CTAN\@; thus it can be found at any mirrors of those.
-It is also part of TeX Live 2011.
-
-\section{Installation}
-
-A few words on installation on various platforms:
-
-\begin{description}
-\item[UNIX:] Type \Cmd{configure}, \Cmd{make} and finally
- \Cmd{make~install}. To make sure everything proceeded correctly,
- type \Cmd{make~check}. If you don't have superuser privileges and thus
- access to the default system areas, you should type
- \Cmd{configure~-{}-help} to help you set up correct paths.
-
- If you haven't installed any software like this before, that is
- distributed in source form, here are some guidelines to help you
- install it locally at your account. Please note that a mail to the
- system administrator may be less work for you.
-
- We assume that you have put the archive (\Cmd{chktex.tar.gz}) in a
- subdir of yours, with path \Cmd{\~{}/tmp}. We further assume that
- your shell is \Cmd{csh} or \Cmd{tcsh}. Do the following:
-
- \begin{enumerate}
- \item First of all, unpack the archive contents.
-
-\begin{verbatim}
-> cd ~/tmp
-> gunzip chktex.tar.gz
-> tar xf chktex.tar
-\end{verbatim}
-
- \item Now, we can configure the program. There are some
- configuration options you should know about:
- \begin{description}
- \item[\Cmd{-{}-enable-pcre}:] Allows using PCRE (perl compatible
- regular expressions) for use defined warnings. The default is
- to use PCRE if it is installed on your system as determined by
- \Cmd{pcre-config}. You can use \Cmd{-{}-disable-pcre} if you
- plan to distribute this for systems in which you cannot ensure
- PCRE will be installed.
-
- User defined regular expressions are defined using
- \texttt{UserWarnRegex} in the \rsrc\ file. See warning~44 for
- more information.
-
- \item[\Cmd{-{}-enable-lacheck-replace}] This enables a quick
- hack for using \chktex\ instead of lacheck. This is done by
- installing a stub script which ``overrides'' the original
- lacheck executable. In this way, tools which support lacheck
- can be easily made to support chktex instead.
-
- \item[\Cmd{-{}-enable-debug-info}] \chktex\ has an ability to spit
- out various diagnostic messages using the \Cmd{-d} flag. This
- behaviour is on by default. By adding the flag
- \Cmd{-{}-disable-debug-info} to the commandline, this will not be
- compiled in.
-
- This may be useful if you're running short of disk space (the
- time savings are neglible).
- \end{description}
-
- If you are installing the program on your local account, use the
- following command:
-
-\begin{verbatim}
-> configure --prefix ~/
-\end{verbatim}
-
- Add eventual extra flags as specified above. This command will
- generate a significant amount of output, this can usually be ignored.
-
- \item Finally, we can just build the program and install it.
-
-\begin{verbatim}
-> make
-> make install
-\end{verbatim}
-
- \item Finished! The program is now installed and ready to use. You
- may now tell other people to put your bindir in their path in
- order to benefit from your work. All that remains is to make the
- shell aware of your installation.
-
-\begin{verbatim}
-> rehash
-\end{verbatim}
-
- To make the remaining parts of your system aware of this, you'll
- have to log out and re-log in, I'm afraid. However, you should delay this
- until you've completed this installation procedure.
-
- \item If you wish to make sure that everything is OK (you ought to),
- you may now ask \chktex\ to do a self-test:
-
-\begin{verbatim}
-> make check
-\end{verbatim}
-
- \end{enumerate}
-
-\item[Other platforms:] First of all, you have to copy the
- \Cmd{config.h.in} file to a file named \Cmd{config.h}. Then, edit
- it to reflect your system. Do the same with \Cmd{OpSys.h} (this
- file has been reduced significantly). If you wish, you may define
- \Cmd{DATADIR} to the path you want the global resource file to be
- put.
-
- Now, I would suggest that you take a peak at the \Cmd{OpSys.c}
- file, and edit it appropiately, for more
- comfort. This should not be necessary, though, at least not the
- first time.
-
- Finally, you may now compile and link all \verb@.c@ files. Do not
- forget to define \Cmd{HAVE\_CONFIG\_H} to 1 (on the command-line,
- for instance). If the \Cmd{config.h} you wish to use has another
- name, define \Cmd{CONFIG\_H\_NAME} to that (in that case, don't
- define \Cmd{HAVE\_CONFIG\_H}).
-
- Put the directory path of the \rsrc\ file in a environment variable
- named \Cmd{CHKTEXRC}. The files \Cmd{deweb.in} and \Cmd{chkweb}
- should be moved to a directory in your path. These files may need
- further setup, as they haven't got the location of perl
- initialized.
-
- If your compiler/the compiled program complains (or crashes!), you
- may try the hints listed below. Please note that it only makes
- sense to try these hints if your compiler fails to produce a working
- program.
-
- \begin{enumerate}
- \item Increase the preprocessor buffers and line buffers. The
- \chktex{} sources define macros sized 3--4k (expanding to about
- the same), and passes arguments sized about 1k.
- \item Use the magic switch which lets us use large
- \Cmd{switch(\dots)\{\dots\}} statements; some of these statements
- have about 120 \Cmd{case} entries.
- \item The sources require that at least the first 12 of each
- identifier is significant.
- \end{enumerate}
-\end{description}
-\paragraph{Note:} You \emph{must} install the new \rsrc\ file; \chktex\ will
-fail to function otherwise!
-
- After doing this, you may enhance \chktex' behaviour by
-reading/editing the \rsrc\ file.
-
-%latex
-\section{Usage}
-
-\subsection{\chktex}
-
-\subsubsection{Synopsis}
-
-A UNIX-compliant template format follows:
-
-\newcommand{\Group}[1]{\mbox{[#1]}}
-\begin{tabularx}{.95\linewidth}{lY}
- \texttt{chktex} & \ttfamily \Group{-hiqrW} \Group{-v[0-\dots]} \Group{-l
- <rcfile>} \Group{-[wemn] <[1-42]|all>} \Group{-d[0-\ldots]} \Group{-p
- <pseudoname>} \Group{-o <outputfile>} \Group{-[btxgI][0|1]}
- file1 file2 \dots
-\end{tabularx}
-
-
-\subsubsection{Options}
-
-These are the options \chktex\ currently accepts.
-Please note that single-lettered options requiring a numerical or no
-argument may be concatenated. E.g.\ saying \Cmd{-v0qb0w2} is the
-same as saying \Cmd{-v0~-q~-b0~-w2}, except for being less to
-type.
-
-Enough general talk; here's a rather detailed description of all
-options:
-\begin{description}
-\item[Misc.\ options:] General options which aren't related to some
- specific subpart of \chktex.
- \begin{description}
- \item[\texttt{-h [-{}-help]}] Gives you a command summary.
- \item[\texttt{-i [-{}-license]}] Shows distribution information.
- \item[\texttt{-l [-{}-localrc]}] Reads a resource-file formatted
- as the global resource-file \rsrc, in addition to the global
- resource-file. This option needs the name of the resource-file
- as a parameter. See also \texttt{-g}.
- \item[\texttt{-r [-{}-reset]}] This will reset all settings to their
- defaults. This may be useful if you use the \texttt{CMDLINE}
- directive in your \rsrc\ file, and wish to do something
- unusual.
- \item[\texttt{-d [-{}-debug]}] Needs a numeric argument; a bitmask
- telling what to output. The values below may be added in order
- to output multiple debugging info.
-
- \begin{tabularx}\linewidth{cX}
- \bf Value & \bf Dumps\ldots\\
- 1 & All warnings available and their current status. \\
- 2 & Statistics for all lists in the resource file. \\
- 4 & The contents of all lists in the resource file. \\
- 8 & Misc.\ other status information. \\
- 16 & Run-time info (note that this isn't widely used). \\
- \end{tabularx}
- The info is produced after all switches and resource files have
- been processed.
-
- It is possible to install versions of \chktex\ that ignore this
- flag; this means that it is not certain that this flag works.
- \item[\texttt{-W [-{}-version]}] Displays version information, and exits.
- \end{description}
-\item[Muting warning messages:] Controls whether and in what form
- error messages will appear. Usually they accept a specific warning
- number (e.g.\ \Cmd{-w2}), but you may also say \Cmd{all} (e.g.\
- \Cmd{-wall}) which does the operation on \emph{all} warnings.
- \begin{description}
- \item[\texttt{-w [-{}-warnon]}] Makes the message number passed as
- parameter a warning and turns it on.
- \item[\texttt{-e [-{}-erroron]}] Makes the message number passed as
- parameter an error and turns it on.
- \item[\texttt{-m [-{}-msgon]}] Makes the message number passed as
- parameter a message and turns it on. Messages are not counted.
- \item[\texttt{-n [-{}-nowarn]}] Turns the warning/error number passed
- as a parameter off.
- \item[\texttt{-L [-{}-nolinesupp]}] Turns off suppression of messages
- on a per line basis. This is meant to be used to ensure that no new
- errors have crept into a document while editing.
- \end{description}
-\item[Output control flags:] Determines the appearance and
- destination of the error reports.
- \begin{description}
- \item[\texttt{-q [-{}-quiet]}] Shuts up about copyright information.
- \item[\texttt{-o [-{}-output]}] Normally, all errors are piped to \texttt{stdout}.
- Using this option with a parameter, errors will be sent to the
- named file instead. Only information relative to the \LaTeX\ file
- will be sent to that file. Memory problems and similar will as as
- always be sent to \texttt{stderr}. If a file with the name given
- already exists, it will be renamed to \Cmd{foobar.bak}
- (\Cmd{foobar.\$cl} under MS-DOS), \Cmd{foobar} being the name of
- the file. See also \Cmd{-b}.
-
- \item[\texttt{-v [-{}-verbosity]}] Specifies how much and how you
- wish the error reports to be displayed. This is specified in the
- \rsrc\ file; we'll list the default values below. If you wish,
- you may thus edit the \rsrc\ file to add or modify new formats.
-
- The default is mode 1 (that is, the \emph{second} entry in the
- \rsrc\ file), using \texttt{-v} without any parameter will give you
- mode 2.
-
- \begin{description}
- \item[0] Will show the information in a way that should be
- suitable for further parsing by \texttt{awk}, \texttt{sed} or
- similar. The format is as follows:
-\begin{verbatim}
-File:Line:Column:Warning number:Warning message
-\end{verbatim}
- The colons may be replaced with another string; use the
- \verb@-s@ switch for this.
-
- As the program does not output all errors in quite order, this
- output format is also suitable for piping through \Cmd{sort}.
- \item[1] Shows the information in a way which is more
- comprehensible for humans, but which still doesn't need
- anything but a glass tty.
- \item[2] Shows the information in a fancy way, using escape
- codes and stuff. It is the indeed most readable of all
- modes; however, it needs proper set up of the \Cmd{ChkTeX.h}
- at compilation time. UNIX boxes, however, will find the
- information automatically.
- \item[3] Shows the information suitable for parsing by Emacs;
- this is the same format as \texttt{lacheck} uses. More formally,
- it is the following:
-\begin{verbatim}
-"File", line Line: Warning message
-\end{verbatim}
-
- To utilize this, type \verb@M-x compile RET@. Delete whatever
- is written in the minibuffer, and type
- \verb@chktex -v3 texfile.tex@, and you should be able to
- browse through the
- error messages. Use \verb@C-x `@ to parse the messages.
- \item[4] More or less the same as \verb@-v3@, but also includes
- information on where the error actually was found. Takes somewhat
- longer time to parse, but much more informative in use.
- \end{description}
-
- \item[\texttt{-f [-{}-format]}] Specifies the format of the output.
- This is done using a format similar to \Cmd{printf()}, where we
- support the specifiers listed below.
-
- \smallskip
- \newcommand{\Pf}[1]{\texttt{\%#1} &}
- \begin{tabularx}{\linewidth}{cX}
- \bf Code & \bf Description \\
- \Pf{b} String to print \textbf{b}etween fields (from \texttt{-s}
- option).\\
- \Pf{c} \textbf{C}olumn position of error. \\
- \Pf{d} Length of error (\textbf{d}igit). \\
- \Pf{f} Current \textbf{f}ilename.\\
- \Pf{i} Turn on \textbf{i}nverse printing mode.\\
- \Pf{I} Turn off \textbf{i}nverse printing mode.\\
- \Pf{k} \textbf{k}ind of error (warning, error, message).\\
- \Pf{l} \textbf{l}ine number of error.\\
- \Pf{m} Warning \textbf{m}essage.\\
- \Pf{n} Warning \textbf{n}umber.\\
- \Pf{u} An \textbf{u}nderlining line (like the one which
- appears when using \Cmd{-v1}).\\
- \Pf{r} Part of line in front of error ($\mbox{`S'} -
- 1$).\\
- \Pf{s} Part of line which contains error (\textbf{s}tring).\\
- \Pf{t} Part of line after error ($\mbox{`S'} + 1$).
- \end{tabularx}
- \smallskip
-
- Other characters will be passed literally; thus you can say
- \Cmd{\%\%} to achieve a single percent sign in the output.
- Please note that we may introduce other specifiers in the future,
- so don't abuse this feature for other characters.
-
- Also, note that we do \emph{not} support field lengths (yet).
- This may come in the future, if I get the time\dots
-
- The \texttt{-v} command is implemented by indexing into the \rsrc\
- file; read that for seeing how each format is implemented. If
- you find yourself using a particular format often by using the
- -f switch, consider putting it in the \rsrc\ file instead.
- \item[\texttt{-V [-{}-pipeverb]}] Which entry we'll use in the \rsrc\
- file whenever \texttt{stdout} isn't a terminal.
-
- The default is to use the same mode as specified with the
- \texttt{-v} switch; using \texttt{-V} without any parameter will give you
- mode 1.
-
- This switch was implemented because GNU less has problems with
- the escape codes \chktex\ uses for displaying inverse text.
- Under UNIX, there's another way around, though, which is slightly
- more elegant. Add the following line to your \Cmd{.envir} file:
-\begin{verbatim}
-setenv LESS -r
-\end{verbatim}
-
- \item[\texttt{-p [-{}-pseudoname]}] With this switch, you can provide
- the filename which will be used when we report the errors. This
- may be useful in scripts, especially when doing pipes. It is in
- other words similar to C's \verb@#line@ directive.
-
- We will only assume this name for the uppermost file; files that
- this one in turn \verb@\@\verb@input@ are presented under their original
- names. This seems most logical to me.
-
- \item[\texttt{-s [-{}-splitchar]}] String to use instead of the
- colons when doing \texttt{-v0}; e.g.\ this string will be output
- between the fields.
-
- \end{description}
-\item[Boolean switches:] Common for all of these are that they
- take an optional parameter. If it is \texttt{0}, the feature will
- be disabled, if it is \texttt{1}, it will be enabled. All these
- features are on by default; and are toggled if you don't give
- any parameter.
-
- \begin{description}
- \item[\texttt{-b [-{}-backup]}] If you use the \texttt{-o} switch, and the
- named outputfile exists, it will be renamed to \texttt{filename.bak}.
- \item[\texttt{-I [-{}-inputfiles]}] Execute \verb@\@\verb@input@
- statements; e.g.\ include the file in the input. Our input parsing
- does of course nest; we use an input-stack to keep track of this.
- \item[\texttt{-H [-{}-headererr]}] Show errors found in front of the
- \verb@\begin{document}@ line. Some people keep \emph{lots} of
- pure \TeX\ code there, which errors can't be detected reliably
- (in other words, we will in most cases just produce a lot of
- garbage).
- \item[\texttt{-g [-{}-globalrc]}] Read in the global resource file. This
- switch may be useful together with the \texttt{-l} option.
- \item[\texttt{-t [-{}-tictoc]}] Display a twirling baton, to show that
- we're working. \texttt{-v0} does an \texttt{-t0}, too, as it assumes
- that the user then uses the program non-interactively. This is
- now a no-op.
- \item[\texttt{-x [-{}-wipeverb]}] Ignore the ``\verb@\verb@'' command
- found within the \LaTeX\ file and its argument is completely by
- the checking routines. This is done by simply overwriting them.
- If you somehow don't like that (for instance, you would like to
- count brackets inside those commands, too), use this switch.
- \end{description}
-\end{description}
-
-
-If you don't specify any input \LaTeX-files on the commandline, we'll
-read from \texttt{stdin}. To abort \texttt{stdin} input, press the
-following keycombinations:
-
-\smallskip
-\begin{tabular}{ll}
- \bf Machine & \bf Key-combination \\
- UNIX & $\fbox{\texttt{Ctrl}} + \fbox{\texttt{D}}$ \\
- MS-DOS & $\fbox{\texttt{Ctrl}} + \fbox{Z}$, followed by return.
-\end{tabular}
-\smallskip
-
-By default, we use GNU's \Cmd{getopt()} routine.
-
-\begin{itemize}
-\item Options may be given in any order; the names of the \LaTeX-files
- do not have to be the last arguments. This behaviour may be turned
- off by creating an environment variable named \Cmd{POSIXLY\_CORRECT}.
-\item The special argument \Cmd{-{}-} forces an end of
- option-scanning.
-\item Long-named options begin with \Cmd{-{}-} instead of \Cmd{-}.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the argument, separated from
- the option name by a \Cmd{=}, or else the in next argument.
-\end{itemize}
-
-\subsubsection{The \rsrc\ file}
-
-You should also take a look at the \rsrc\ file. As it is
-self-documenting, you should be able to get the meaning of each
-keyword by simply reading the file. In fact, since not all options
-are described in this documentation it is necessary that you read
-the \rsrc\ file in order to understand them all. The method for
-\emph{finding it} has grown rather complex. An outline is given below.
-
-If \chktex\ finds multiple files when searching, each and every one
-will be read in the order specified below. The \Cmd{Keyword = \{ item
- item \dots \}} may thus be necessary to reset previously defined
-lists.
-
-In this list, \Cmd{\$foo} is assumed to be the environment variable
-\Cmd{foo}:
-
-\begin{enumerate}
-\item First, we'll take a look at the directory which was specified as
- \Cmd{DATADIR} during compilation. On UNIX boxes, this usually
- evaluates to something similar to
- \Cmd{/usr/local/share/chktexrc}, under MS-DOS it is set
- to \Cmd{\BS{}emtex\BS{}data\BS{}chktexrc}.
-
-\item Look in the following system directories:
-
- \begin{tabular}{ll}
- \bf Machine & \bf Directory \\
- UNIX & \Cmd{\$HOME/.chktexrc} or \Cmd{\$LOGDIR/.chktexrc} \\
- MSDOS & Program installation path
- \end{tabular}
-
-\item Look for it in the directory pointed to by an environment
- variable, as specified in the table below:
-
- \begin{tabularx}\linewidth{lY}
- \bf Machine & \bf Directory \\
- UNIX & \Cmd{\$CHKTEXRC/.chktexrc} \\
- MSDOS & \Cmd{\$CHKTEXRC\BS{}chktexrc}, \Cmd{\$CHKTEX\_HOME\BS
- chktexrc} or \Cmd{\$EMTEXDIR\BS{}data\BS{}chktexrc}
- \end{tabularx}
-
-\item Look for it in the current directory. On UNIX boxes,
- we expect the filename to be \Cmd{.chktexrc}; on other machines
- \Cmd{chktexrc}.
-
-\end{enumerate}
-
-If you for some reason wish to undo what the previous files may have
-done, you may say \Cmd{CmdLine \{ -g0 -r \}} somewhere in the \rsrc\
-file; this will reset all previous settings.
-
-\subsubsection{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
-\begin{center}
- \verb+% chktex ##+
-\end{center}
-where \verb+##+ is the number of the message to be suppressed.
-For example the line
-\begin{center}
- \verb+$[0,\infty)$+\\*
-\end{center}
-will produce a warning (number 9) about mismatched \verb+]+ and \verb+)+.
-However the lines
-\begin{center}
- \verb+$[0,\infty)$ % chktex 9+\\*
- \verb+$[0,\infty)$ % ChkTeX 9+\\*
-\end{center}
-will not produce such a message. In this case, message number 17 will
-still appear at the end, stating that the numbers of \verb+]+ and
-\verb+)+ don't match for the entire file.
-
-To suppress two different errors on the same line you will need two
-instances of \verb+chktex+ in the comment. This format is a little
-cumbersome, but it shouldn't be needed often, and hopefully will help
-avoid accidental suppressions.
-\begin{center}
- \verb+Jordan--H\"older on $[0,\infty)$ % chktex 8 chktex 9+\\*
-\end{center}
-
-One problem inherent in line-by-line suppressions is that during editing
-another error of the same type may creep into the same line. Therefore,
-I suggest using the \texttt{-L} or \texttt{-{}-nolinesupp} option to
-disallow line based suppressions once just before the document is finished.
-At that point you should go back over all the warnings and decide if they
-should be fixed.
-
-In addition to line-specific suppressions, you can create a suppression which will be in effect for the remainder of the file.
-This can be used, for example, to turn off warning 18 (about \verb+"+) in a file which uses a package (like \Cmd{babel}) where \verb+"+ is an active character.
-The syntax is nearly the same, namely
-\begin{center}
- \verb+% chktex-file ##+
-\end{center}
-
-\subsubsection{Hints}
-I've tried to collect some advice that may be useful --- if you have a
-favourite hint, feel free to send it to me!
-
-\begin{itemize}
-\item If you use \Cmd{german.sty} or several of \Cmd{babel} languages
- which use \verb+"+ as an active character; it may be wise to put \Cmd{-n18} in
- the \Cmd{CmdLine} entry in the \rsrc\ file. This will probably reduce
- the amount of false warnings significantly. Alternately, you can put
- \verb+% chktex-file 18+ in your files which use one of these packages so
- that other files will still have these checks performed.
-\item Put \Cmd{-v} in the \Cmd{CmdLine} entry of the \rsrc\ file; this
- makes the fancy printing the default.
-\item If you're working on a large project, it may pay off to make a
- local resource file which is included in addition to the global
- one. In this one, add the necessary info to reduce the amount of
- false warnings --- these usually don't do anything but hide the
- real warnings.
-\item Create a total ignore environment, which \chktex\ will ignore
- completely. In here, you can place all that code which outsmarts
- \chktex\ completely. For instance, add the following lines at the top
- of your \LaTeX\ file:
-\begin{verbatim}
-% ChkTeX will ignore material within this environment
-\newenvironment{ignore}{}{}
-\end{verbatim}
- In addition, you should add the item \Cmd{ignore} to the \Cmd{VerbEnvir}
- entry in the \rsrc\ file.
-\end{itemize}
-\subsubsection{Bugs}
-
-No fatal ones, I think, but the program currently has some problems when a
-\LaTeX\ command/parameter stretch over a two lines --- some extra spaces
-may be inserted into the input. I regard the program as fairly well
-tested; using the SAS/C \Cmd{cover} utility I was able to make sure that
-approximately 95\% of the code has actually been run successfully in the
-final version. This does indeed leave some lines; most of these are
-procedure terminating brackets or ``can't happen'' lines, though.
-
-We've got some problems when isolating the arguments of a command.
-Although improved, it will certainly fail in certain cases; \chktex\
-can for instance not handle arguments stretching over two lines. This
-also means that \Cmd{WIPEARG} entries in the \rsrc\ file will only
-have the first half of their argument wiped if the argument stretches
-over two lines. We will, however, take care not to wipe parenthesis
-in such cases, in order to avoid false warnings.
-
-Long lines are broken up into chunks and handled separately. The exact
-length is platform dependent, though is guaranteed to be at least 256 bytes.
-The first portions of the line will have line numbers that are 1 less than
-they should be. Some errors can be missed and some can be added erroneously.
-A warning will be issued if lines are too long.
-
-Before submitting a bug report, please first see whether the problem can be
-solved by editing the \rsrc\ file appropriately.
-
-
-
-\subsection{ChkWEB}
-
-This shell script is provided for checking CWEB files. The template is
-as follows:
-\begin{verbatim}
-chkweb [options] file1 file2 ...
-\end{verbatim}
-As you may see from the script, it is only a trivial interface towards
-\texttt{deweb} and \chktex. It does not support any individual options
-on the command line --- all options found will be passed onto \chktex.
-If \Cmd{-{}-} or a filename is found, the remaining parameters will be
-ignored.
-The only real intelligence it features is that it will try to append
-\verb@.w@ to filenames it can't find.
-
-If no filenames are given, we will read from \texttt{stdin}.
-
-\subsection{DeWEB}
-
-This program strips away C code and CWEB commands from CWEB sources.
-It is called with the following synopsis:
-
-\begin{verbatim}
-deweb file1 file2 ...
-\end{verbatim}
-
-\texttt{deweb} filters away all C \&\ CWEB commands from a CWEB source
-code. This leaves only the \LaTeX\ code. This stripped code, in turn,
-may then be passed to a suitable syntax checker for \LaTeX, like
-\chktex\ and \texttt{lacheck}, or spell-checkers like \texttt{ispell}.
-
-When \texttt{deweb} strips away the C code from your CWEB source, it tries to
-preserve line breaks. This means that the error reports from {\it your
- favorite tool\/} will be correct regarding to line numbers. In most
-cases, the column position will also be correct. This significantly
-simplifies finding the errors in the \LaTeX\ source (in contrast to the
-output from \texttt{cweave}, which output is truly difficult to figure
-anything out from).
-
-\texttt{deweb} accepts a list of filenames on the argument line, and will send
-its output to \texttt{stdout}. If no filenames are given, it will read from
-stdin, acting as a filter. No options are currently accepted.
-
-Macho users may try to pipe the output from \texttt{deweb} directly into
-\LaTeX, theoretically, this should work. This would ease the debugging of
-the \LaTeX\ code significantly, as when \LaTeX\ complains about wrong
-syntax, you'll be able to find the erroneous line much more easily. Don't
-expect that the output looks very much like the final one, though.
-
-\texttt{deweb} should now understand all correct \texttt{CWEB} opcodes. If it
-complains about not understanding a correct opcode, please inform the
-author.
-
-\subsubsection{Bugs}
-
-\texttt{deweb} will not even \emph{compile} under Perl versions before perl
-v5. Unfortunately, this means that we can't even tell the user why we
-failed; Perl will just complain about not being able to compile the
-regexps.
-
-\section{Explanation of error messages}
-Below is a description of all error-messages \chktex\ outputs.
-Error messages set in {\it italic type\/} are turned off by default.
-Where margin paragraphs are listed in the text, they refer to the
-keyword in the \rsrc\ file which controls the discussed warning.
-
-\newcommand\Keyword[1]{\marginpar{\texttt{\hfill\\ #1}}}
-
-\smallskip\pagebreak[2]
-\Keyword{Silent}
-\begin{errdesc}{Command terminated with space.}
- You tried to terminate a command with a blank space. Usually, this
- is an error as these are ignored by \LaTeX. In most cases, you would
- like to have a real space there.
-
- You can also specify regular expressions to match commands which can
- safely be terminated with a space. They are specified in the
- \rsrc\ file in \texttt{[]}, which in some other cases is used to
- indicate case-insensitive matching. This is used for example to
- support the \verb+\startXXX+ macros of Con\TeX t.
-
- \begin{errexam}
- \verb@\LaTeX@\underline{\tt\ }\verb@is a typesetter.@ \\*
- \LaTeX is a typesetter. \\*
- \smallskip
- \verb@\LaTeX\ is a typesetter.@ \\*
- \LaTeX\ is a typesetter. \\*
- \end{errexam}
-\end{errdesc}
-
-\Keyword{Linker}
-\begin{errdesc}{Non-breaking space (`\~{}') should have been used.}
- When reading a document, it is not very pretty when references are
- split across lines. If you use the \verb@~@ character, \LaTeX\ will
- assign a very high penalty for splitting a line at that point.
- \chktex\ issues this warning if you have forgot to do this.
-
- \begin{errexam}
- \verb@Please refer to figure@\underline{\tt\ }\verb@\ref{foo}.@ \\*
- Please refer to figure 11. \\* % Gotta cheat here! :)
- \smallskip
- \verb@Please refer to figure~\ref{foo}.@ \\*
- Please refer to figure~11. \\*
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{You should enclose the previous parenthesis with `\{\}'.}
-
- This is a warning which you may ignore, but for maximum aestethic
- pleasure, you should enclose your bracket characters with `\{\}'s.
-
- \begin{errexam}
- \verb@$@\underline{\tt\ }\verb@[(ab)^{-1}]@\underline{\tt\ }\verb@\^{-2}$@ \\*
- $[(ab)^{-1}]^{-2}$ \\*
- \smallskip
- \verb@${[{(ab)}^{-1}]}^{-2}$@ \\*
- ${[(ab)^{-1}]}^{-2}$ \\*
- \end{errexam}
-\end{errdesc}
-
-\Keyword{Italic\\ItalCmd\\NonItalic}
-\begin{errdesc}{Italic correction (`\BS/') found in non-italic
- buffer.}
- If you try to use the \verb@\/@ command when \chktex\ believes that
- the buffer is not outputted as italic, you'll get this warning.
-
- \begin{errexam}
- \verb@This is an@\underline{\tt\BS/}\verb@ example@ \\*
- This is an\/ example. \\*
- \smallskip
- \verb@This is an example.@ \\*
- This is an example. \\*
- \end{errexam}
-\end{errdesc}
-
-\Keyword{Italic\\ItalCmd\\NonItalic}
-\begin{errdesc}{Italic correction (`\BS/') found more than once.}
- If the buffer is italic, and you try to use the \verb@\/@ command
- more than once, you'll get this warning.
-
- \begin{errexam}
- \verb@This {\it example\/@\underline{\tt\BS/}\verb@} is not amusing.@ \\*
- This {\it example\/\/} is not amusing. \\*
- \smallskip
- \verb@This {\it example\/} is not amusing.@ \\*
- This {\it example\/} is not amusing. \\*
- \end{errexam}
-\end{errdesc}
-
-\Keyword{Italic\\ItalCmd\\NonItalic}
-\begin{errdesc}{No italic correction (`\BS/') found.}
- You get this error if \chktex\ believes that you are switching from
- italic to non-italic, and you've forgot to use the \verb@\/@ command
- to insert that extra little spacing. If you use the \Cmd{em} option,
- you may ignore this warning.
-
- \begin{errexam}
- \verb@This {\it example@\underline{\tt\ }\verb@} is not amusing, either.@ \\*
- This {\it example} is not amusing, either. \\*
- \smallskip
- \verb@This {\it example\/} is not amusing, either.@ \\*
- This {\it example\/} is not amusing, either. \\*
- \end{errexam}
-\end{errdesc}
-
-\Keyword{IJAccent}
-\begin{errdesc}{Accent command `command' needs use of `command'.}
- If you're using accenting commands, `i' and `j' should lose their
- dots before they get accented. This is accomplished by using the
- \verb@\i@, \verb@\j@, \verb@\imath@ and \verb@\jmath@ command.
-
- \begin{errexam}
- \verb@This is an example of use of accents: \'{@\underline{\tt i}\verb@}.@ \\*
- This is an example of use of accents: \'{i}. \\*
- \smallskip
- \verb@This is an example of use of accents: \'{\i}.@ \\*
- This is an example of use of accents: \'{\i}. \\*
- \end{errexam}
-\end{errdesc}
-
-\Keyword{HyphDash\\NumDash\\WordDash\\DashExcpt}
-\begin{errdesc}{Wrong length of dash may have been used.}
- This warning suggests that a wrong number of dashes may have been
- used. It does this by classifying the dash according to the the
- character in front and after the dashes.
-
- If they are of the same type, \chktex\ will determine which keyword
- to use in the \rsrc\ file. If not, it will shut up and accept that
- it doesn't know.
-
- \begin{tabular}{ll}
- \bf Character type & \bf Keyword in \rsrc\ file \\*
- Space & \texttt{WordDash} \\*
- Number & \texttt{NumDash} \\*
- Alphabetic character & \texttt{HyphDash} \\*
- \end{tabular}
-
- This is more or less correct, according to my references. One
- complication is that most often a hyphen (single dash) is desired
- between letters, but occasionally an n-dash (double dash) is
- required. This is the case for theorems named after two people
- e.g.\ Jordan--H\"older. A hyphen would indicate that it was one
- person with a hyphenated name e.g.\ Gregorio Ricci-Curbastro.
- If this is rare enough, it can be dealt with via line based suppressions.
- However, exceptions can also be handled by adding them to the
- \texttt{DashExcpt} list. The ``words'' in this list are
- considered to be correct regardless of any other settings.
- Adding \verb+Jordan--H\"older+ to this list will cause no warning
- to be issued. There is still the problem that no warning will be
- raised for Jordan-H\"older (unless added explicitly via regular
- expression), so care must still be taken.
-
- Some manuals---particularly American manuals---also suggest
- \emph{not} adding space around an m-dash (triple dash).
- Hopefully this check can be improved even more (suggestions?).
-
- \begin{errexam}
- \verb@It wasn't anything @\underline{\tt-}\verb@ just a 2@\underline
- {\tt-{}-{}-}\verb@3 star@\underline{\tt-{}-}\verb@shots.@ \\*
- It wasn't anything - just a 2---3 star--shots. \\*
- \smallskip
- \verb@It wasn't anything --- just a 2--3 star-shots@ \\*
- It wasn't anything --- just a 2--3 star-shots. \\*
- \end{errexam}
-\end{errdesc}
-
-
-\fmted{`\%s' expected, found `\%s'.}
-\begin{errdesc}{Solo `\%s' found.}
- Either brackets or environments don't match.
- \chktex\ expects to find matching brackets/environments in the
- same order as their opposites were found, and no closing delimiters
- which haven't been preceded by an opening one.
-
- While bracket matching is not an explicit error, it is usually a
- sign that something is wrong.
-
-\end{errdesc}
-
-\Keyword{CenterDots\\LowDots}
-\begin{errdesc}{You should use `\%s' to achieve an ellipsis.}
- Simply typing three \Cmd{.} in a row will not give a perfect spacing
- between the dots. The \verb@\ldots@ is much more suitable for this.
- Similar problems are noted for two periods in a row (instead of three)
- since lacheck does.
-
- In math mode, you should also distinguish between \verb@\cdots@ and
- \verb@\ldots@; take a look at the example below.
-
- \begin{errexam}
- \newcommand{\td}{\underline{\tt...}}
- \verb@Foo@\td\verb@bar. $1,@\td\verb@,3$. $1+@\td\verb@+3$. $1,@%
- \underline{\tt\BS{}cdots}\verb@,3$.@ \\*
- Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. \\*
- \smallskip
- \verb@Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$.@ \\*
- Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. \\
- \end{errexam}
-\end{errdesc}
-
-\Keyword{Abbrev}
-\begin{errdesc}{Interword spacing (`\BS\ ') should perhaps be used.}
-
- One of the specified abbreviations were found. Unless you have
- previously said \verb@\frenchspacing@, you'll have incorrect
- spacing, which one should avoid if possible.
-
- You can also specify case-insensitive abbreviations in \texttt{[]}, though
- only the first letter is actually case-insensitive.
-
- \begin{errexam}
- \verb@This is an example, i.e.@\underline{\tt\ }\verb@an demonstration.@ \\*
- This is an example, i.e. an demonstration. \\*
- \smallskip
- \verb@This is an example, i.e.\ an demonstration.@ \\*
- This is an example, i.e.\ an demonstration. \\*
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{Intersentence spacing (`\BS{}@') should perhaps be used.}
-
- \LaTeX' detection of whether a period ends a sentence or not, is
- only based upon the character in front of the period. If it's
- uppercase, it assumes that it does not end a sentence. While this
- may be correct in many cases, it may be incorrect in others.
- \chktex\ thus outputs this warning in every such case.
-
- \begin{errexam}
- \verb@I've seen an UFO!@\underline{\tt\ }\verb@Right over there!@ \\*
- I've seen an UFO! Right over there! \\*
- \smallskip
- \verb+I've seen an UFO\@! Right over there!+ \\*
- I've seen an UFO\@! Right over there! \\*
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{Could not find argument for command.}
-
- \chktex\ will in some cases need the argument of a function to
- detect an error. As \chktex\ currently processes the \LaTeX\ file on
- a line-by-line basis, it won't find the argument if the command
- which needed it was on the previous line. On the other hand, this
- \emph{may} also be an error; you ought to check it to be safe.
-
- \begin{errexam}
- \verb@$\hat$@ \\*
- This will give a \LaTeX\ error\dots \\*
- \smallskip
- \verb@$\hat{a}$@ \\*
- $\hat{a}$ \\*
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{No match found for `\%s'.}
-
- This warning is triggered if we find a single, \emph{opening}
- bracket or environment. While bracket matching is not an explicit
- error, it is usually a sign that something is wrong.
-
-\end{errdesc}
-
-\Keyword{MathEnvir}
-\begin{errdesc}{Mathmode still on at end of LaTeX file.}
- This error is triggered if you at some point have turned on
- mathmode, and \chktex\ couldn't see that you remembered to turn it
- off.
-
-\end{errdesc}
-
-\begin{errdesc}{Number of `character' doesn't match the number of `character'.}
-
- Should be self-explanatory. \chktex\ didn't find the same number of
- an opening bracket as it found of a closing bracket.
-
-\end{errdesc}
-
-\begin{errdesc}{You should use either `` or '' as an alternative to `\,"\,'.}
- Self-explanatory. Look in the example, and you'll understand why.
-
- \begin{errexam}
- \verb@This is an @\underline{\tt"}\verb@example@\underline{\tt"} \\*
- This is an "example" \\*
- \smallskip
- \verb@This is an ``example''@ \\*
- This is an ``example'' \\*
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc*}{You should use "'" (ASCII 39) instead of
- "'" (ASCII 180).} On some keyboards you might get the wrong quote.
- This quote looks, IMHO, \emph{ugly} compared to the standard
- quotes, it doesn't even come out as a quote! Just see in the
- example.
-
-
- \begin{errexam}
- \verb@``There@\underline{\tt '}\verb@s quotes and there@\underline{\tt '}\verb@s quotes@
- \underline{\tt ''} \\* % ''
- ``There´s quotes and there´s quotes´´ \\* % ''
- \smallskip
- \verb@``There's quotes and there's quotes''@ \\*
- ``There's quotes and there's quotes'' \\*
- \end{errexam}
-\end{errdesc*}
-
-\Keyword{UserWarn}
-\begin{errdesc}{User-specified pattern found: \%s.}
- A substring you've specified using \texttt{UserWarn} in the \rsrc\ file,
- has been found. See also warning~44 which allows using regular
- expressions. You can also specify case-insensitive versions in
- \texttt{[]}.
- % Normally I would use a ref here, but if the numbers change that would be
- % hugely backwards incompatible. Also it would require adding special label code.
-\end{errdesc}
-
-\begin{errdesc*}{This command might not be intended.}
- I implemented this because a friend of mine kept on making these
- mistakes. Easily done if you haven't gotten quite into the syntax
- of \LaTeX.
-
- \begin{errexam}
- \verb@\LaTeX\ is an extension of \TeX@\underline{\tt\BS.}\verb@ Right?@ \\*
- \LaTeX\ is an extension of \TeX\. Right? \\*
- \smallskip
- \verb@\LaTeX\ is an extension of \TeX. Right?@ \\*
- \LaTeX\ is an extension of \TeX. Right? \\*
- \end{errexam}
-\end{errdesc*}
-
-\begin{errdesc*}{Comment displayed.}
- \chktex\ dumps all comments it finds, which in some cases is useful.
- I usually keep all my notes in the comments, and like to review them
- before I ship the final version. For commenting out parts of the
- document, the \Cmd{comment} environment is better suited. Setting
- this warning allows you to see notes you have left in comments.
-\end{errdesc*}
-
-
-\begin{errdesc}{Either ''\BS,' or '\BS,'' will look better.}
-
- This error is generated whenever you try to typeset three quotes in
- a row; this will not look pretty, and one of them should be
- separated from the rest.
-
- \begin{errexam}
- \underline{\tt```}\verb@Hello', I heard him said'', she remembered.@ \\*
- ```Hello', I heard him said'', she remembered. \\*
- \smallskip
- \verb@``\,`Hello', I heard him said'', she remembered.@ \\*
- ``\,`Hello', I heard him said'', she remembered.
- \end{errexam}
-\end{errdesc}
-
-\Keyword{PostLink}
-\begin{errdesc}{Delete this space to maintain correct pagereferences.}
- This message, issued when a space is found in front of a
- \verb@\index@, \verb@\label@ or similar command (can be set in the
- \rsrc\ file). Sometimes, this space may cause that the word and the
- index happens on separate pages, if a pagebreak happens just there.
-
- Warning~42 is similar in that it warns about spaces in front of footnotes.
- The difference is that the warning text makes more sense for that case.
-
- \begin{errexam}
- \verb@Indexing text@\underline{\tt\ }\verb@\index{text} is fun!@ \\*
- \smallskip
- \verb@Indexing text\index{text} is fun!@ \\*
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{You might wish to put this between a pair of `\{\}'}
-
- This warning is given whenever \chktex\ finds a \Cmd{\^{ }}' or a
- \Cmd{\_} followed by either two or more numeric digits or two or
- more alphabetic characters. In most situations, this means that
- you've forgotten some \{\}'s.
-
- \begin{errexam}
- \verb@$5\cdot10^@\underline{\tt10}\verb@$@ \\*
- $5\cdot10^10$ \\*
- \smallskip
- \verb@$5\cdot10^{10}$@ \\*
- $5\cdot10^{10}$
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{You ought to remove spaces in front of punctuation.}
-
- This warning is issued if \chktex\ finds space in front of an
- end-of-sentence character.
-
- \begin{errexam}
- \verb@Do you understand@\underline{\tt\ }\verb@?@ \\*
- Do you understand ? \\*
- \smallskip
- \verb@Do you understand?@ \\*
- Do you understand? \\*
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{Could not execute LaTeX command.}
-
- Some \LaTeX\ commands will be interpreted by \chktex; however, some
- of them are sensible to errors in the \LaTeX\ source. Most notably,
- the \verb@\@\verb@input@ command requires that the input file exist\dots
-
-\end{errdesc}
-
-\Keyword{Italic\\ItalCmd\\NonItalic}
-\begin{errdesc}{Don't use \BS/ in front of small punctuation.}
- Italic correction should generally \emph{not} be used in front of
- small punctuation characters like `.' and `,'; as it looks better
- when the preceding italic character leans ``over'' the punctum or
- comma.
-
- \begin{errexam}
- \verb@It is just a {\it test@\underline{\tt\BS/}\verb@}, don't think anything else.@ \\*
- It is just a {\it test\/}, don't think anything else. \\*
- \smallskip
- \verb@It is just a {\it test}, don't think anything else.@ \\*
- It is just a {\it test}, don't think anything else.
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{\$\BS{}times\$ may look prettier here.}
- In ASCII environments, it is usual to use the `x' character as an
- infix operator to denote a dimension. The mathemathical symbol
- $\times$ provided by the \verb@$\times$@ command is better suited for
- this.
-
- \begin{errexam}
- \verb@The program opens a screen sized 640@\underline{\tt x}\verb@200 pixels.@ \\*
- The program opens a screen sized 640x200 pixels. \\*
- \smallskip
- \verb@The program opens a screen sized $640\times200$ pixels.@ \\*
- The program opens a screen sized $640\times200$ pixels.
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc*}{Multiple spaces detected in output.}
-
- This warning, intended for the novice, will remind you that even if
- you \emph{type} multiple spaces in your input, only a single space
- will come out. Some ways to come around this is listed below.
-
- \begin{errexam}
- \verb@White is a beautiful colour.@ \\*
- White is a beautiful colour. \\*
- \smallskip
- \verb@White~~~~~{ }{ }{ }\ \ \ is a beautiful colour.@ \\*
- White~~~~~{ }{ }{ }\ \ \ is a beautiful colour. \\
- \end{errexam}
-\end{errdesc*}
-
-\Keyword{VerbEnvir}
-\begin{errdesc}{This text may be ignored.}
- Certain implementations of the \verb@verbatim@ environment and
- derivations of that, ignore all text on the same line as
- \verb@\end{verbatim}@. This will warn you about this.
-
-
-\end{errdesc}
-
-\fmted{Use ` to begin quotation, not '.}\hfill\\
-\fmted{Use ' to end quotation, not `.}\hfill\\
-\begin{errdesc}{Don't mix quotes.}
-
- Proper quotations should start with a \verb@`@ and end with a
- \verb@'@; anything else isn't very pretty. Both these warnings are
- relative to this; look in the example below.
-
- \begin{errexam}
- \verb@There are @\underline{\tt`'}%
- \verb@examples'' and there are ``examples@\underline{\tt``}\verb@.@ \\*
- There are `'examples'' and there are ``examples``. \\*
- \smallskip
- \verb@There are ``examples'' and there are ``examples''.@ \\*
- There are ``examples'' and there are ``examples''.
- \end{errexam}
-\end{errdesc}
-
-\Keyword{MathRoman}
-\begin{errdesc}{You should perhaps use `cmd' instead.}
- Most mathematical operators should be set as standard roman font,
- instead of the math italic \LaTeX\ uses for variables. For many
- operators, \LaTeX\ provides a pre-defined command which will typeset
- the operator correctly. Look below for an illustration of the point.
-
- \begin{errexam}
- \verb@$@\underline{\tt sin}\verb@^2 x + @\underline{\tt cos}\verb@^2 x = 1$@ \\*
- $sin^2 x + cos^2 x= 1$ \\*
- \smallskip
- \verb@$\sin^2 x + \cos^2 x = 1$@ \\*
- $\sin^2 x + \cos^2 x = 1$
- \end{errexam}
-\end{errdesc}
-
-\fmted{You should put a space in front of/after parenthesis.}\hfill\\
-\begin{errdesc}{You should avoid spaces in front of/after parenthesis.}
- Outside math mode, you should put a space in front of any group of
- opening parenthesis, and no spaces after. If you have several after
- each other, you should of course not put a space in between each;
- look in the example below. Likewise, there should not be spaces in
- front of closing parenthesis, but there should be at least one
- after.
-
-
-
- \begin{errexam}
- \verb@This@\underline{\tt( }\verb@an example@\underline{\tt( }%
- \verb@Nuff said@\underline{\tt\ }\verb@)), illustrates@\underline{\tt( }%
- \verb@``my''@\underline{\tt\ )}\verb@point.@\\
- This( an example( Nuff said )), illustrates( ``my'' )point. \\
- \smallskip
- \verb@This (an example (Nuff said)), illustrates (``my'') point.@\\
- This (an example (Nuff said)), illustrates (``my'') point.\\
- \end{errexam}
-\end{errdesc}
-
-\Keyword{QuoteStyle}
-\begin{errdesc}{You should not use punctuation in front of/after
- quotes.}
- %
- For best looking documents, you should decide on how you
- wish to put quotes relative to punctuation. \chktex\ recognizes two
- styles; you may specify which you use in the \rsrc\ file. A
- description on each style follows:
- \begin{description}
- \item[Traditional:] This style is the most visually pleasing. It
- always puts the punctuation \emph{in front of} the quotes, which
- gives a continuous bottom line.
-
- However, it may in certain cases be ambigious. Consider the
- following example from a fictious \Cmd{vi(1)}
- tutorial (quote taken from the Jargon file):
- \begin{center}
- \verb@Then delete a line from the file by typing ``dd.''@ \\*
- Then delete a line from the file by typing ``dd.''
- \end{center}
- That would be very bad --- because the reader would be prone to
- type the string d-d-dot, and it happens that in \Cmd{vi(1)} dot
- repeats the last command accepted. The net result would be to
- delete \emph{two} lines! This problem is avoided using logical
- style, described below.
- \pagebreak[3]
- \item[Logical:] This style uses quotes as balanced delimiters like
- parentheses. While this is not the most visual pleasing, it is
- can't be misunderstood. The above sentence would then become:
- \nopagebreak
- \begin{center}
- \verb@Then delete a line from the file by typing ``dd''.@ \\*
- Then delete a line from the file by typing ``dd''.
- \end{center}
- \nopagebreak
- \end{description}
-
-\end{errdesc}
-
-\begin{errdesc}{Double space found.}
- This warning is triggered whenever \chktex\ finds a space in front
- of a hard space, or vice versa. This will be rendered as two spaces
- (which you usually don't wish).
-
- \begin{errexam}
- \verb@For output codes, see table@\underline{\tt\ }%
- \verb@~@\underline{\tt\ }\verb@\ref{foo}.@ \\*
- For output codes, see table ~ 1.1.\\*
- \smallskip
- \verb@For output codes, see table~\ref{foo}.@ \\*
- For output codes, see table~1.1.
- \end{errexam}
-\end{errdesc}
-
-\Keyword{MathEnvir}
-\begin{errdesc}{You should put punctuation outside inner/inside
- display math mode.}
- As recommended in the \TeX{}book, you should try to put punctuation
- outside inner math mode, as this is gets formatted better.
-
- Similarily, you should let any final punctuation in display math
- mode end up within it. Look at the following example, which was
- taken from the \TeX{}book:
- \begin{errexam}
- \verb@for $x = a@\underline{\tt,}\verb@b$, or $c$.@\\*
- for $x = a,b$, or $c$. \\*
- \smallskip
- \verb@for $x = a$, $b$, or $c$.@\\*
- for $x = a$, $b$, or $c$.\\*
- \end{errexam}
-
-\end{errdesc}
-
-\Keyword{Primitives}
-\begin{errdesc*}{You ought to not use primitive TeX in LaTeX code.}
- This warning is triggered whenever you use a raw \TeX\ command
- which has been replaced by a \LaTeX\ equivalent. If you consider
- yourself a purist (or want to be sure your code works under \LaTeX3),
- you should use the \LaTeX\ equivalent.
-\end{errdesc*}
-
-\Keyword{NotPreSpaced}
-\begin{errdesc}{You should remove spaces in front of `\%s'}
-
- Some commands should not be prepended by a space character, for cosmetical
- reasons. This notes you of this whenever this has happened.
-
- \begin{errexam}
- \verb@This is a footnote@\underline{\tt\ }\verb@\footnotemark[1] mark.@\\*
- This is a footnote ${}^1$ mark. \\*
- \smallskip
- \verb@This is a footnote\footnotemark[1] mark.@\\*
- This is a footnote${}^1$ mark. \\*
- \end{errexam}
-\end{errdesc}
-
-\Keyword{NoCharNext}
-\begin{errdesc}{`\%s' is normally not followed by `\%c'.}
- \LaTeX' error message when calling \verb@\left \{@ instead of
- \verb@left \{@ is unfortunately rather poor. This warning detects
- this and similar errors.
-\end{errdesc}
-
-\Keyword{UserWarnRegex}
-\begin{errdesc}{User Regex:\ \%s.}
- A pattern you've specified using \texttt{UserWarnRegex} in the \rsrc\ file,
- has been found. See also warning~20 which allows specification of simple
- string matching.
-
- Depending on how \chktex\ was configured, you can use either PCRE regular
- expressions, POSIX extended regular expressions, or none at all.
- A warning will be issued if \chktex\ was built without regular expression
- support, but you try to use one.
-
- By default the matching portion of the line is printed to help distinguish
- between user specified regular expressions. However, if the regular
- expression begins with a PCRE comment (which has a syntax of
- \verb+(?#+~\dots~\verb+)+), then that comment will be printed instead.
- This can be used to remind yourself why you were searching for the problem
- or how to fix it. This applies even if POSIX regular expressions are used
- since \chktex\ itself parses a single initial PCRE-style comment.
-
- \emph{Note:} If a regular expression (not a comment) starts with
- \texttt{PCRE:} or \texttt{POSIX:} it will be used only if support for that
- regular expression engine has been compiled in. It is primarily meant to
- make testing easier but, can be used to allow better regular expressions
- if PCRE is available. If you want a regular expression that starts with
- \texttt{PCRE:} or \texttt{POSIX:} then you can enclose one of the
- characters in brackets like \texttt{[P]CRE:}.
-
- An example, included in the \rsrc\ file, is given below. Remember that you
- have to escape (with~\verb+!+) spaces and \verb+#+ as well as a few other
- characters. One should always use \verb+\nmid+ instead of \verb+\not\mid+
- because the results are much better.
- \begin{errexam}
- \verb+\\not! *(\||\\mid)+\\*
- \verb+User Regex: \not\mid.+\\*
- \end{errexam}
- or with an initial comment
- \begin{errexam}
- \verb+(?!#Always! use! \nmid)\\not! *(\||\\mid)+\\*
- \verb+User Regex: Always use \nmid.+
- \end{errexam}
-
- You can use \verb+% chktex 44+ to suppress user regular expression
- warnings on a given line, but this is often undesirable since all such
- warnings are suppressed this way. For this reason you can ``name'' user
- regular expression warnings with negative numbers. For example
- \verb+% chktex 4+ will suppress the system warning number 4, but
- \verb+% chktex -4+ will suppress the user regular expression warning
- number 4. Since one might wish to add, remove, or rearrange user warnings
- in the \rsrc\ file, you must explicitly name particular warnings rather
- than relying on position in that file.
-
- In order to name one, include an initial PCRE-style comment with the first
- characters being a number (positive or negative---the absolute value will
- be used). The numbers are limited by the number of bits in a \texttt{long},
- usually giving 1--63 as possible names. You can give more than one regular
- expression the same name, and suppressing that name will suppress all
- regular expressions with that name.
-
- Using the example from before, all of the following will be suppressed with
- \verb+% chktex -4+. Note that the name \emph{will} be printed as written
- so that you know which number to suppress.
- \begin{errexam}
- \verb+(?!#4:Always! use! \nmid)\\not! *(\||\\mid)+\\*
- \verb+(?!#-4Always! use! \nmid)\\not! *(\||\\mid)+\\*
- \verb+(?!#-4! Always! use! \nmid)\\not! *(\||\\mid)+\\*
- \end{errexam}
-\end{errdesc}
-
-\begin{errdesc}{Use \textbackslash[ ... \textbackslash] instead of \$\$ ... \$\$.}
-
- In \LaTeX\ documents, using \verb+\[...\]+ is strongly preferred over \verb+$$...$$+.
- This is because using \verb+$$+ will change the vertical spacing in the
- equations making them inconsistent.
-
-\end{errdesc}
-
-\begin{errdesc*}{Use \textbackslash( ... \textbackslash) instead of \$ ... \$.}
-
- In \LaTeX\ documents using \verb+\(...\)+ is slightly preferred over \verb+$...$+.
- Some error messages might be clearer with \verb+\(...\)+.
-
-\end{errdesc*}
-
-\section{Future plans}
-
-In a somewhat prioritized sequence, this is what I'd like to put into the
-program --- if I have the time.
-
-\begin{itemize}
-\item De-linearize the checker. Currently, it works on a line-by-line
- basis, in most respects, at least. I hope to be able to remove this
- barrier; as this will reduce the amount of false warnings
- somewhat.
-
-\item Probably some more warnings/errors; just have to think them out
- first. Suggestions are appreciated --- I've ``stolen'' most that
- similar programs provides, and am running out of ideas, really.
-
- It would also be nice to investigate the field of ``globally''
- oriented warnings; i.e.\ warnings regarding the document as a
- whole. Currently, \chktex\ operates mainly on a local/``greedy''
- basis.
-
- If you have suggestions/ideas on this topic, they're certainly
- welcome, including references to literature.
-
-\item Fix a few more bugs.
-\end{itemize}
-
-\section{Notes}
-
-\subsection{Wish to help?}
-
-As most other living creatures, I have only a limited amount of time. If
-you like \chktex\ and would like to help improving it, here's a few things
-I would like to receive. The following ideas are given:
-
-\begin{itemize}
-\item Does anyone have a $\mbox{\LaTeX}\rightarrow \mbox{\texttt{troff}}$
- conversion program? It would be really nice if I could extract the
- relevant sections from this manual, and present them as a man page.
- I will not, however, convert this manual to \TeX{}info in order to
- be able to do this; IMHO \TeX{}info documents have far too limited
- typographic possibilities.
-
- This doesn't mean that I'm not willing to restructure the document
- at all. This manual already uses some kind of preprocessing in order
- to achieve HTML output via \LaTeX2\texttt{html}, I'm willing to do the
- same in order to produce \texttt{troff} output.
-
-\item Help me port the program! This is a prioritized one. It's no fun
- writing ANSI C when people haven't got a C compiler.
-
- Of course, I'll provide whatever help necessary to modify the sources
- to fit to the new platform. Take contact if you're interested. I will
- include your compiled binary in the distribution, and give you
- credit where appropiate.
-
- Just one request: If you have to modify the sources in order to make
- \chktex\ compile \& work on the new platform, \emph{please} enclose your
- changes in something like \Cmd{\#ifdef \_\_PLATFORM\_\_\dots code\dots\#endif}!
- It makes life so much easier later, when we try to merge the two
- source trees.
-
-\item Reports on problems configuring and compiling \chktex\ on supported
- (and unsupported) systems are welcomed.
-
-\item Filters for other file formats. I do believe that there are
- several formats using \LaTeX\ for its formatting purposes, combining
- that with something else. If you can write a program or script which
- filters everything away but the \LaTeX\ code, it will surely be
- appreciated (and included). Look at the \verb@deweb@ script to see
- what I mean.
-
-\item Interfaces for other editors are also welcomed.
-
-\item If you update the \rsrc\ file in anyway that is not strictly
- local, I would appreciate to receive your updated version.
-
-\item Suggestions for new warnings are always welcomed. Both formal
- (i.e.\ regexps or similar) and non-formal (plain English) descriptions
- are welcomed.
-\end{itemize}
-
-Of course, people doing any of this will be mentioned in this document, and
-thus receive eternal glory and appreciation.
-
-\subsection{Caps and stuff}
-
-Where trademarks have been used, the author is aware of that they
-belong to someone, and has tried to stick to the original caps.
-
-\section{About the author}
-
-A quick summary of who I am and what I do:
-
-I'm 21 years old, and live in Oslo, the capital of Norway. I'm
-currently studying maths and computer science at the
-University~of~Oslo; planning to get a degree within mathematical
-modeling, with a dash of physics and emphazing the computer part of
-the study. More precisely, in autumn'96 my studies consist of
-mathematical analysis, statistics \& probability calculations plus
-studying the relationship between society and computers.
-
-At home I now possess 4 computers, of which 1 is regular use: A
-vanilla Amiga 1200, expanded only by a HD\@. The others are a
-\texttt{80286} PC and an Amiga 500, both semi-out-of-order. The last
-one is a Commodore VIC-20, which for some peculiar reason never seems
-to be used. Plans are to get a Linux-capable PC, though.
-
-Most of the time in front of these computers (including SGI Indy's and
-SPARC stations at our university) is spent on C and shell programming,
-plus some text-processing.
-
- % I am also involved in writing the document
- % for {\sc Isaac} --- Interactive Simulation as an Alternative to
- % Advanced Calculations. This is planned to help newcomers to physics,
- % by providing a computer program which enables one to simulate most
- % experiments relating to classical mechanics.
- %
-
-C and shell programming are not my only knowledge areas regarding
-computers, however. I write the following languages more or less:
-Perl, Motorola \texttt{68000} assembly code, ARexx, Simula, C++, \LaTeX,
-HTML, AmigaGuide, Amos Basic and Installer LISP\@. Once I also
-mastered Commodore Basic V2, the ``language'' included with my VIC-20.
-
-However, I also try to not to end up as a computer nerd. Thus, in
-addition to the compulsory (?) interest for computers, I am a scout.
-Still running into the woods, climbing the trees, falling down and
-climbing up once more, in other words. To be more specific, I am a
-now a troop leader for `Ulven' scout-group; Norwegian Scouts
-Association. I am also a active rover in `V{\aa}lerenga' scout-group.
-
-Certainly a lot more to tell (I play the piano and like cross-country
-skiing, for instance); but I'll stop here before you fall
-asleep\dots
-
-
-\section{Thanks}
-
-The author wishes to thank the following people (in alphabetical order):
-
-\def\Name#1#2{%
-\item[]
- \setbox0=\hbox{
- \begin{tabular}{l}
- \textbf{#1} \\
- \texttt{#2} \\
- \end{tabular}
- } \usebox0\\ }
-
-\begin{description}
-
- \Name{Russ Bubley}{russ@scs.leeds.ac.uk}
- He has been the main external beta-tester for this program, sending
- me loads and loads of understandable and reproducible bug reports.
- If you somehow think that \chktex\ is well-behaved and free from
- bugs, send warm thoughts to Russ. He has also provided ideas for
- enhanced checks and so forth.
-
- In addition, he sent me a huge list of 238 common English
- abbreviations, for inclusion in the \rsrc\ file! Together with the
- enhanced abbreviation recognizer, I do now believe most
- abbreviations should be caught\dots
-
- Finally, he has also given me valuable hints for improving the
- program's outputting routine, and given me lots of suggestions for
- filtering unnecessary/false warnings away.
-
- \Name{Gerd B\"ohm}{Gerd.Boehm@physik.uni-regensburg.de}
- Improved and bug-fixed the MS-DOS port of \chktex\ v1.4, sending me
- ready-to-yank code patches. The original port didn't respect all
- the peculiarities of the MS-DOS file-system, unfortunately.
-
- \Name{Antonio DiCesare}{dicesare@vodafone.it}
- He provided many feature requests and bug reports for the 1.7.1
- version making it a much better release than it would have otherwise
- been. He also helped expand several keywords in the \rsrc\ file.
-
- \Name{Mojca Miklavec}{mojca.miklavec.lists@gmail.com}
- Found and helped debug a problem (fixed in 1.7.2) occurring only on
- some platforms, 32 bit Macs for one.
-
- \Name{Baruch Even}{chktex@ev-en.org}
- Maintainer of \chktex\ for about a decade.
-
- \Name{Lars Frellesen}{frelle@math-tech.dk} Sent a few bug reports
- regarding the filtering of messages. He has also helped me to
- expand the \Cmd{SILENT} keyword in the \rsrc\ file.
-
- \Name{Wolfgang Fritsch}{fritsch@hmi.de}
- Author of the OS/2 port, which he did using the emx compiler.
- Please direct questions regarding strictly to that port to him (I
- would like to receive a carbon copy, though).
-
- \Name{Stefan Gerberding}{stefan@inferenzsysteme.informatik.th-darmstadt.de}
- First one to report the Enforcer hit in v1.2 when using \chktex\ as
- a pipe. Also came with suggestions to make \chktex\ more easily
- compile on early gcc compilers.
-
- He has also kept on beta-testing later versions of \chktex, giving
- me bug-reports and enhancements requests.
-
- \Name{Kasper B. Graversen}{kbg2001@internet.dk} Lots of creative
- suggestions and improvements. Several of the warnings implemented
- were based on his ideas. In addition, he has given advice for
- improving the existing warnings.
-
- Has also provided some OS-oriented code.
-
- \Name{Frank Luithle}{f\_luithle@outside.sb.sub.de}
- Wrote a translation for v1.0. Unfortunately, he remained unreachable
- after that\dots:-/
-
- \Name{Nat}{nat@nataa.frmug.fr.net}
- Reported the same bug as Gerberding. In addition, he taught me a
- few tricks regarding the use of gcc + made me understand that the
- ANSI standard isn't unambigious; at least the \verb@getenv()@ call
- seem to be open for interpretations. Many possible
- incompatibilities have been removed due to these lessons.
-
- \Name{Michael Sanders}{sanders@umich.edu}
- Has found some of the bugs in this beast; both obscure and
- long-lived. Has also provided motivation to clarify this document.
-
- \Name{Bj\o rn Ove Thue}{bjort@ifi.uio.no}
- Author of the MSDOS port; please direct questions regarding
- strictly to that port to him (I would like to receive a carbon
- copy, though).
-
- \Name{Martin Ward}{Martin.Ward@durham.ac.uk}
- Sent a few bug-reports; also gave me information upon where to find
- regexp code. He also provided a Perl script for checking ordinary
- text, which ideas I was able to implement in \chktex. In addition,
- he sent me the source code for \verb@lacheck@; which also inspired some
- of the warnings.
-\end{description}
-
-%endlatex
-\section{Contacting the author}
-
-If you wish to contact me for any reason or would like to participate in
-the development of \chktex, please write to:
-%latex
-\begin{samepage}
-%endlatex
- \begin{quote}
- Jens Berger \\
- Spektrumvn. 4 \\
- N-0666 Oslo \\
- Norway \\
- E-mail: \texttt{<jensthi@ifi.uio.no>}
- \end{quote}
-%latex
-\end{samepage}
-%endlatex
-Any signs of intelligent life are welcomed; that should exclude piracy.
-
-Since the original author is unreachable, the maintainer these days is:
-%latex
-\begin{samepage}
-%endlatex
- \begin{quote}
- Ivan Andrus \\
- E-mail: \texttt{<darthandrus@gmail.com>}
- \end{quote}
-%latex
-\end{samepage}
-%endlatex
-
-\medskip\noindent
-Have fun.
-
-\end{document}
-
-% The "Make" target is my own.
-% Local Variables:
-% TeX-command-default: "Make"
-% TeX-master: "ChkTeX.tex"
-% End:
diff --git a/Build/source/texk/chktex/Makefile.am b/Build/source/texk/chktex/Makefile.am
index 5f95522b897..b71b519eeb1 100644
--- a/Build/source/texk/chktex/Makefile.am
+++ b/Build/source/texk/chktex/Makefile.am
@@ -1,7 +1,7 @@
## $Id$
## Makefile.am for the TeX Live subdirectory texk/chktex/
##
-## Copyright 2017 Karl Berry <tex-live@tug.org>
+## Copyright 2017-2022 Karl Berry <tex-live@tug.org>
## Copyright 2010-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
@@ -88,7 +88,7 @@ uninstall-hook: uninstall-links
# resource file
configdir = $(datarootdir)/texmf-dist/chktex
-config_DATA = $(CHKTEX_TREE)/chktexrc
+config_DATA = $(CHKTEX_TREE)/../chktexrc
# documentation
pdfdocdir = $(datarootdir)/texmf-dist/doc/chktex
diff --git a/Build/source/texk/chktex/Makefile.in b/Build/source/texk/chktex/Makefile.in
index abf37a66092..1fc4a963113 100644
--- a/Build/source/texk/chktex/Makefile.in
+++ b/Build/source/texk/chktex/Makefile.in
@@ -638,7 +638,7 @@ texmf_SCRIPTS = $(CHKTEX_TREE)/chkweb.sh
# resource file
configdir = $(datarootdir)/texmf-dist/chktex
-config_DATA = $(CHKTEX_TREE)/chktexrc
+config_DATA = $(CHKTEX_TREE)/../chktexrc
# documentation
pdfdocdir = $(datarootdir)/texmf-dist/doc/chktex
diff --git a/Build/source/texk/chktex/TLpatches/ChangeLog b/Build/source/texk/chktex/TLpatches/ChangeLog
index c37fd290e4d..79ef79c976a 100644
--- a/Build/source/texk/chktex/TLpatches/ChangeLog
+++ b/Build/source/texk/chktex/TLpatches/ChangeLog
@@ -1,3 +1,8 @@
+2022-12-15 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * Import chktex-1.7.8.
+ * patch-04-finderrs: removed.
+
2016-09-15 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* Import chktex-1.7.6.
diff --git a/Build/source/texk/chktex/TLpatches/TL-Changes b/Build/source/texk/chktex/TLpatches/TL-Changes
index 1a8db085335..9c4a3c5de47 100644
--- a/Build/source/texk/chktex/TLpatches/TL-Changes
+++ b/Build/source/texk/chktex/TLpatches/TL-Changes
@@ -1,6 +1,6 @@
-Changes applied to the chktex-1.7.6 tree as obtained from:
+Changes applied to the chktex-1.7.8 tree as obtained from:
http://mirror.ctan.org/support/chktex/
- http://download.savannah.gnu.org/releases/chktex/chktex-1.7.6.tar.gz
+ http://download.savannah.gnu.org/releases/chktex/chktex-1.7.8.tar.gz
Remove:
aclocal.m4
@@ -8,6 +8,13 @@ Remove:
configure
install-sh
stamp-h.in
+ m4/
Rename:
chkweb -> chkweb.sh
+
+Moved to top directory:
+ ChkTeX.pdf
+
+Generate chktexrc in the top directory:
+ perl MakeChkTeXRC.pl --chktexrc chktexrc.in >chktexrc
diff --git a/Build/source/texk/chktex/TLpatches/patch-04-finderrs b/Build/source/texk/chktex/TLpatches/patch-04-finderrs
deleted file mode 100644
index 1717fc972db..00000000000
--- a/Build/source/texk/chktex/TLpatches/patch-04-finderrs
+++ /dev/null
@@ -1,19 +0,0 @@
-diff -ur chktex.orig/FindErrs.c chktex/FindErrs.c
---- chktex.orig/FindErrs.c Sat Sep 10 06:22:18 2016
-+++ chktex/FindErrs.c Fri Sep 16 14:09:38 2016
-@@ -1872,7 +1872,6 @@
- }
- else
- {
-- FoundErr = EXIT_FAILURE;
- Context = LaTeXMsgs[Error].Context;
-
- if (!HeadErrOut)
-@@ -1892,6 +1891,7 @@
- break;
- case etErr:
- ErrPrint++;
-+ FoundErr = EXIT_FAILURE;
- break;
- case etMsg:
- break;
diff --git a/Build/source/texk/chktex/chktex-src/ChkTeX.c b/Build/source/texk/chktex/chktex-src/ChkTeX.c
index fd7812401a3..bf4386b4a53 100644
--- a/Build/source/texk/chktex/chktex-src/ChkTeX.c
+++ b/Build/source/texk/chktex/chktex-src/ChkTeX.c
@@ -46,15 +46,13 @@ struct ErrMsg PrgMsgs[pmMaxFault + 1] = {
PRGMSGS {(enum ErrNum)pmMaxFault, etErr, TRUE, 0, INTERNFAULT}
};
-struct Stack CharStack = {
- 0L
-}, InputStack =
-
-{
-0L}, EnvStack =
-
-{
-0L};
+struct Stack CharStack = {0L};
+struct Stack InputStack = {0L};
+struct Stack EnvStack = {0L};
+struct Stack ConTeXtStack = {0L};
+struct Stack FileSuppStack = {0L};
+struct Stack UserFileSuppStack = {0L};
+struct Stack MathModeStack = {0L};
/************************************************************************/
@@ -71,8 +69,8 @@ unsigned long Brackets[NUMBRACKETS];
*/
-NEWBUF(TmpBuffer, BUFSIZ);
-NEWBUF(ReadBuffer, BUFSIZ);
+NEWBUF(TmpBuffer, BUFFER_SIZE);
+NEWBUF(ReadBuffer, BUFFER_SIZE);
static const char *Banner =
"ChkTeX v" PACKAGE_VERSION " - Copyright 1995-96 Jens T. Berger Thielemann.\n"
@@ -144,8 +142,11 @@ static const char *HelpText =
" -h --help : This text.\n"
" -i --license : Show distribution information\n"
" -l --localrc : Read local .chktexrc formatted file.\n"
- " -d --debug : Debug information. Give it a number.\n"
+ " -d --debug : Debug information. A bit field with 5 bits.\n"
+ " Each bit shows a different type of information.\n"
" -r --reset : Reset settings to default.\n"
+ " -S --set : Read it's argument as if from chktexrc.\n"
+ " e.g., -S TabSize=8 will override the TabSize.\n"
"\n"
"Muting warning messages:\n"
"~~~~~~~~~~~~~~~~~~~~~~~~\n"
@@ -153,7 +154,7 @@ static const char *HelpText =
" -e --erroron : Makes msg # given an error and turns it on.\n"
" -m --msgon : Makes msg # given a message and turns it on.\n"
" -n --nowarn : Mutes msg # given.\n"
- " -L --nolinesupp: Disables per-line suppressions.\n"
+ " -L --nolinesupp: Disables per-line and per-file suppressions.\n"
"\n"
"Output control flags:\n"
"~~~~~~~~~~~~~~~~~~~~~\n"
@@ -173,7 +174,7 @@ static const char *HelpText =
" -x --wipeverb : Ignore contents of `\\verb' commands.\n"
" -g --globalrc : Read global .chktexrc file.\n"
" -I --inputfiles: Execute \\input statements.\n"
- " -H --headererr : Show errors found in front of \\begin{document}\n"
+ " -H --headererr : Show errors found before \\begin{document}\n"
"\n"
"Miscellaneous switches:\n"
"~~~~~~~~~~~~~~~~~~~~~~~\n"
@@ -182,7 +183,17 @@ static const char *HelpText =
"----------------------------------------------------------------------\n"
"If no LaTeX files are specified on the command line, we will read from\n"
"stdin. For explanation of warning/error messages, please consult the\n"
- "main documentation ChkTeX.dvi, ChkTeX.ps or ChkTeX.pdf.\n";
+ "main documentation ChkTeX.dvi, ChkTeX.ps or ChkTeX.pdf:\n"
+ " http://www.nongnu.org/chktex/ChkTeX.pdf\n"
+ "\n"
+ "Any of the above arguments can be made permanent by setting them in the\n"
+ "chktexrc file "
+#if defined(__unix__)
+ "(~/.chktexrc).\n"
+#else
+ "(see documentation for location).\n"
+#endif
+ ;
@@ -194,6 +205,8 @@ static const char *HelpText =
enum Quote Quote;
+enum CmdSpace CmdSpace;
+
char VerbNormal[] = "%k %n in %f line %l: %m\n" "%r%s%t\n" "%u\n";
#define DEF(type, name, value) type name = value
@@ -321,7 +334,7 @@ static void ExpandTabs(char *From, char *To, long TSize, long MaxDiff)
Diff = MaxDiff+1;
if ( !HasExpandedTooLong )
{
- PrintPrgErr(pmTabExpands, BUFSIZ);
+ PrintPrgErr(pmTabExpands, BUFFER_SIZE);
}
HasExpandedTooLong = 1;
}
@@ -335,6 +348,19 @@ static void ExpandTabs(char *From, char *To, long TSize, long MaxDiff)
strcpy(To, From);
}
+void ReadRcFiles(void)
+{
+ unsigned long i;
+ while (SetupVars())
+ {
+ InsertWord(ConfigFile, &ConfigFiles);
+ }
+ FORWL(i, ConfigFiles)
+ {
+ ReadRC(ConfigFiles.Stack.Data[i]);
+ }
+}
+
int main(int argc, char **argv)
{
@@ -370,8 +396,7 @@ int main(int argc, char **argv)
RESOURCE_INFO
- while (SetupVars())
- ReadRC(ConfigFile);
+ ReadRcFiles();
if (CmdLine.Stack.Used)
{
@@ -432,6 +457,22 @@ int main(int argc, char **argv)
Quote = quTrad;
}
}
+ if (CmdSpaceStyle)
+ {
+ if (!strcasecmp(CmdSpaceStyle, "IGNORE"))
+ CmdSpace = csIgnore;
+ else if (!strcasecmp(CmdSpaceStyle, "INTERWORD"))
+ CmdSpace = csInterWord;
+ else if (!strcasecmp(CmdSpaceStyle, "INTERSENTENCE"))
+ CmdSpace = csInterSentence;
+ else if (!strcasecmp(CmdSpaceStyle, "BOTH"))
+ CmdSpace = csBoth;
+ else
+ {
+ PrintPrgErr(pmCmdSpaceStyle, CmdSpaceStyle);
+ CmdSpace = csIgnore;
+ }
+ }
if (DebugLevel)
ShowIntStatus();
@@ -471,6 +512,7 @@ int main(int argc, char **argv)
if (CurArg < argc)
filename = argv[CurArg++];
+ AddDirectoryFromRelativeFile(filename,&TeXInputs);
if (!PushFileName(filename, &InputStack))
break;
}
@@ -481,7 +523,7 @@ int main(int argc, char **argv)
while (!ferror(OutputFile)
&& StkTop(&InputStack)
&& !ferror(CurStkFile(&InputStack))
- && FGetsStk(ReadBuffer, BUFSIZ - 1,
+ && FGetsStk(ReadBuffer, BUFFER_SIZE - 1,
&InputStack))
{
@@ -489,7 +531,8 @@ int main(int argc, char **argv)
strrep(ReadBuffer, '\n', ' ');
strrep(ReadBuffer, '\r', ' ');
- ExpandTabs(ReadBuffer, TmpBuffer, Tab, BUFSIZ - 1 - strlen(ReadBuffer) );
+ ExpandTabs(ReadBuffer, TmpBuffer, Tab,
+ BUFFER_SIZE - 1 - strlen(ReadBuffer));
strcpy(ReadBuffer, TmpBuffer);
strcat(ReadBuffer, " ");
@@ -665,6 +708,7 @@ static void ShowIntStatus(void)
if (DebugLevel & (FLG_DbgListInfo | FLG_DbgListCont))
{
+ ShowWL("ConfigFilesRead", &ConfigFiles);
RESOURCE_INFO
}
@@ -797,6 +841,7 @@ static int ParseArgs(int argc, char **argv)
{"pipeverb", optional_argument, 0L, 'V'},
{"debug", required_argument, 0L, 'd'},
{"reset", no_argument, 0L, 'r'},
+ {"set", required_argument, 0L, 'S'},
{"quiet", no_argument, 0L, 'q'},
{"license", no_argument, 0L, 'i'},
{"splitchar", required_argument, 0L, 's'},
@@ -833,7 +878,7 @@ static int ParseArgs(int argc, char **argv)
while (!ArgErr &&
((c = getopt_long((int) argc, argv,
- "b::d:e:f:g::hH::I::il:m:n:Lo:p:qrs:t::v::V::w:Wx::",
+ "b::d:e:f:g::hH::I::il:m:n:Lo:p:qrs:S:t::v::V::w:Wx::",
long_options, &option_index)) != EOF))
{
while (c)
@@ -841,6 +886,10 @@ static int ParseArgs(int argc, char **argv)
nextc = 0;
switch (c)
{
+ case 'S':
+ ReadRCFromCmdLine(optarg);
+ break;
+
case 's':
if (!(Delimit = strdup(optarg)))
{
diff --git a/Build/source/texk/chktex/chktex-src/ChkTeX.h b/Build/source/texk/chktex/chktex-src/ChkTeX.h
index 01275d38b05..8d1c4b4ed7f 100644
--- a/Build/source/texk/chktex/chktex-src/ChkTeX.h
+++ b/Build/source/texk/chktex/chktex-src/ChkTeX.h
@@ -233,7 +233,7 @@ DEBUGBITS(Debug_BIT)
MSG(pmNoRsrc, etWarn, TRUE, 0,\
"Could not find global resource file.")\
MSG(pmQuoteStyle, etWarn, TRUE, 0,\
- "Illegal quotestyle `%s'.")\
+ "Illegal quotestyle `%s' using `Traditional'.")\
MSG(pmWrongWipeTemp, etWarn, TRUE, 0,\
"Wrong template for wiping arguments, \"%s\"")\
MSG(pmSpecifyTerm, etErr, TRUE, 0,\
@@ -261,7 +261,9 @@ DEBUGBITS(Debug_BIT)
MSG(pmLongLines, etWarn, TRUE, 0,\
"ChkTeX does not handle lines over %d bytes correctly. Some errors and line numbers may be wrong in this file.") \
MSG(pmTabExpands, etWarn, TRUE, 0,\
- "ChkTeX could not fully expand tabs because the resulting line would be more than %d bytes. Some errors and line numbers may be wrong in this file.")
+ "ChkTeX could not fully expand tabs because the resulting line would be more than %d bytes. Some errors and line numbers may be wrong in this file.") \
+MSG(pmCmdSpaceStyle, etWarn, TRUE, 0,\
+ "Illegal CmdSpaceStyle `%s' using `Ignore'.")
#undef MSG
#define MSG(num, type, inuse, ctxt, text) num,
@@ -330,20 +332,19 @@ extern FILE *OutputFile, *InputFile;
DEF(int, AtLetter, FALSE); /* Whether `@' is a letter or not. */ \
DEF(int, InHeader, TRUE); /* Whether we're in the header */ \
DEF(int, VerbMode, FALSE); /* Whether we're in complete ignore-mode */ \
- DEF(long, MathMode, 0); /* Whether we're in math mode or not */ \
DEF(const char *, VerbStr, ""); /* String we'll terminate verbmode upon */ \
DEF(unsigned long, ErrPrint, 0); /* # errors printed */ \
DEF(unsigned long, WarnPrint, 0); /* # warnings printed */ \
DEF(unsigned long, UserSupp, 0); /* # user suppressed warnings */ \
- DEF(unsigned long, LineSupp, 0); /* # warnings suppressed on a single line */ \
- DEF(uint64_t, FileSuppressions, 0); /* # warnings suppressed in a file */ \
- DEF(uint64_t, UserFileSuppressions, 0) /* # User warnings suppressed in a file */
+ DEF(unsigned long, LineSupp, 0); /* # warnings suppressed on a single line */
#define DEF(type, name, value) extern type name
OPTION_DEFAULTS;
STATE_VARS;
#undef DEF
-extern struct Stack CharStack, InputStack, EnvStack;
+extern struct Stack CharStack, InputStack, EnvStack, ConTeXtStack;
+extern struct Stack FileSuppStack, UserFileSuppStack;
+extern struct Stack MathModeStack;
enum Quote
{
@@ -354,6 +355,15 @@ enum Quote
extern enum Quote Quote;
extern int StdInTTY, StdOutTTY, UsingStdIn;
+enum CmdSpace
+{
+ csIgnore = 0,
+ csInterWord = 0x1,
+ csInterSentence = 0x2,
+ csBoth = 0x3, /* both bits set */
+};
+extern enum CmdSpace CmdSpace;
+
int main(int argc, char **argv);
void PrintPrgErr(enum PrgErrNum, ...);
void ErrPrintf(const char *fmt, ...);
diff --git a/Build/source/texk/chktex/chktex-src/ChkTeX.tex.in b/Build/source/texk/chktex/chktex-src/ChkTeX.tex.in
index 353322abfc0..3fbba08f560 100644
--- a/Build/source/texk/chktex/chktex-src/ChkTeX.tex.in
+++ b/Build/source/texk/chktex/chktex-src/ChkTeX.tex.in
@@ -54,11 +54,35 @@
{\noindent\large%
\begin{tabularx}{\linewidth}{lY}%
\bf Warning \theerrornum: & \texttt{#1}%
- \end{tabularx}}\stepcounter{errornum}\nopagebreak[4]}
+ \end{tabularx}}\stepcounter{errornum}\nopagebreak[4]}
+
+\newcommand{\fmtrc}[1]{%
+ {\noindent\large%
+ %% \begin{tabularx}{\linewidth}{lY}%
+ \phantomsection%
+ \bf\texttt{#1}%
+ \label{rc:#1}
+ %% \end{tabularx}
+ }\nopagebreak[4]}
\newenvironment{errdesc}[1]{\noindent\fmted{#1}\begin{quote}}{\end{quote}%
\pagebreak[3]}
+\newcommand\Keyword[1]{\marginpar{\texttt{\hfill\hyperref[rc:#1]{#1}}}}
+\newcommand{\chktexrcdefault}{\noindent The default value is}
+\newenvironment{chktexrcvar}[2]{%
+ \smallskip\pagebreak[2]%
+ %% \Keyword{#1}
+ \fmtrc{#1} #2 Variable%
+ \begin{quote}}{%
+ \end{quote}\pagebreak[3]}
+\newenvironment{chktexrcsimplevar}[1]{\begin{chktexrcvar}{#1}{Simple}}{\end{chktexrcvar}}
+\newenvironment{chktexrclistvar}[1]{\begin{chktexrcvar}{#1}{List}}{\end{chktexrcvar}}
+\newenvironment{chktexrclistvar*}[1]{\begin{chktexrcvar}{#1}{Lowercase-able List}}{\end{chktexrcvar}}
+
+%% \newenvironment{chktexrclistvar}[1]{\fmtrc{#1}List Variable}{}
+%% \newenvironment{chktexrclistvar*}[1]{\fmtrc{#1}List Variable with Lowercase}{}
+
\newenvironment{html}{\comment}{\endcomment}
\newenvironment{rawhtml}{\comment}{\endcomment}
@@ -81,6 +105,15 @@
%!\newcommand{\slash}{/}
%endlatex
+% PDF table of contents
+\usepackage{hyperref}
+\hypersetup{
+ colorlinks=true,
+ allcolors=blue,
+ pdfpagemode=UseOutlines
+}
+\usepackage{hypcap}
+
\title{\chktex\ v@PACKAGE_VERSION@}
\author{Jens~T. Berger~Thielemann}
@@ -370,7 +403,7 @@ A few words on installation on various platforms:
\paragraph{Note:} You \emph{must} install the new \rsrc\ file; \chktex\ will
fail to function otherwise!
- After doing this, you may enhance \chktex' behaviour by
+ After doing this, you may enhance \chktex's behaviour by
reading/editing the \rsrc\ file.
%latex
@@ -391,7 +424,7 @@ A UNIX-compliant template format follows:
\end{tabularx}
-\subsubsection{Options}
+\subsubsection{Comamndline Options}
These are the options \chktex\ currently accepts.
Please note that single-lettered options requiring a numerical or no
@@ -510,6 +543,7 @@ File:Line:Column:Warning number:Warning message
longer time to parse, but much more informative in use.
\end{description}
+ \phantomsection\label{clarg:format}%
\item[\texttt{-f [-{}-format]}] Specifies the format of the output.
This is done using a format similar to \Cmd{printf()}, where we
support the specifiers listed below.
@@ -739,6 +773,10 @@ The syntax is nearly the same, namely
\verb+% chktex-file ##+
\end{center}
+
+\input{ChkTeXRC.tex}
+
+
\subsubsection{Hints}
I've tried to collect some advice that may be useful --- if you have a
favourite hint, feel free to send it to me!
@@ -863,10 +901,9 @@ Error messages set in {\it italic type\/} are turned off by default.
Where margin paragraphs are listed in the text, they refer to the
keyword in the \rsrc\ file which controls the discussed warning.
-\newcommand\Keyword[1]{\marginpar{\texttt{\hfill\\ #1}}}
-
\smallskip\pagebreak[2]
-\Keyword{Silent}
+\phantomsection
+\Keyword{Silent}\label{warn:silent}
\begin{errdesc}{Command terminated with space.}
You tried to terminate a command with a blank space. Usually, this
is an error as these are ignored by \LaTeX. In most cases, you would
@@ -917,7 +954,9 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errexam}
\end{errdesc}
-\Keyword{Italic\\ItalCmd\\NonItalic}
+\Keyword{Italic}
+\Keyword{ItalCmd}
+\Keyword{NonItalic}
\begin{errdesc}{Italic correction (`\BS/') found in non-italic
buffer.}
If you try to use the \verb@\/@ command when \chktex\ believes that
@@ -932,7 +971,9 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errexam}
\end{errdesc}
-\Keyword{Italic\\ItalCmd\\NonItalic}
+\Keyword{Italic}
+\Keyword{ItalCmd}
+\Keyword{NonItalic}
\begin{errdesc}{Italic correction (`\BS/') found more than once.}
If the buffer is italic, and you try to use the \verb@\/@ command
more than once, you'll get this warning.
@@ -946,7 +987,9 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errexam}
\end{errdesc}
-\Keyword{Italic\\ItalCmd\\NonItalic}
+\Keyword{Italic}
+\Keyword{ItalCmd}
+\Keyword{NonItalic}
\begin{errdesc}{No italic correction (`\BS/') found.}
You get this error if \chktex\ believes that you are switching from
italic to non-italic, and you've forgot to use the \verb@\/@ command
@@ -977,7 +1020,10 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errexam}
\end{errdesc}
-\Keyword{HyphDash\\NumDash\\WordDash\\DashExcpt}
+\Keyword{HyphDash}
+\Keyword{NumDash}
+\Keyword{WordDash}
+\Keyword{DashExcpt}
\begin{errdesc}{Wrong length of dash may have been used.}
This warning suggests that a wrong number of dashes may have been
used. It does this by classifying the dash according to the the
@@ -1036,7 +1082,8 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errdesc}
-\Keyword{CenterDots\\LowDots}
+\Keyword{CenterDots}
+\Keyword{LowDots}
\begin{errdesc}{You should use `\%s' to achieve an ellipsis.}
Simply typing three \Cmd{.} in a row will not give a perfect spacing
between the dots. The \verb@\ldots@ is much more suitable for this.
@@ -1057,33 +1104,42 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errexam}
\end{errdesc}
+\phantomsection
+\label{warn:interword}
\Keyword{Abbrev}
+\Keyword{CmdSpaceStyle}
\begin{errdesc}{Interword spacing (`\BS\ ') should perhaps be used.}
One of the specified abbreviations were found. Unless you have
previously said \verb@\frenchspacing@, you'll have incorrect
- spacing, which one should avoid if possible.
+ spacing, which one should avoid if possible. The error will be suppressed
+ if you have used \verb@\frenchspacing@.
You can also specify case-insensitive abbreviations in \texttt{[]}, though
only the first letter is actually case-insensitive.
\begin{errexam}
- \verb@This is an example, i.e.@\underline{\tt\ }\verb@an demonstration.@ \\*
- This is an example, i.e. an demonstration. \\*
+ \verb@This is an example, i.e.@\underline{\tt\ }\verb@a demonstration.@ \\*
+ This is an example, i.e. a demonstration. \\*
\smallskip
- \verb@This is an example, i.e.\ an demonstration.@ \\*
- This is an example, i.e.\ an demonstration. \\*
+ \verb@This is an example, i.e.\ a demonstration.@ \\*
+ This is an example, i.e.\ a demonstration. \\*
\end{errexam}
\end{errdesc}
+\phantomsection
+\label{warn:intersentence}
+\Keyword{CmdSpaceStyle}
\begin{errdesc}{Intersentence spacing (`\BS{}@') should perhaps be used.}
- \LaTeX' detection of whether a period ends a sentence or not, is
+ \LaTeX's detection of whether a period ends a sentence or not, is
only based upon the character in front of the period. If it's
uppercase, it assumes that it does not end a sentence. While this
may be correct in many cases, it may be incorrect in others.
\chktex\ thus outputs this warning in every such case.
+ The error will be suppressed if you have used \verb@\frenchspacing@.
+
\begin{errexam}
\verb@I've seen an UFO!@\underline{\tt\ }\verb@Right over there!@ \\*
I've seen an UFO! Right over there! \\*
@@ -1119,7 +1175,7 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errdesc}
\Keyword{MathEnvir}
-\begin{errdesc}{Mathmode still on at end of LaTeX file.}
+\begin{errdesc}{Mathmode still on at end of LaTeX file.}
This error is triggered if you at some point have turned on
mathmode, and \chktex\ couldn't see that you remembered to turn it
off.
@@ -1149,13 +1205,13 @@ keyword in the \rsrc\ file which controls the discussed warning.
"'" (ASCII 180).} On some keyboards you might get the wrong quote.
This quote looks, IMHO, \emph{ugly} compared to the standard
quotes, it doesn't even come out as a quote! Just see in the
- example.
-
+ example. In fact, this doesn't even compile anymore, so the warning is
+ probably obsolete.
\begin{errexam}
\verb@``There@\underline{\tt '}\verb@s quotes and there@\underline{\tt '}\verb@s quotes@
\underline{\tt ''} \\* % ''
- ``There´s quotes and there´s quotes´´ \\* % ''
+ % ``There´s quotes and there´s quotes´´ \\* % ''
\smallskip
\verb@``There's quotes and there's quotes''@ \\*
``There's quotes and there's quotes'' \\*
@@ -1265,7 +1321,9 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errdesc}
-\Keyword{Italic\\ItalCmd\\NonItalic}
+\Keyword{Italic}
+\Keyword{ItalCmd}
+\Keyword{NonItalic}
\begin{errdesc}{Don't use \BS/ in front of small punctuation.}
Italic correction should generally \emph{not} be used in front of
small punctuation characters like `.' and `,'; as it looks better
@@ -1317,7 +1375,6 @@ keyword in the \rsrc\ file which controls the discussed warning.
derivations of that, ignore all text on the same line as
\verb@\end{verbatim}@. This will warn you about this.
-
\end{errdesc}
\fmted{Use ` to begin quotation, not '.}\hfill\\
@@ -1434,7 +1491,7 @@ keyword in the \rsrc\ file which controls the discussed warning.
\begin{errdesc}{You should put punctuation outside inner/inside
display math mode.}
As recommended in the \TeX{}book, you should try to put punctuation
- outside inner math mode, as this is gets formatted better.
+ outside inner math mode, as it is formatted better.
Similarily, you should let any final punctuation in display math
mode end up within it. Look at the following example, which was
@@ -1562,6 +1619,28 @@ keyword in the \rsrc\ file which controls the discussed warning.
\end{errdesc*}
+\fmted{`\%s' expected, found `\%s' (ConTeXt).}
+\begin{errdesc}{Solo `\%s' found (ConTeXt).}
+
+% \begin{errdesc}{`\%s' expected, found `\%s' (ConTeXt).}
+
+ Similar to warnings~9 and 10, these tracks environments, but Con\TeX{}t{} environments rather than \LaTeX.
+ They are tracked as separate messages to allow being turned on and off independently thereby allowing people to use macros that start with \verb+\start+.
+
+\end{errdesc}
+
+\begin{errdesc}{Expected math mode to be \%s here.}
+
+ Similar to warning~16, this warns when \chktex{} got confused about math mode.
+ In theory, for a well formed \LaTeX{} document this should never happen, but the following (invalid) documents will cause the warning.
+ This is because the \verb+$+ will exit math mode (which \verb+\ensuremath+ entered), and then exiting \verb+\ensuremath+ finds that we are in text mode which shouldn't happen.
+
+ \begin{errexam}
+ \verb+\ensuremath{ \frac{x}{3} $ y\times 7}+\\*
+ \end{errexam}
+
+\end{errdesc}
+
\section{Future plans}
In a somewhat prioritized sequence, this is what I'd like to put into the
diff --git a/Build/source/texk/chktex/chktex-src/FindErrs.c b/Build/source/texk/chktex/chktex-src/FindErrs.c
index 994ae83e2b2..00ca49f48e0 100644
--- a/Build/source/texk/chktex/chktex-src/FindErrs.c
+++ b/Build/source/texk/chktex/chktex-src/FindErrs.c
@@ -54,6 +54,7 @@ int NumRegexes = 0;
int FoundErr = EXIT_SUCCESS;
int LastWasComment = FALSE;
int SeenSpace = FALSE;
+int FrenchSpacing = FALSE;
/***************************** ERROR MESSAGES ***************************/
@@ -77,10 +78,10 @@ static int my_##func(int c) \
((LaTeXMsgs[(enum ErrNum) c].InUse == iuOK) && !SUPPRESSED_ON_LINE(c))
#define PSERR2(pos,len,err,a,b) \
- PrintError(CurStkName(&InputStack), RealBuf, pos, len, Line, err, a, b)
+ PrintError(err, CurStkName(&InputStack), RealBuf, pos, len, Line, a, b)
#define PSERRA(pos,len,err,a) \
- PrintError(CurStkName(&InputStack), RealBuf, pos, len, Line, err, a)
+ PrintError(err, CurStkName(&InputStack), RealBuf, pos, len, Line, a)
#define HEREA(len, err, a) PSERRA(BufPtr - Buf - 1, len, err, a)
#define PSERR(pos,len,err) PSERRA(pos,len,err,"")
@@ -124,6 +125,15 @@ static const char LTX_GenPunc[] = { ',', ';', 0 };
static const char LTX_SmallPunc[] = { '.', ',', 0 };
/*
+ * A list of characters that could be considered to start a new
+ * sentence, or not.
+ *
+ * This allows "Mr. ``X'' " to warn about the same as "Mr. X".
+ *
+ */
+static const char LTX_BosPunc[] = {'`', '(', '[', 0};
+
+/*
* String used to delimit a line suppression. This string must be
* followed immediately by the number of the warning to be suppressed.
* If more than one warning is to be suppressed, then multiple copies
@@ -157,9 +167,9 @@ static char *BufPtr;
static int ItFlag = efNone;
static int MathFlag = efNone;
-NEWBUF(Buf, BUFSIZ);
-NEWBUF(CmdBuffer, BUFSIZ);
-NEWBUF(ArgBuffer, BUFSIZ);
+NEWBUF(Buf, BUFFER_SIZE);
+NEWBUF(CmdBuffer, BUFFER_SIZE);
+NEWBUF(ArgBuffer, BUFFER_SIZE);
static enum ErrNum PerformCommand(const char *Cmd, char *Arg);
@@ -300,9 +310,8 @@ static char *PreProcess(void)
char *TmpPtr;
/* Reset any line suppressions */
-
- LineSuppressions = FileSuppressions;
- UserLineSuppressions = UserFileSuppressions;
+ LineSuppressions = *(uint64_t *)StkTop(&FileSuppStack);
+ UserLineSuppressions = *(uint64_t *)StkTop(&UserFileSuppStack);
/* Kill comments. */
strcpy(Buf, RealBuf);
@@ -349,15 +358,16 @@ static char *PreProcess(void)
{
PrintPrgErr(pmSuppTooHigh, error, MaxSuppressionBits);
}
+ uint64_t errbit = ((uint64_t)1 << abs(error));
if (error > 0)
{
- FileSuppressions |= ((uint64_t)1 << error);
- LineSuppressions |= ((uint64_t)1 << error);
+ *(uint64_t *)StkTop(&FileSuppStack) |= errbit;
+ LineSuppressions |= errbit;
}
else
{
- UserFileSuppressions |= ((uint64_t)1 << (-error));
- UserLineSuppressions |= ((uint64_t)1 << (-error));
+ *(uint64_t *)StkTop(&UserFileSuppStack) |= errbit;
+ UserLineSuppressions |= errbit;
}
}
TmpPtr = EscapePtr;
@@ -395,12 +405,30 @@ static char *PreProcess(void)
static void PerformEnv(char *Env, int Begin)
{
- static char VBStr[BUFSIZ] = "";
+ static char VBStr[BUFFER_SIZE] = "";
if (HasWord(Env, &MathEnvir))
{
- MathMode += Begin ? 1 : -1;
- MathMode = max(MathMode, 0);
+ if (Begin)
+ PushMode(TRUE, &MathModeStack);
+ else
+ {
+ if (!CurStkMode(&MathModeStack))
+ PSERRA(BufPtr - Buf - 4, 1, emMathModeConfusion, "on");
+ StkPop(&MathModeStack);
+ }
+ }
+
+ if (HasWord(Env, &TextEnvir))
+ {
+ if (Begin)
+ PushMode(FALSE, &MathModeStack);
+ else
+ {
+ if (CurStkMode(&MathModeStack))
+ PSERRA(BufPtr - Buf - 4, 1, emMathModeConfusion, "off");
+ StkPop(&MathModeStack);
+ }
}
if (Begin && HasWord(Env, &VerbEnvir))
@@ -453,7 +481,7 @@ static enum DotLevel CheckDots(char *PrePtr, char *PstPtr)
int TmpC;
enum DotLevel Front = dtUnknown, Back = dtUnknown;
- if (MathMode)
+ if (CurStkMode(&MathModeStack))
{
PrePtr--;
#define SKIP_EMPTIES(macro, ptr) macro(ptr, TmpC, \
@@ -625,11 +653,10 @@ static void PerformBigCmd(char *CmdPtr)
SKIP_AHEAD(TmpPtr, TmpC, TmpC == '{'); /* } */
if ((*TmpPtr == 'i') || (*TmpPtr == 'j'))
- PrintError(CurStkName(&InputStack), RealBuf,
- CmdPtr - Buf,
- (long) strlen(CmdBuffer), Line,
- emAccent, CmdBuffer, *TmpPtr,
- MathMode ? "math" : "");
+ PrintError(emAccent, CurStkName(&InputStack), RealBuf,
+ CmdPtr - Buf, (long)strlen(CmdBuffer), Line,
+ CmdBuffer, *TmpPtr,
+ CurStkMode(&MathModeStack) ? "math" : "");
}
else
PSERR(CmdPtr - Buf, CmdLen, emNoArgFound);
@@ -670,18 +697,18 @@ static void PerformBigCmd(char *CmdPtr)
if ((ei = PopErr(&EnvStack)))
{
if (strcmp(ei->Data, ArgBuffer))
- PrintError(CurStkName(&InputStack), RealBuf,
+ PrintError(emExpectC, CurStkName(&InputStack), RealBuf,
CmdPtr - Buf,
(long) strlen(CmdBuffer),
- Line, emExpectC, ei->Data, ArgBuffer);
+ Line, ei->Data, ArgBuffer);
FreeErrInfo(ei);
}
else
- PrintError(CurStkName(&InputStack), RealBuf,
+ PrintError(emSoloC, CurStkName(&InputStack), RealBuf,
CmdPtr - Buf,
(long) strlen(CmdBuffer),
- Line, emSoloC, ArgBuffer);
+ Line, ArgBuffer);
}
PerformEnv(ArgBuffer, (int) CmdBuffer[1] == 'b');
@@ -697,28 +724,28 @@ static void PerformBigCmd(char *CmdPtr)
{
TmpPtr = CmdBuffer + 6;
if (!(PushErr(TmpPtr, Line, CmdPtr - Buf + 6,
- CmdLen - 6, RealBuf, &EnvStack)))
+ CmdLen - 6, RealBuf, &ConTeXtStack)))
PrintPrgErr(pmNoStackMem);
}
else
{
TmpPtr = CmdBuffer + 5;
- if ((ei = PopErr(&EnvStack)))
+ if ((ei = PopErr(&ConTeXtStack)))
{
if (strcmp(ei->Data, TmpPtr))
- PrintError(CurStkName(&InputStack), RealBuf,
+ PrintError(emExpectConTeXt, CurStkName(&InputStack), RealBuf,
CmdPtr - Buf + 5,
(long) strlen(TmpPtr),
- Line, emExpectC, ei->Data, TmpPtr);
+ Line, ei->Data, TmpPtr);
FreeErrInfo(ei);
}
else
{
- PrintError(CurStkName(&InputStack), RealBuf,
+ PrintError(emSoloC, CurStkName(&InputStack), RealBuf,
CmdPtr - Buf,
(long) strlen(CmdBuffer),
- Line, emSoloC, TmpPtr);
+ Line, TmpPtr);
}
}
/* TODO: Do I need to call PerformEnv? */
@@ -776,8 +803,13 @@ static void CheckAbbrevs(const char *Buffer)
for (i = Abbrev.MaxLen; i >= 0; i--)
{
*--TmpPtr = *AbbPtr--;
- if (!isalpha((unsigned char)*AbbPtr) && HasWord(TmpPtr, &Abbrev))
+ if (!isalpha((unsigned char)*AbbPtr) &&
+ /* Ignore spacing problems after commands if desired */
+ (*AbbPtr != '\\' || (CmdSpace & csInterWord)) &&
+ HasWord(TmpPtr, &Abbrev))
+ {
PSERR(Buffer - Buf + 1, 1, emInterWord);
+ }
if (!*AbbPtr)
break;
}
@@ -1026,7 +1058,7 @@ static void CheckDash(void)
SKIP_AHEAD(TmpPtr, TmpC, TmpC == '-');
TmpCount = TmpPtr - BufPtr + 1;
- if (MathMode)
+ if (CurStkMode(&MathModeStack))
{
if (TmpCount > 1)
HERE(TmpCount, emWrongDash);
@@ -1088,6 +1120,73 @@ static void CheckDash(void)
}
}
+ /* Check DashExcpt looking for phrase with hyphenation that doesn't
+ * match what's in DashExcpt. This really only makes sense for
+ * HyphDash, but it should be cheap in the other cases. */
+ if (!Errored)
+ {
+ TmpPtr = BufPtr-1;
+
+ SKIP_BACK(TmpPtr, TmpC, (TmpC == '-'));
+ SKIP_BACK(TmpPtr, TmpC, isalpha(TmpC));
+ /* If we found a dash going backwards, the we already checked
+ * this on the first dash */
+ if (*TmpPtr != '-')
+ {
+ /* PrePtr now points to the beginning of the hyphenated phrase */
+ PrePtr = ++TmpPtr;
+
+ struct WordList *el = &DashExcpt;
+
+ FORWL(i, *el)
+ {
+ char *e = el->Stack.Data[i];
+ TmpPtr = PrePtr;
+
+ /* Walk through the strings until we find a
+ * mismatch. */
+ int FoundHyphenDiff = FALSE;
+ while (*e && *TmpPtr && *e == *TmpPtr)
+ {
+ /* Skip past characters that are the same */
+ while (*e && *TmpPtr && *e == *TmpPtr)
+ {
+ ++e;
+ ++TmpPtr;
+ }
+ /* Skip past differences in hyphens */
+ while (*e == '-' && *TmpPtr != '-')
+ {
+ ++e;
+ FoundHyphenDiff = TRUE;
+ }
+ while (*TmpPtr == '-' && *e != '-')
+ {
+ ++TmpPtr;
+ FoundHyphenDiff = TRUE;
+ }
+ }
+
+ /* If there was no mismatch all the way to the end of e,
+ * and TmpPtr is not in the middle of a word, then they
+ * matched ignoring hyphens, so we have found the one
+ * DashExcpt element we care about and don't have to
+ * check any others. Moreover, if we found a difference
+ * in hyphenation, then we must warn because it matches
+ * something in DashExcpt but with improper hyphenation.
+ * It's possible they could put the same phrase in twice
+ * with different hyphenations, but that seems pretty
+ * pathological. */
+ if (*e == '\0' && !isalpha((unsigned char)*TmpPtr))
+ {
+ if (FoundHyphenDiff)
+ Errored = TRUE;
+ break;
+ }
+ }
+ }
+ }
+
if (Errored)
HERE(TmpCount, emWrongDash);
}
@@ -1140,14 +1239,8 @@ static void HandleBracket(char Char)
ItState = TRUE;
/* Same for math mode */
- if (ei->Flags & efMath)
- {
- MathMode = 1;
- }
- else if (ei->Flags & efNoMath)
- {
- MathMode = 0;
- }
+ if (ei->Flags & efMath || ei->Flags & efNoMath)
+ StkPop(&MathModeStack);
FreeErrInfo(ei);
}
@@ -1160,8 +1253,8 @@ static void HandleBracket(char Char)
BBuf[0] = Char;
ABuf[1] = BBuf[1] = 0;
if (Match)
- PrintError(CurStkName(&InputStack), RealBuf,
- BufPtr - Buf - 1, 1, Line, emExpectC,
+ PrintError(emExpectC, CurStkName(&InputStack), RealBuf,
+ BufPtr - Buf - 1, 1, Line,
ABuf, BBuf);
else
HEREA(1, emSoloC, BBuf);
@@ -1187,12 +1280,16 @@ static void HandleBracket(char Char)
switch (MathFlag)
{
- default:
+ case efNone:
+ break;
+ case efMath:
+ case efNoMath:
+ PushMode((MathFlag == efMath), &MathModeStack);
+ /* Save for when we exit this delimiter */
ei->Flags |= MathFlag;
+ /* Reset flag just in case... */
MathFlag = efNone;
break;
- case efNone:
- ei->Flags |= MathMode ? efMath : efNoMath;
}
}
}
@@ -1368,14 +1465,14 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
TmpPtr = PrePtr;
SKIP_BACK(TmpPtr, TmpC,
- (LATEX_SPACE(TmpC) || strchr("{}$", TmpC)));
+ (LATEX_SPACE(TmpC) || strchr("$", TmpC)));
if (isdigit((unsigned char)*TmpPtr))
{
TmpPtr = BufPtr;
SKIP_AHEAD(TmpPtr, TmpC,
- (LATEX_SPACE(TmpC) || strchr("{}$", TmpC)));
+ (LATEX_SPACE(TmpC) || strchr("$", TmpC)));
if (isdigit((unsigned char)*TmpPtr))
HERE(1, emUseTimes);
@@ -1433,7 +1530,8 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
case 'W': /* case 'X': */
case 'Y':
case 'Z':
- if (!isalpha((unsigned char)*PrePtr) && (*PrePtr != '\\') && MathMode)
+ if (!isalpha((unsigned char)*PrePtr) && (*PrePtr != '\\') &&
+ CurStkMode(&MathModeStack))
{
TmpPtr = BufPtr;
CmdPtr = CmdBuffer;
@@ -1474,7 +1572,7 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
HEREA(3, emEllipsis, cTmpPtr);
}
- /* Regexp: "([^A-Z@.])\.[.!?:]*\s+[a-z]" */
+ /* Regexp: "([^A-Z@.])\.[.!?:]*\s[ \`([]*[a-z]" */
TmpPtr = BufPtr;
SKIP_AHEAD(TmpPtr, TmpC, strchr(LTX_EosPunc, TmpC));
@@ -1483,9 +1581,17 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
if (!isupper((unsigned char)*PrePtr) && (*PrePtr != '@') &&
(*PrePtr != '.'))
{
- SKIP_AHEAD(TmpPtr, TmpC, LATEX_SPACE(TmpC));
+ SKIP_AHEAD(TmpPtr, TmpC,
+ (LATEX_SPACE(TmpC) || TmpC == '\\' ||
+ strchr(LTX_BosPunc, TmpC)));
if (islower((unsigned char)*TmpPtr))
- PSERR(BufPtr - Buf, 1, emInterWord);
+ {
+ /* Ignore spacing problems after commands if desired */
+ TmpPtr = PrePtr;
+ SKIP_BACK(TmpPtr, TmpC, istex(TmpC));
+ if (*TmpPtr != '\\' || (CmdSpace & csInterWord))
+ PSERR(BufPtr - Buf, 1, emInterWord);
+ }
else
CheckAbbrevs(&BufPtr[-1]);
}
@@ -1498,9 +1604,17 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
case ';':
/* Regexp: "[A-Z][A-Z][.!?:;]\s+" */
- if (isspace((unsigned char)*BufPtr) && isupper((unsigned char)*PrePtr) &&
- (isupper((unsigned char)PrePtr[-1]) || (Char != '.')))
- HERE(1, emInterSent);
+ if (isspace((unsigned char)*BufPtr) &&
+ isupper((unsigned char)*PrePtr) &&
+ (isupper((unsigned char)PrePtr[-1]) || (Char != '.')) &&
+ !FrenchSpacing)
+ {
+ /* Ignore spacing problems after commands if desired */
+ TmpPtr = PrePtr;
+ SKIP_BACK(TmpPtr, TmpC, istex(TmpC));
+ if (*TmpPtr != '\\' || (CmdSpace & csInterSentence))
+ HERE(1, emInterSent);
+ }
/* FALLTHRU */
case ',':
@@ -1509,12 +1623,12 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
((BufPtr[-1] == '.') || (BufPtr[-1] == ','))))
PSERR(PrePtr - Buf, 1, emSpacePunct);
- if (MathMode &&
+ if (CurStkMode(&MathModeStack) &&
(((*BufPtr == '$') && (BufPtr[1] != '$')) ||
(!strafter(BufPtr, "\\)"))))
HEREA(1, emPunctMath, "outside inner");
- if (!MathMode &&
+ if (!CurStkMode(&MathModeStack) &&
(((*PrePtr == '$') && (PrePtr[-1] == '$')) ||
(!strinfront(PrePtr, "\\]"))))
HEREA(1, emPunctMath, "inside display");
@@ -1524,9 +1638,8 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
case '`':
if ((Char == *BufPtr) && (Char == BufPtr[1]))
{
- PrintError(CurStkName(&InputStack), RealBuf,
+ PrintError(emThreeQuotes, CurStkName(&InputStack), RealBuf,
BufPtr - Buf - 1, 3, Line,
- emThreeQuotes,
Char, Char, Char, Char, Char, Char);
}
@@ -1557,7 +1670,7 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
HERE(TmpPtr - BufPtr + 1, emBeginQ);
/* Now check quote style */
-#define ISPUNCT(ptr) (strchr(LTX_GenPunc, *ptr) && (ptr[-1] != '\\'))
+#define ISPUNCT(ptr) ((strchr(LTX_EosPunc, *ptr) || strchr(LTX_GenPunc, *ptr)) && (ptr[-1] != '\\'))
/* We ignore all single words/abbreviations in quotes */
@@ -1662,9 +1775,8 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
1, emFalsePage);
}
- if (LATEX_SPACE(*BufPtr) && !MathMode &&
- !CheckSilentRegex() &&
- (strlen(CmdBuffer) != 2))
+ if (LATEX_SPACE(*BufPtr) && !CurStkMode(&MathModeStack) &&
+ !CheckSilentRegex() && (strlen(CmdBuffer) != 2))
{
PSERR(BufPtr - Buf, 1, emSpaceTerm);
}
@@ -1696,7 +1808,7 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
break;
case ')':
- if (isspace((unsigned char)*PrePtr))
+ if (SeenSpace)
PSERRA(BufPtr - Buf - 1, 1, emNoSpaceParen,
"in front of");
if (isalpha((unsigned char)*BufPtr))
@@ -1726,7 +1838,14 @@ int FindErr(const char *_RealBuf, const unsigned long _Line)
SKIP_AHEAD(TmpPtr, TmpC, (TmpC != '$' && TmpC != '\0'));
PSERR(BufPtr - Buf - 1, TmpPtr-BufPtr+2, emInlineMath);
}
- MathMode ^= TRUE;
+ if (CurStkMode(&MathModeStack))
+ {
+ StkPop(&MathModeStack);
+ }
+ else
+ {
+ PushMode(TRUE, &MathModeStack);
+ }
}
break;
@@ -1782,29 +1901,35 @@ void PrintStatus(unsigned long Lines)
while ((ei = PopErr(&CharStack)))
{
- PrintError(ei->File, ei->LineBuf, ei->Column,
- ei->ErrLen, ei->Line, emNoMatchC, (char *) ei->Data);
+ PrintError(emNoMatchC, ei->File, ei->LineBuf, ei->Column,
+ ei->ErrLen, ei->Line, (char *) ei->Data);
FreeErrInfo(ei);
}
while ((ei = PopErr(&EnvStack)))
{
- PrintError(ei->File, ei->LineBuf, ei->Column,
- ei->ErrLen, ei->Line, emNoMatchC, (char *) ei->Data);
+ PrintError(emNoMatchC, ei->File, ei->LineBuf, ei->Column,
+ ei->ErrLen, ei->Line, (char *) ei->Data);
+ FreeErrInfo(ei);
+ }
+
+ while ((ei = PopErr(&ConTeXtStack)))
+ {
+ PrintError(emNoMatchConTeXt, ei->File, ei->LineBuf, ei->Column,
+ ei->ErrLen, ei->Line, (char *) ei->Data);
FreeErrInfo(ei);
}
- if (MathMode)
+ if (CurStkMode(&MathModeStack))
{
- PrintError(CurStkName(&InputStack), "", 0L, 0L, Lines, emMathStillOn);
+ PrintError(emMathStillOn, CurStkName(&InputStack), "", 0L, 0L, Lines);
}
for (Cnt = 0L; Cnt < (NUMBRACKETS >> 1); Cnt++)
{
if (Brackets[Cnt << 1] != Brackets[(Cnt << 1) + 1])
{
- PrintError(CurStkName(&InputStack), "", 0L, 0L, Lines,
- emNoMatchCC,
+ PrintError(emNoMatchCC, CurStkName(&InputStack), "", 0L, 0L, Lines,
BrOrder[Cnt << 1], BrOrder[(Cnt << 1) + 1]);
}
}
@@ -1818,7 +1943,14 @@ void PrintStatus(unsigned long Lines)
/* Print how to suppress warnings. */
if ( ErrPrint + WarnPrint > 0 ) {
- fprintf(stderr, "See the manual for how to suppress some or all of these warnings/errors.\n" );
+ fprintf(
+ stderr,
+ "See the manual for how to suppress some or all of these warnings/errors.\n"
+ "The manual is available "
+#ifdef TEX_LIVE
+ "by running `texdoc chktex` or "
+#endif
+ "at https://www.nongnu.org/chktex/ChkTeX.pdf\n");
}
}
}
@@ -1847,12 +1979,11 @@ void PrintStatus(unsigned long Lines)
void
-PrintError(const char *File, const char *String,
- const long Position, const long Len,
- const long LineNo, const enum ErrNum Error, ...)
+PrintError(const enum ErrNum Error, const char *File, const char *String,
+ const long Position, const long Len, const long LineNo, ...)
{
static /* Just to reduce stack usage... */
- char PrintBuffer[BUFSIZ];
+ char PrintBuffer[BUFFER_SIZE];
va_list MsgArgs;
char *LastNorm = OutputFormat;
@@ -1879,19 +2010,22 @@ PrintError(const char *File, const char *String,
#define RGTCTXT(Ctxt, Var) if((Context & Ctxt) && !(Var)) break;
- RGTCTXT(ctInMath, MathMode);
- RGTCTXT(ctOutMath, !MathMode);
+ RGTCTXT(ctInMath, CurStkMode(&MathModeStack));
+ RGTCTXT(ctOutMath, !CurStkMode(&MathModeStack));
RGTCTXT(ctInHead, InHeader);
RGTCTXT(ctOutHead, !InHeader);
+ /* Count how warnings or errors we've found, and
+ * update the return code with the worst. */
switch (LaTeXMsgs[Error].Type)
{
case etWarn:
WarnPrint++;
+ FoundErr = max(FoundErr, EXIT_WARNINGS);
break;
case etErr:
ErrPrint++;
- FoundErr = EXIT_FAILURE;
+ FoundErr = max(FoundErr, EXIT_ERRORS);
break;
case etMsg:
break;
@@ -1946,7 +2080,7 @@ PrintError(const char *File, const char *String,
fprintf(OutputFile, "%ld", LineNo);
break;
case 'm':
- va_start(MsgArgs, Error);
+ va_start(MsgArgs, LineNo);
vfprintf(OutputFile,
LaTeXMsgs[Error].Message, MsgArgs);
va_end(MsgArgs);
@@ -2008,6 +2142,10 @@ static enum ErrNum PerformCommand(const char *Cmd, char *Arg)
AtLetter = TRUE;
else if (!strcmp(Cmd, "\\makeatother"))
AtLetter = FALSE;
+ else if (!strcmp(Cmd, "\\frenchspacing"))
+ FrenchSpacing = TRUE;
+ else if (!strcmp(Cmd, "\\nonfrenchspacing"))
+ FrenchSpacing = FALSE;
else if (InputFiles && !(strcmp(Cmd, "\\input") && strcmp(Cmd, "\\include")))
{
SKIP_AHEAD(Arg, TmpC, LATEX_SPACE(TmpC));
@@ -2029,8 +2167,8 @@ static enum ErrNum PerformCommand(const char *Cmd, char *Arg)
SKIP_AHEAD(Arg, TmpC, LATEX_SPACE(TmpC));
if (*Arg == '{')
{
- MathFlag = MathMode ? efMath : efNoMath;
- MathMode = 1;
+ /* We will actually turn on math mode when we enter the {} */
+ MathFlag = efMath;
}
}
else if (HasWord(Cmd, &TextCmd))
@@ -2038,8 +2176,8 @@ static enum ErrNum PerformCommand(const char *Cmd, char *Arg)
SKIP_AHEAD(Arg, TmpC, LATEX_SPACE(TmpC));
if (*Arg == '{')
{
- MathFlag = MathMode ? efMath : efNoMath;
- MathMode = 0;
+ /* We will actually turn on text mode when we enter the {} */
+ MathFlag = efNoMath;
}
}
else if (*Cmd == '\\')
@@ -2049,11 +2187,14 @@ static enum ErrNum PerformCommand(const char *Cmd, char *Arg)
{
case '(':
case '[':
- MathMode = TRUE;
+ PushMode(TRUE, &MathModeStack);
break;
case ']':
case ')':
- MathMode = FALSE;
+ if (!CurStkMode(&MathModeStack))
+ PSERRA(BufPtr - Buf - 2, 1, emMathModeConfusion, "on");
+
+ StkPop(&MathModeStack);
break;
case '/':
switch (ItState)
diff --git a/Build/source/texk/chktex/chktex-src/FindErrs.h b/Build/source/texk/chktex/chktex-src/FindErrs.h
index df38559ba36..8190da21689 100644
--- a/Build/source/texk/chktex/chktex-src/FindErrs.h
+++ b/Build/source/texk/chktex/chktex-src/FindErrs.h
@@ -128,7 +128,13 @@
MSG(emDisplayMath, etWarn, iuOK, ctOutMath,\
"Use \\[ ... \\] instead of $$ ... $$.")\
MSG(emInlineMath, etWarn, iuNotSys, ctOutMath,\
- "Use \\( ... \\) instead of $ ... $.")
+ "Use \\( ... \\) instead of $ ... $.")\
+ MSG(emExpectConTeXt, etWarn, iuOK, ctNone,\
+ "`%s' expected, found `%s' (ConTeXt).")\
+ MSG(emNoMatchConTeXt, etWarn, iuOK, ctNone,\
+ "No match found for `%s' (ConTeXt).") \
+ MSG(emMathModeConfusion, etWarn, iuOK, ctNone,\
+ "Expected math mode to be %s here.")
#undef MSG
#define MSG(num, type, inuse, ctxt, text) num,
@@ -193,8 +199,8 @@ extern char *OutputFormat;
int CheckSilentRegex(void);
int FindErr(const char *, const unsigned long);
-void PrintError(const char *, const char *, const long, const long,
- const long, const enum ErrNum, ...);
+void PrintError(const enum ErrNum, const char *, const char *, const long,
+ const long, const long, ...);
void PrintStatus(unsigned long Lines);
#endif /* FINDERRS */
diff --git a/Build/source/texk/chktex/chktex-src/MakeChkTeXRC.pl b/Build/source/texk/chktex/chktex-src/MakeChkTeXRC.pl
new file mode 100755
index 00000000000..4e7e9208ba9
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/MakeChkTeXRC.pl
@@ -0,0 +1,71 @@
+# Used to convert chktexrc.in (which see) into chktexrc and ChkTeXRC.tex
+
+use strict;
+use warnings;
+
+my $chktexrc_output;
+if ( $ARGV[0] eq '--chktexrc' ) {
+ $chktexrc_output = 1;
+} elsif ( $ARGV[0] eq '--latex' ) {
+ $chktexrc_output = 0;
+} else {
+ exit 1;
+}
+
+
+# Filter the lines of the file
+open(my $fh, '<:encoding(UTF-8)', $ARGV[1])
+ or die "Could not open file '$ARGV[1]' $!";
+
+while ( <$fh> ) {
+ if (/^#### END$/) {
+ exit 0;
+ }
+
+ if ($chktexrc_output) {
+ # chktexrc output, so discard all lines over 2
+ next if /^#{3,}/;
+
+ s/\@verb\@/`/g;
+ s/\@endverb\@/'/g;
+ s/\@emph\@/*/g;
+ s/\@endemph\@/*/g;
+ s/\@ref\@/ /g;
+ s/\@endref\@//g;
+
+ s/\@TeX@/TeX/g;
+ s/\@LaTeX@/LaTeX/g;
+ s/\@ChkTeX@/ChkTeX/g;
+ s/\@\\{2}\@//g; # \\ in LaTeX
+ s/\\\@ */ /g; # \@ in LaTeX
+ s/\@bf //g;
+ s/\@\&\@//g;
+ print;
+
+ } else {
+
+ # LaTeX output, so discard lines except with 1,3
+ next if /^#{4,}/;
+ next if /^#{2} /;
+ # next unless /^#/;
+ s/^#+[ ]*//;
+
+ s/\@emph\@/\\emph{/g;
+ s/\@endemph\@/}/g;
+ s/\@ref\@(.*)\@endref\@/~\\hyperref[rc:$1]{$1}/g;
+
+
+ s/\@TeX@/\\TeX{}/g;
+ s/\@LaTeX@/\\LaTeX{}/g;
+ s/\@ChkTeX@/\\chktex{}/g;
+ s/\@verb\@/\\verb@/g;
+ s/\@endverb\@/@/g;
+ s/\@\\{2}\@/\\\\/g;
+ s/\@bf/\\bf/g;
+ s/\@\&\@/&/g;
+
+ print;
+ }
+}
+# TODO:
+# \ChkTeX
diff --git a/Build/source/texk/chktex/chktex-src/Makefile.in b/Build/source/texk/chktex/chktex-src/Makefile.in
index 8980880ea34..4c8222e4daa 100644
--- a/Build/source/texk/chktex/chktex-src/Makefile.in
+++ b/Build/source/texk/chktex/chktex-src/Makefile.in
@@ -47,6 +47,7 @@ LIBS=@LIBS@
LDFLAGS=@LDFLAGS@
LN_S=@LN_S@
LATEX=@LATEX@
+PDFLATEX=@PDFLATEX@
DVIPS=@DVIPS@
PS2PDF=ps2pdf
PERL5=@PERL5@
@@ -64,7 +65,7 @@ VPATH=$(srcdir)
#####################################################################
-EXTRA_DIST=configure.in Makefile.in stamp-h.in config.h.in rmeheader.in \
+EXTRA_DIST=configure.ac Makefile.in stamp-h.in config.h.in rmeheader.in \
MakeHTML.pl ChkTeX.tex.in aclocal.m4 NEWS \
chkweb deweb.in COPYING chktex.1 chkweb.1 deweb.1 \
input.tex Test.tex Test.pcre.out Test.posix-ere.out Test.nore.out configure \
@@ -72,7 +73,7 @@ EXTRA_DIST=configure.in Makefile.in stamp-h.in config.h.in rmeheader.in \
$(wildcard m4/*.m4)
# created by configure
-CONFIG_DIST=ChkTeX.tex
+CONFIG_DIST=ChkTeX.tex ChkTeXRC.tex chktexrc
# created at make time
BUILT_DIST=chktex.doc chkweb.doc deweb.doc README ChkTeX.dvi
@@ -85,7 +86,7 @@ SOURCEFILES=$(CSOURCES) $(wildcard $(CSOURCES:.c=.h)) types.h
DISTFILES=$(EXTRA_DIST) $(SOURCEFILES)
-all: chktex
+all: chktex chktexrc
DISTDIR:=chktex-@PACKAGE_VERSION@
dist: $(DISTDIR).tar.gz
@@ -124,7 +125,7 @@ endif
OBJS= ChkTeX.o FindErrs.o OpSys.o Resource.o Utility.o
-MAKETEST= (builddir=`pwd` ; cd $(srcdir) ; $${builddir}/chktex -mall -r -g0 -lchktexrc -v5 Test.tex || :)
+MAKETEST= (builddir=`pwd` ; cd $(srcdir) ; $${builddir}/chktex -mall -r -g0 -lchktexrc -v5 -q Test.tex || :)
# We can't grep the output of chtex because it might not be built yet
TestOutFile := $(shell sed -n 's/.*HAVE_\(.*RE\) 1.*/\1/p' config.h | tr "A-Z_" "a-z-")
@@ -133,14 +134,14 @@ TestOutFile := Test.nore.out
else
TestOutFile := Test.$(TestOutFile).out
endif
-$(srcdir)/$(TestOutFile): $(srcdir)/Test.tex
+$(srcdir)/$(TestOutFile): $(srcdir)/Test.tex $(srcdir)/input/file
-rm -f $(srcdir)/$(TestOutFile)
@echo ""
@echo "***Warning: creating $(TestOutFile)***"
@echo ""
$(MAKETEST) 1> $(srcdir)/$(TestOutFile)
-check: chktex $(srcdir)/$(TestOutFile)
+check: chktex $(srcdir)/$(TestOutFile) chktexrc
@echo ">>> Testing that checking algorithms work correctly..."
@-rm -f chktest
$(MAKETEST) 1> chktest
@@ -154,6 +155,7 @@ check: chktex $(srcdir)/$(TestOutFile)
echo "results were *supposed* to be..."; \
diff -u $(srcdir)/$(TestOutFile) chktest; \
fi
+ $(srcdir)/tests/run-tests.sh `pwd` "$(srcdir)"
chktex: $(OBJS)
@@ -233,12 +235,12 @@ endif
###################### AUTOCONF REMAKING ################################
-$(srcdir)/configure: configure.in aclocal.m4
+$(srcdir)/configure: configure.ac aclocal.m4
cd $(srcdir) && autoconf
#autoheader might not change config.h.in, so touch a stamp file.
$(srcdir)/config.h.in: stamp-h.in
-$(srcdir)/stamp-h.in: configure.in aclocal.m4
+$(srcdir)/stamp-h.in: configure.ac aclocal.m4
cd $(srcdir) && autoheader
echo timestamp > $(srcdir)/stamp-h.in
@@ -260,7 +262,14 @@ config.status: configure
%.doc: %.1
$(GROFF) $< > $@
-ChkTeX.dvi: ChkTeX.tex
+ChkTeXRC.tex: chktexrc.in MakeChkTeXRC.pl
+ $(PERL5) $(srcdir)/MakeChkTeXRC.pl --latex $(srcdir)/chktexrc.in > ChkTeXRC.tex
+
+chktexrc: chktexrc.in MakeChkTeXRC.pl
+ $(PERL5) $(srcdir)/MakeChkTeXRC.pl --chktexrc $(srcdir)/chktexrc.in > chktexrc
+
+
+ChkTeX.dvi: ChkTeX.tex ChkTeXRC.tex
ifdef LATEX
$(LATEX) ChkTeX.tex
else
@@ -271,8 +280,13 @@ endif
ChkTeX.ps: ChkTeX.dvi
$(DVIPS) -o ChkTeX.ps ChkTeX.dvi
+ifdef PDFLATEX
+ChkTeX.pdf: ChkTeX.tex ChkTeXRC.tex
+ $(PDFLATEX) -interaction=nonstopmode ChkTeX.tex
+else
ChkTeX.pdf: ChkTeX.ps
$(PS2PDF) $< $@
+endif
cover:
-./chktex -h
diff --git a/Build/source/texk/chktex/chktex-src/NEWS b/Build/source/texk/chktex/chktex-src/NEWS
index 14c389b6b89..5605c50b2d6 100644
--- a/Build/source/texk/chktex/chktex-src/NEWS
+++ b/Build/source/texk/chktex/chktex-src/NEWS
@@ -1,6 +1,48 @@
Development of ChkTeX is now in a maintainance mode. All versions
1.6.x are essentially bug fixes. Version 1.7 added some new features.
+1.7.8 (2022-10-17), released by Ivan Andrus <darthandrus@gmail.com>
+
+ * Fix some packaging issues for CTAN
+
+1.7.7 (2022-10-17), released by Ivan Andrus <darthandrus@gmail.com>
+
+ * Fix false positives
+ * Fix overzealous warning of x between numbers #60184
+ * Handle nested mathmode e.g. \ensuremath #60197
+ * Add many citation commands from biblatex #56608
+ * Add support for breqn package #62631
+ * WipeArg on \graphicspath #47593
+ * WipeArg on LuaTeX macros which contain lua code #53146
+ * Add \itshape to Silent section https://tex.stackexchange.com/questions/627808/why-does-chktex-complain-when-there-is-a-space-after-itshape-but-not-when-bfse
+ * Make QuoteStyle warnings work with end of sentence punctuation #53494
+ * When checking for inter-word spacing, ignore certain punctuation #54751, #53347
+ * Allow \frenchspacing to turn off warning 13 (intersentence spacing)
+ * Don't warn about space before a parenthesis at the beginning of the line if the previous line ended with a comment (and no space) #109479
+ * Make exit status 2 or 3 (not 1) when warnings or errors are found. Some callers expected a return value of 1 to mean an internal error. #53129
+
+ * Fix many bugs
+ * Make ChkTeX process longer lines, especially on Windows. This doesn't fix the problem entirely, but it should amerliorate it to a large extent.
+ * Make file suppressions only apply to the file they are in. This allows putting all the "badness" into one file. #57809
+ * Add check to make sure input is a regular file and not a directory #56520
+ * Add support for relative paths in sub directories #53494
+ * Manage ConTeXt environments separately from LaTeX environments #51179
+ * Change argument order to avoid undefined behavior in va_start()
+
+ * New warnings and features
+ * Add regex for unescaped optional arguments inside optional arguments #56657
+ * Support RC settings on the command line #56486
+ * Warn about phrases that match DashExcpt _except_ for the hyphens #58886
+ * Add CmdSpaceStyle option to Ignore spacing problems after commands #60809, #60380
+ * Add support for finding chktexrc files in XDG locations #61405
+ * Add new warning when ChkTeX gets confused about mathmode
+
+ * Improved documentation
+ * Make chktexrc somewhat literate and creating ChkTeXRC.tex as well.
+ * Make "keywords" link to the appropriate chktexrc variable documentation
+ * Add note about chktexrc and link to documentation in the help message #50004 #61179
+ * Indicate that debug is a bit field instead of a level
+
1.7.6 (2016-09-09), released by Ivan Andrus <darthandrus@gmail.com>
* Properly copy and free strings. This caused incorrect file
diff --git a/Build/source/texk/chktex/chktex-src/OpSys.c b/Build/source/texk/chktex/chktex-src/OpSys.c
index 7d055b72284..67e2bea4a47 100644
--- a/Build/source/texk/chktex/chktex-src/OpSys.c
+++ b/Build/source/texk/chktex/chktex-src/OpSys.c
@@ -115,7 +115,9 @@ static char term_buffer[2048];
# define LOCALRCFILE "." RCBASENAME
#endif
-char ConfigFile[BUFSIZ] = LOCALRCFILE;
+char ConfigFile[BUFFER_SIZE] = LOCALRCFILE;
+struct WordList ConfigFiles;
+
const char *ReverseOn;
const char *ReverseOff;
@@ -150,6 +152,7 @@ enum LookIn
liMin,
liSysDir,
liUsrDir,
+ liXdgDir,
liEnvir,
liCurDir,
liNFound,
@@ -177,12 +180,10 @@ int SetupVars(void)
break;
case liEnvir: /* Environment defined */
#ifdef __MSDOS__
-
if ((Env = getenv("CHKTEXRC")) || (Env = getenv("CHKTEX_HOME")))
#elif defined(TEX_LIVE)
if ((Env = kpse_var_value("CHKTEXRC")))
#else
-
if ((Env = getenv("CHKTEXRC")))
#endif
@@ -206,6 +207,27 @@ int SetupVars(void)
*ConfigFile = 0;
break;
+
+ case liXdgDir: /* Cross-desktop group dir for resource files */
+
+ /* XDG is really unix specific, but it shouldn't hurt to
+ * support it on Windows, should someone set the variables. */
+ if ((Env = getenv("XDG_CONFIG_HOME")) && *Env)
+ {
+ strcpy(ConfigFile, Env);
+ tackon(ConfigFile, RCBASENAME);
+ }
+ else if ((Env = getenv("HOME")) && *Env)
+ {
+ strcpy(ConfigFile, Env);
+ tackon(ConfigFile, ".config");
+ tackon(ConfigFile, RCBASENAME);
+ }
+ else
+ *ConfigFile = 0;
+
+ break;
+
case liUsrDir: /* User dir for resource files */
#if defined(__unix__)
@@ -446,6 +468,45 @@ static int HasFile(char *Dir, const char *Filename, const char *App)
}
+/*
+ * If Filename is contains a directory component, then add a fully qualified
+ * directory to the TeXInputs WordList.
+ *
+ * I'm not sure how it will work with some Windows paths,
+ * e.g. C:path\to\file.tex since it doesn't really understand the leading C:
+ * But I'm not sure it would even work with a path like that, and I have no
+ * way to test it.
+ *
+ * Behaviour somewhat controlled by the macros SLASH and DIRCHARS in the
+ * OpSys.h file.
+ *
+ */
+
+void AddDirectoryFromRelativeFile(const char * Filename, struct WordList *TeXInputs)
+{
+ if ( ! Filename )
+ return;
+
+ /* There are no path delimiters, so it's just a file, return null */
+ if ( ! strstr( Filename, DIRCHARS ) )
+ return;
+
+
+ char buf[BUFFER_SIZE];
+ if ( strchr(DIRCHARS,Filename[0]) ) {
+ strcpy(buf,Filename);
+ } else {
+ getcwd(buf, BUFFER_SIZE);
+ tackon(buf,Filename);
+ }
+
+ /* Keep up to the final SLASH -- that will be the directory. */
+ char * end = strrchr(buf,SLASH);
+ *end = '\0';
+ InsertWord(buf,TeXInputs);
+}
+
+
#if USE_RECURSE
static int SearchFile(char *Dir, const char *Filename, const char *App)
{
@@ -490,3 +551,24 @@ static int SearchFile(char *Dir, const char *Filename, const char *App)
return (Found);
}
#endif /* USE_RECURSE */
+
+#if defined(HAVE_STAT)
+int IsRegFile(const char *Filename)
+{
+ int Retval = FALSE;
+ struct stat *statbuf;
+ if ((statbuf = malloc(sizeof(struct stat))))
+ {
+ if (!stat(Filename, statbuf))
+ {
+ if ((statbuf->st_mode & S_IFMT) == S_IFREG)
+ Retval = TRUE;
+ }
+ free(statbuf);
+ }
+
+ return Retval;
+}
+#else
+int IsRegFile(const char *Filename) { printf("WTF\n");return TRUE; }
+#endif
diff --git a/Build/source/texk/chktex/chktex-src/OpSys.h b/Build/source/texk/chktex/chktex-src/OpSys.h
index 7ce3f1b5270..d1b3f37689d 100644
--- a/Build/source/texk/chktex/chktex-src/OpSys.h
+++ b/Build/source/texk/chktex/chktex-src/OpSys.h
@@ -59,7 +59,7 @@
* You may wish to modify the SetupVars() (OpSys.c) to better suit your
* preferences. In any case, it should put the filename (and full path)
* of the `.chktexrc' file into the ConfigFile array. The array is sized
- * BUFSIZ bytes.
+ * BUFFER_SIZE bytes.
*
* The program does also assume that __unix__ is defined if the source is
* compiled on a UNIX machine.
@@ -83,6 +83,9 @@
# define EXIT_SUCCESS 0
#endif
+#define EXIT_WARNINGS 2
+#define EXIT_ERRORS 3
+
/* -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- */
/*
@@ -182,6 +185,26 @@
# define BAKAPPENDIX ".bak"
#endif
+
+/* -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- -=><=- */
+
+/*
+ * This defines the buffer size used in many places. The biggest
+ * limitation imposed by a small buffer is the size of a line which
+ * can be accurately processed by chktex. On the other hand, a large
+ * buffer size will waste memory. However, memory is quite cheap
+ * these days, especially considering the amount needed by ChkTeX.
+ *
+ * ChkTeX used to use BUFSIZ which was 1024 (fairly reasonable) on
+ * many UNIX-like systems, but was much smaller on Windows. So,
+ * instead we create our own buffer size and hope that no-one has
+ * lines longer than 4k.
+ *
+ */
+
+#define BUFFER_SIZE 4096
+
+
/***************** END OF USER SETTABLE PREFERENCES *****************/
/********************************************************************/
@@ -189,14 +212,14 @@
struct WordList;
#endif
/* Sorry; there are now cyclic dependencies in the
-* source tree. :-/
+* source tree. :-/
*/
extern const char *ReverseOn;
extern const char *ReverseOff;
-extern char ConfigFile[BUFSIZ];
+extern char ConfigFile[BUFFER_SIZE];
+extern struct WordList ConfigFiles;
-char *MatchFileName(char *String);
int SetupVars(void);
void SetupTerm(void);
void AddAppendix(char *Name, const char *App);
@@ -204,4 +227,7 @@ void tackon(char *, const char *);
int LocateFile(const char *Filename, char *Dest, const char *App,
struct WordList *wl);
+void AddDirectoryFromRelativeFile(const char * Filename, struct WordList *TeXInputs);
+int IsRegFile(const char *Filename);
+
#endif /* OPSYS_H */
diff --git a/Build/source/texk/chktex/chktex-src/Resource.c b/Build/source/texk/chktex/chktex-src/Resource.c
index f301c6aff27..40a37df54c2 100644
--- a/Build/source/texk/chktex/chktex-src/Resource.c
+++ b/Build/source/texk/chktex/chktex-src/Resource.c
@@ -90,7 +90,8 @@ TOKENBITS(Token);
static enum Token Expect;
static unsigned long RsrcLine;
-static enum Token ReadWord(char *, FILE *);
+static enum Token ReadWord(char *, FILE *,
+ char *(fgetsfun)(char *, int, FILE *));
static char MapChars(char **String);
@@ -108,11 +109,11 @@ static char MapChars(char **String);
* Returns whether the attempt was a successful one.
*/
-int ReadRC(const char *Filename)
+int ProcessRC(FILE *fh, const char *Filename,
+ char *(fgetsfun)(char *, int, FILE *))
{
const char *String = NULL;
- int Success = FALSE;
- FILE *fh;
+ int Success = TRUE;
enum Token Token;
unsigned long Counter;
@@ -130,130 +131,138 @@ int ReadRC(const char *Filename)
RsrcLine = 0;
Expect = FLG_Word | FLG_Eof;
-
- if ((fh = fopen(Filename, "r")))
+ do
{
- Success = TRUE;
- do
+ Token = ReadWord(ReadBuffer, fh, fgetsfun);
+ if (!(Expect & Token))
{
- Token = ReadWord(ReadBuffer, fh);
- if (!(Expect & Token))
+ switch (Token)
{
- switch (Token)
+ case FLG_Item:
+ String = "item";
+ break;
+ case FLG_Word:
+ String = "word";
+ break;
+ case FLG_Equal:
+ String = "`='";
+ break;
+ case FLG_Open:
+ String = "`{'";
+ break;
+ case FLG_Close:
+ String = "`}'";
+ break;
+ case FLG_BrOpen:
+ String = "`['";
+ break;
+ case FLG_BrClose:
+ String = "`]'";
+ break;
+ case FLG_Eof:
+ String = "EOF";
+ break;
+ }
+ PrintPrgErr(pmFaultFmt, Filename, RsrcLine, String);
+ Success = FALSE;
+ Token = FLG_Eof;
+ }
+
+ switch (Token)
+ {
+ case FLG_Word:
+ for (Counter = 0; Keys[Counter].Name; Counter++)
+ {
+ if (!strcasecmp(ReadBuffer, Keys[Counter].Name))
{
- case FLG_Item:
- String = "item";
- break;
- case FLG_Word:
- String = "word";
- break;
- case FLG_Equal:
- String = "`='";
- break;
- case FLG_Open:
- String = "`{'";
- break;
- case FLG_Close:
- String = "`}'";
- break;
- case FLG_BrOpen:
- String = "`['";
- break;
- case FLG_BrClose:
- String = "`]'";
- break;
- case FLG_Eof:
- String = "EOF";
+ CurWord = &Keys[Counter];
+ Expect = (CurWord->List ? FLG_Open : 0) |
+ (CurWord->CaseList ? FLG_BrOpen : 0) | FLG_Equal;
break;
}
- PrintPrgErr(pmFaultFmt, Filename, RsrcLine, String);
+ }
+ if (!Keys[Counter].Name)
+ {
+ PrintPrgErr(pmKeyWord, ReadBuffer, Filename);
Success = FALSE;
Token = FLG_Eof;
}
-
- switch (Token)
+ break;
+ case FLG_Item:
+ switch (What)
{
- case FLG_Word:
- for (Counter = 0; Keys[Counter].Name; Counter++)
+ case whEqual:
+ if (!(*(CurWord->String) = strdup(ReadBuffer)))
{
- if (!strcasecmp(ReadBuffer, Keys[Counter].Name))
- {
- CurWord = &Keys[Counter];
- Expect = (CurWord->List ? FLG_Open : 0) |
- (CurWord->CaseList ? FLG_BrOpen : 0) | FLG_Equal;
- break;
- }
+ PrintPrgErr(pmStrDupErr);
+ Token = FLG_Eof;
+ Success = FALSE;
}
- if (!Keys[Counter].Name)
+
+ What = whNone;
+ Expect = FLG_Word | FLG_Eof;
+ break;
+ case whCaseList:
+ if (!InsertWord(ReadBuffer, CurWord->CaseList))
{
- PrintPrgErr(pmKeyWord, ReadBuffer, Filename);
- Success = FALSE;
Token = FLG_Eof;
+ Success = FALSE;
}
break;
- case FLG_Item:
- switch (What)
+ case whList:
+ if (!InsertWord(ReadBuffer, CurWord->List))
{
- case whEqual:
- if (!(*(CurWord->String) = strdup(ReadBuffer)))
- {
- PrintPrgErr(pmStrDupErr);
- Token = FLG_Eof;
- Success = FALSE;
- }
-
- What = whNone;
- Expect = FLG_Word | FLG_Eof;
- break;
- case whCaseList:
- if (!InsertWord(ReadBuffer, CurWord->CaseList))
- {
- Token = FLG_Eof;
- Success = FALSE;
- }
- break;
- case whList:
- if (!InsertWord(ReadBuffer, CurWord->List))
- {
- Token = FLG_Eof;
- Success = FALSE;
- }
- break;
- case whNone:
- PrintPrgErr(pmAssert);
+ Token = FLG_Eof;
+ Success = FALSE;
}
break;
- case FLG_Equal:
- What = whEqual;
- Expect = (CurWord->List ? FLG_Open : 0) |
- (CurWord->CaseList ? FLG_BrOpen : 0) |
- (CurWord->String ? FLG_Item : 0);
- break;
- case FLG_BrOpen:
- if (What == whEqual)
- ClearWord(CurWord->CaseList);
- What = whCaseList;
- Expect = FLG_Item | FLG_BrClose;
- break;
- case FLG_Open:
- if (What == whEqual)
- ClearWord(CurWord->List);
- What = whList;
- Expect = FLG_Item | FLG_Close;
- break;
- case FLG_BrClose:
- case FLG_Close:
- Expect = (CurWord->List ? FLG_Open : 0) |
- (CurWord->CaseList ? FLG_BrOpen : 0) |
- FLG_Equal | FLG_Word | FLG_Eof;
- What = whNone;
- break;
- case FLG_Eof:
- break;
+ case whNone:
+ PrintPrgErr(pmAssert);
}
+ break;
+ case FLG_Equal:
+ What = whEqual;
+ Expect = (CurWord->List ? FLG_Open : 0) |
+ (CurWord->CaseList ? FLG_BrOpen : 0) |
+ (CurWord->String ? FLG_Item : 0);
+ break;
+ case FLG_BrOpen:
+ if (What == whEqual)
+ ClearWord(CurWord->CaseList);
+ What = whCaseList;
+ Expect = FLG_Item | FLG_BrClose;
+ break;
+ case FLG_Open:
+ if (What == whEqual)
+ ClearWord(CurWord->List);
+ What = whList;
+ Expect = FLG_Item | FLG_Close;
+ break;
+ case FLG_BrClose:
+ case FLG_Close:
+ Expect = (CurWord->List ? FLG_Open : 0) |
+ (CurWord->CaseList ? FLG_BrOpen : 0) | FLG_Equal | FLG_Word |
+ FLG_Eof;
+ What = whNone;
+ break;
+ case FLG_Eof:
+ break;
}
- while (Token != FLG_Eof);
+ } while (Token != FLG_Eof);
+ return (Success);
+}
+/*
+ * Opens a file and passes to ProcessRC().
+ */
+int ReadRC(const char *Filename)
+{
+ int Success = FALSE;
+ FILE *fh;
+
+ if ((fh = fopen(Filename, "r")))
+ {
+ Success = ProcessRC(fh, Filename, &fgets);
fclose(fh);
}
else
@@ -262,16 +271,52 @@ int ReadRC(const char *Filename)
return (Success);
}
+const char *FGETS_TMP = NULL;
+char *fgets_from_string(char *out, int size, FILE *fh)
+{
+ char *res;
+ if (FGETS_TMP == NULL)
+ return NULL;
+ res = strncpy(out, FGETS_TMP, size - 1);
+
+ if (size - 1 < strlen(FGETS_TMP))
+ {
+ /* It wasn't all read, so null terminate it, and get ready for
+ * next time. */
+ res[size] = '\0';
+ FGETS_TMP = FGETS_TMP + (size - 1);
+ }
+ else
+ {
+ /* We're done, so signal that */
+ FGETS_TMP = NULL;
+ }
+ return res;
+}
+
+/*
+ * Opens a file and passes to ProcessRC().
+ */
+int ReadRCFromCmdLine(const char *CmdLineArg)
+{
+ if (!CmdLineArg)
+ return FALSE;
+
+ FGETS_TMP = CmdLineArg;
+ return ProcessRC(NULL, "CommandLineArg", &fgets_from_string);
+}
+
/*
* Reads a token from the `.chktexrc' file; if the token is
* FLG_Item or FLG_Word, Buffer will contain the plaintext of the
* token. If not, the contents are undefined.
*/
-static enum Token ReadWord(char *Buffer, FILE * fh)
+static enum Token ReadWord(char *Buffer, FILE *fh,
+ char *(fgetsfun)(char *, int, FILE *))
{
static char *String = NULL;
- static char StatBuf[BUFSIZ];
+ static char StatBuf[BUFFER_SIZE];
enum Token Retval = FLG_Eof;
unsigned short Chr;
@@ -285,7 +330,7 @@ static enum Token ReadWord(char *Buffer, FILE * fh)
{
if (!(String && *String))
{
- if (fgets(StatBuf, BUFSIZ - 1, fh))
+ if ((fgetsfun)(StatBuf, BUFFER_SIZE - 1, fh))
String = strip(StatBuf, STRP_RGT);
RsrcLine++;
}
diff --git a/Build/source/texk/chktex/chktex-src/Resource.h b/Build/source/texk/chktex/chktex-src/Resource.h
index c0ebed0bd17..e2736a05d4e 100644
--- a/Build/source/texk/chktex/chktex-src/Resource.h
+++ b/Build/source/texk/chktex/chktex-src/Resource.h
@@ -48,8 +48,9 @@
LIST(CenterDots) LIST(LowDots) LIST(OutFormat)\
LIST(Primitives) LIST(NotPreSpaced) LIST(NonItalic) LIST(NoCharNext)\
LNEMPTY(CmdLine) LNEMPTY(TeXInputs)\
- LCASE(Abbrev) LCASE(UserWarn) LIST(UserWarnRegex)\
- KEY(VerbClear, "|") KEY(QuoteStyle, "Traditional") KEY(TabSize, "8")
+ LCASE(Abbrev) LCASE(UserWarn) LIST(UserWarnRegex) LIST(TextEnvir)\
+ KEY(VerbClear, "|") KEY(QuoteStyle, "Traditional") KEY(TabSize, "8")\
+ KEY(CmdSpaceStyle, "Ignore")
#define LIST(a) extern struct WordList a;
#define LNEMPTY LIST
@@ -62,6 +63,7 @@ RESOURCE_INFO
#undef LNEMPTY
#undef LIST
int ReadRC(const char *);
+int ReadRCFromCmdLine(const char *CmdLineArg);
#endif /* RESOURCE */
diff --git a/Build/source/texk/chktex/chktex-src/Test.nore.out b/Build/source/texk/chktex/chktex-src/Test.nore.out
index 44e35715001..07393eabd9b 100644
--- a/Build/source/texk/chktex/chktex-src/Test.nore.out
+++ b/Build/source/texk/chktex/chktex-src/Test.nore.out
@@ -19,12 +19,6 @@ So is this \foo
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
\smallskip This is a not. $\foo Neither$ is this.
^^^^^^^^^^^^^^
-Message 1 in Test.tex: Command terminated with space.
-\stoptext
- ^
-Message 9 in Test.tex: `section' expected, found `text'.
-\stoptext
- ^^^^
Message 22 in Test.tex: Comment displayed.
% Warning 2
^
@@ -136,12 +130,18 @@ The Birch--Swinnerton--Dyer conjecture is not correct.
Message 8 in Test.tex: Wrong length of dash may have been used.
The Birch--Swinnerton--Dyer conjecture is not correct.
^^
+Message 8 in Test.tex: Wrong length of dash may have been used.
+The Birch-Swinnerton-Dyer conjecture is not correct (is now caught).
+ ^
Message 22 in Test.tex: Comment displayed.
% Warning 9-10
^
Message 22 in Test.tex: Comment displayed.
% Brackets:
^
+Message 37 in Test.tex: You should avoid spaces in front of parenthesis.
+)}{[])} }}}]]])))
+^
Message 10 in Test.tex: Solo `)' found.
)}{[])} }}}]]])))
^
@@ -194,6 +194,27 @@ Message 10 in Test.tex: Solo `asoi' found.
\begin{quux} \begin{baz} \end{quux} \end{baz} \end{asoi} \begin{dobedo}
^^^^
Message 22 in Test.tex: Comment displayed.
+% Warning 47 -- ConTeXt environment mismatch -- split from 9
+^
+Message 1 in Test.tex: Command terminated with space.
+\stoptext
+ ^
+Message 47 in Test.tex: `section' expected, found `text' (ConTeXt).
+\stoptext
+ ^^^^
+Message 1 in Test.tex: Command terminated with space.
+\starttext
+ ^
+Message 22 in Test.tex: Comment displayed.
+% (Un)fortunately, this is not an error
+^
+Message 1 in Test.tex: Command terminated with space.
+\startbar
+ ^
+Message 1 in Test.tex: Command terminated with space.
+\stopbar
+ ^
+Message 22 in Test.tex: Comment displayed.
% Warning 11
^
Message 11 in Test.tex: You should use \ldots to achieve an ellipsis.
@@ -260,12 +281,39 @@ Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
1st. Foo Inc. Ab.cd. foo ab.cd. Foo. bar baz., billy.; bob.: joe.! frank.? james.. george
^
Message 22 in Test.tex: Comment displayed.
+% Bug 54751
+^
+Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
+Mr. ``X'' and Mrs. \(Y\)
+ ^
+Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
+Mr. ``X'' and Mrs. \(Y\)
+ ^
+Message 22 in Test.tex: Comment displayed.
+% ignore commands by default
+^
+Message 22 in Test.tex: Comment displayed.
% Warning 13
^
Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
Look at THIS! It's an error.
^
Message 22 in Test.tex: Comment displayed.
+% after frenchspacing it's not an error
+^
+Message 22 in Test.tex: Comment displayed.
+% warning again
+^
+Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
+Look at THIS! It's an error.
+ ^
+Message 22 in Test.tex: Comment displayed.
+% ignore commands by default
+^
+Message 21 in Test.tex: This command might not be intended.
+Look at \THIS\@! It's not an error. D. E. Knuth.
+ ^^
+Message 22 in Test.tex: Comment displayed.
% Warning 14
^
Message 1 in Test.tex: Command terminated with space.
@@ -358,6 +406,12 @@ Message 1 in input.tex: Command terminated with space.
Message 11 in input.tex: You should use \ldots to achieve an ellipsis.
\this is a test of whether the file is actually inputted...
^^^
+Message 22 in input/file: Comment displayed.
+% -*- TeX -*-
+^
+Message 22 in input/file: Comment displayed.
+% chktex-file 22
+^
Message 22 in Test.tex: Comment displayed.
% Warning 29
^
@@ -367,6 +421,12 @@ The program opens a screen sized 640x200 pixels
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
The program opens a screen sized $640\times200$ pixels
^^^^^^^^^^^^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+Approximately $\frac{2x}{1+x}$ $x$s shouldn't be errors.
+ ^^^^^^^^^^^^^^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+Approximately $\frac{2x}{1+x}$ $x$s shouldn't be errors.
+ ^^^
Message 22 in Test.tex: Comment displayed.
% Warning 30
^
@@ -451,6 +511,9 @@ Message 22 in Test.tex: Comment displayed.
Message 38 in Test.tex: You should not use punctuation in front of quotes.
``An example,'' he said, ``would be great.''
^
+Message 38 in Test.tex: You should not use punctuation in front of quotes.
+``An example,'' he said, ``would be great.''
+ ^
Message 22 in Test.tex: Comment displayed.
% Warning 39
^
@@ -536,6 +599,12 @@ Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
For every $p\nmid n$ you have a cute prime which doesn't divide $n$.
^^^
Message 22 in Test.tex: Comment displayed.
+% Warning about optional arguments inside optional arguments
+^
+Message 22 in Test.tex: Comment displayed.
+% Shouldn't warn
+^
+Message 22 in Test.tex: Comment displayed.
% Math mode check
^
Message 35 in Test.tex: You should perhaps use `\sin' instead.
@@ -557,6 +626,18 @@ Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
Also, $x(3)\text{ is not x(3) but it is $x(3)$}$
^^^^^^
Message 22 in Test.tex: Comment displayed.
+% breqn mode check
+^
+Message 35 in Test.tex: You should perhaps use `\sin' instead.
+sin x
+^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+is not the same as sin x, but is the same as $sin x$
+ ^^^^^^^
+Message 35 in Test.tex: You should perhaps use `\sin' instead.
+is not the same as sin x, but is the same as $sin x$
+ ^^^
+Message 22 in Test.tex: Comment displayed.
This is\\% a comment. Nothing here should be checked(right)?
^
Message 36 in Test.tex: You should put a space in front of parenthesis.
@@ -596,6 +677,18 @@ Message 31 in Test.tex: This text may be ignored.
\end{verbatim} FOO
^^^
Message 22 in Test.tex: Comment displayed.
+% WipeArg
+^
+Message 22 in Test.tex: Comment displayed.
+% Bug 60197 -- "double math mode" should be handled okay
+^
+Message 22 in Test.tex: Comment displayed.
+% Warning 49
+^
+Message 49 in Test.tex: Expected math mode to be on here.
+\]
+^
+Message 22 in Test.tex: Comment displayed.
% Warning 16,15
^
Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$.
@@ -613,6 +706,9 @@ Message 22 in Test.tex: Comment displayed.
Message 22 in Test.tex: Comment displayed.
% There should be no newline at the end of this file to test bug #46539
^
+Message 48 in Test.tex: No match found for `text' (ConTeXt).
+\starttext
+ ^^^^
Message 16 in Test.tex: Mathmode still on at end of LaTeX file.
diff --git a/Build/source/texk/chktex/chktex-src/Test.pcre.out b/Build/source/texk/chktex/chktex-src/Test.pcre.out
index c2e8eefac25..2f47f60de11 100644
--- a/Build/source/texk/chktex/chktex-src/Test.pcre.out
+++ b/Build/source/texk/chktex/chktex-src/Test.pcre.out
@@ -19,9 +19,6 @@ So is this \foo
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
\smallskip This is a not. $\foo Neither$ is this.
^^^^^^^^^^^^^^
-Message 9 in Test.tex: `section' expected, found `text'.
-\stoptext
- ^^^^
Message 22 in Test.tex: Comment displayed.
% Warning 2
^
@@ -133,12 +130,18 @@ The Birch--Swinnerton--Dyer conjecture is not correct.
Message 8 in Test.tex: Wrong length of dash may have been used.
The Birch--Swinnerton--Dyer conjecture is not correct.
^^
+Message 8 in Test.tex: Wrong length of dash may have been used.
+The Birch-Swinnerton-Dyer conjecture is not correct (is now caught).
+ ^
Message 22 in Test.tex: Comment displayed.
% Warning 9-10
^
Message 22 in Test.tex: Comment displayed.
% Brackets:
^
+Message 37 in Test.tex: You should avoid spaces in front of parenthesis.
+)}{[])} }}}]]])))
+^
Message 10 in Test.tex: Solo `)' found.
)}{[])} }}}]]])))
^
@@ -178,6 +181,9 @@ Message 10 in Test.tex: Solo `)' found.
Message 10 in Test.tex: Solo `)' found.
)}{[])} }}}]]])))
^
+Message 44 in Test.tex: User Regex: -3:Optional arguments [] inside optional arguments [] must be enclosed in {}.
+{[]} ((([[[{{{}}}]]])))
+ ^^^
Message 22 in Test.tex: Comment displayed.
% Envs:
^
@@ -191,6 +197,15 @@ Message 10 in Test.tex: Solo `asoi' found.
\begin{quux} \begin{baz} \end{quux} \end{baz} \end{asoi} \begin{dobedo}
^^^^
Message 22 in Test.tex: Comment displayed.
+% Warning 47 -- ConTeXt environment mismatch -- split from 9
+^
+Message 47 in Test.tex: `section' expected, found `text' (ConTeXt).
+\stoptext
+ ^^^^
+Message 22 in Test.tex: Comment displayed.
+% (Un)fortunately, this is not an error
+^
+Message 22 in Test.tex: Comment displayed.
% Warning 11
^
Message 11 in Test.tex: You should use \ldots to achieve an ellipsis.
@@ -257,12 +272,39 @@ Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
1st. Foo Inc. Ab.cd. foo ab.cd. Foo. bar baz., billy.; bob.: joe.! frank.? james.. george
^
Message 22 in Test.tex: Comment displayed.
+% Bug 54751
+^
+Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
+Mr. ``X'' and Mrs. \(Y\)
+ ^
+Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
+Mr. ``X'' and Mrs. \(Y\)
+ ^
+Message 22 in Test.tex: Comment displayed.
+% ignore commands by default
+^
+Message 22 in Test.tex: Comment displayed.
% Warning 13
^
Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
Look at THIS! It's an error.
^
Message 22 in Test.tex: Comment displayed.
+% after frenchspacing it's not an error
+^
+Message 22 in Test.tex: Comment displayed.
+% warning again
+^
+Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
+Look at THIS! It's an error.
+ ^
+Message 22 in Test.tex: Comment displayed.
+% ignore commands by default
+^
+Message 21 in Test.tex: This command might not be intended.
+Look at \THIS\@! It's not an error. D. E. Knuth.
+ ^^
+Message 22 in Test.tex: Comment displayed.
% Warning 14
^
Message 1 in Test.tex: Command terminated with space.
@@ -355,6 +397,12 @@ Message 1 in input.tex: Command terminated with space.
Message 11 in input.tex: You should use \ldots to achieve an ellipsis.
\this is a test of whether the file is actually inputted...
^^^
+Message 22 in input/file: Comment displayed.
+% -*- TeX -*-
+^
+Message 22 in input/file: Comment displayed.
+% chktex-file 22
+^
Message 22 in Test.tex: Comment displayed.
% Warning 29
^
@@ -364,6 +412,12 @@ The program opens a screen sized 640x200 pixels
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
The program opens a screen sized $640\times200$ pixels
^^^^^^^^^^^^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+Approximately $\frac{2x}{1+x}$ $x$s shouldn't be errors.
+ ^^^^^^^^^^^^^^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+Approximately $\frac{2x}{1+x}$ $x$s shouldn't be errors.
+ ^^^
Message 22 in Test.tex: Comment displayed.
% Warning 30
^
@@ -448,6 +502,9 @@ Message 22 in Test.tex: Comment displayed.
Message 38 in Test.tex: You should not use punctuation in front of quotes.
``An example,'' he said, ``would be great.''
^
+Message 38 in Test.tex: You should not use punctuation in front of quotes.
+``An example,'' he said, ``would be great.''
+ ^
Message 22 in Test.tex: Comment displayed.
% Warning 39
^
@@ -536,6 +593,27 @@ Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
For every $p\nmid n$ you have a cute prime which doesn't divide $n$.
^^^
Message 22 in Test.tex: Comment displayed.
+% Warning about optional arguments inside optional arguments
+^
+Message 44 in Test.tex: User Regex: -3:Optional arguments [] inside optional arguments [] must be enclosed in {}.
+\begin{something}[\cite2[1231]{adadsd}]\end{something}
+ ^^^^^^^^
+Message 44 in Test.tex: User Regex: -3:Optional arguments [] inside optional arguments [] must be enclosed in {}.
+[dasd{dasda[ ads[ dasd ]]}]
+ ^^^^^^
+Message 44 in Test.tex: User Regex: -3:Optional arguments [] inside optional arguments [] must be enclosed in {}.
+adssd[ {}[]]
+ ^^^^^
+Message 44 in Test.tex: User Regex: -3:Optional arguments [] inside optional arguments [] must be enclosed in {}.
+\begin{something}[\cite{adadsd}[1231]]\end{something}
+ ^^^^^^^^^^^^^^^
+Message 44 in Test.tex: User Regex: -3:Optional arguments [] inside optional arguments [] must be enclosed in {}.
+\begin{something}[ ][\cite{adadsd}[1231]]\end{something}
+ ^^^^^^^^^^^^^^^
+Message 22 in Test.tex: Comment displayed.
+% Shouldn't warn
+^
+Message 22 in Test.tex: Comment displayed.
% Math mode check
^
Message 35 in Test.tex: You should perhaps use `\sin' instead.
@@ -557,6 +635,18 @@ Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
Also, $x(3)\text{ is not x(3) but it is $x(3)$}$
^^^^^^
Message 22 in Test.tex: Comment displayed.
+% breqn mode check
+^
+Message 35 in Test.tex: You should perhaps use `\sin' instead.
+sin x
+^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+is not the same as sin x, but is the same as $sin x$
+ ^^^^^^^
+Message 35 in Test.tex: You should perhaps use `\sin' instead.
+is not the same as sin x, but is the same as $sin x$
+ ^^^
+Message 22 in Test.tex: Comment displayed.
This is\\% a comment. Nothing here should be checked(right)?
^
Message 36 in Test.tex: You should put a space in front of parenthesis.
@@ -605,6 +695,18 @@ Message 31 in Test.tex: This text may be ignored.
\end{verbatim} FOO
^^^
Message 22 in Test.tex: Comment displayed.
+% WipeArg
+^
+Message 22 in Test.tex: Comment displayed.
+% Bug 60197 -- "double math mode" should be handled okay
+^
+Message 22 in Test.tex: Comment displayed.
+% Warning 49
+^
+Message 49 in Test.tex: Expected math mode to be on here.
+\]
+^
+Message 22 in Test.tex: Comment displayed.
% Warning 16,15
^
Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$.
@@ -622,6 +724,9 @@ Message 22 in Test.tex: Comment displayed.
Message 22 in Test.tex: Comment displayed.
% There should be no newline at the end of this file to test bug #46539
^
+Message 48 in Test.tex: No match found for `text' (ConTeXt).
+\starttext
+ ^^^^
Message 16 in Test.tex: Mathmode still on at end of LaTeX file.
diff --git a/Build/source/texk/chktex/chktex-src/Test.posix-ere.out b/Build/source/texk/chktex/chktex-src/Test.posix-ere.out
index c89ce369365..f22f757d729 100644
--- a/Build/source/texk/chktex/chktex-src/Test.posix-ere.out
+++ b/Build/source/texk/chktex/chktex-src/Test.posix-ere.out
@@ -19,9 +19,6 @@ So is this \foo
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
\smallskip This is a not. $\foo Neither$ is this.
^^^^^^^^^^^^^^
-Message 9 in Test.tex: `section' expected, found `text'.
-\stoptext
- ^^^^
Message 22 in Test.tex: Comment displayed.
% Warning 2
^
@@ -133,12 +130,18 @@ The Birch--Swinnerton--Dyer conjecture is not correct.
Message 8 in Test.tex: Wrong length of dash may have been used.
The Birch--Swinnerton--Dyer conjecture is not correct.
^^
+Message 8 in Test.tex: Wrong length of dash may have been used.
+The Birch-Swinnerton-Dyer conjecture is not correct (is now caught).
+ ^
Message 22 in Test.tex: Comment displayed.
% Warning 9-10
^
Message 22 in Test.tex: Comment displayed.
% Brackets:
^
+Message 37 in Test.tex: You should avoid spaces in front of parenthesis.
+)}{[])} }}}]]])))
+^
Message 10 in Test.tex: Solo `)' found.
)}{[])} }}}]]])))
^
@@ -191,6 +194,15 @@ Message 10 in Test.tex: Solo `asoi' found.
\begin{quux} \begin{baz} \end{quux} \end{baz} \end{asoi} \begin{dobedo}
^^^^
Message 22 in Test.tex: Comment displayed.
+% Warning 47 -- ConTeXt environment mismatch -- split from 9
+^
+Message 47 in Test.tex: `section' expected, found `text' (ConTeXt).
+\stoptext
+ ^^^^
+Message 22 in Test.tex: Comment displayed.
+% (Un)fortunately, this is not an error
+^
+Message 22 in Test.tex: Comment displayed.
% Warning 11
^
Message 11 in Test.tex: You should use \ldots to achieve an ellipsis.
@@ -257,12 +269,39 @@ Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
1st. Foo Inc. Ab.cd. foo ab.cd. Foo. bar baz., billy.; bob.: joe.! frank.? james.. george
^
Message 22 in Test.tex: Comment displayed.
+% Bug 54751
+^
+Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
+Mr. ``X'' and Mrs. \(Y\)
+ ^
+Message 12 in Test.tex: Interword spacing (`\ ') should perhaps be used.
+Mr. ``X'' and Mrs. \(Y\)
+ ^
+Message 22 in Test.tex: Comment displayed.
+% ignore commands by default
+^
+Message 22 in Test.tex: Comment displayed.
% Warning 13
^
Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
Look at THIS! It's an error.
^
Message 22 in Test.tex: Comment displayed.
+% after frenchspacing it's not an error
+^
+Message 22 in Test.tex: Comment displayed.
+% warning again
+^
+Message 13 in Test.tex: Intersentence spacing (`\@') should perhaps be used.
+Look at THIS! It's an error.
+ ^
+Message 22 in Test.tex: Comment displayed.
+% ignore commands by default
+^
+Message 21 in Test.tex: This command might not be intended.
+Look at \THIS\@! It's not an error. D. E. Knuth.
+ ^^
+Message 22 in Test.tex: Comment displayed.
% Warning 14
^
Message 1 in Test.tex: Command terminated with space.
@@ -355,6 +394,12 @@ Message 1 in input.tex: Command terminated with space.
Message 11 in input.tex: You should use \ldots to achieve an ellipsis.
\this is a test of whether the file is actually inputted...
^^^
+Message 22 in input/file: Comment displayed.
+% -*- TeX -*-
+^
+Message 22 in input/file: Comment displayed.
+% chktex-file 22
+^
Message 22 in Test.tex: Comment displayed.
% Warning 29
^
@@ -364,6 +409,12 @@ The program opens a screen sized 640x200 pixels
Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
The program opens a screen sized $640\times200$ pixels
^^^^^^^^^^^^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+Approximately $\frac{2x}{1+x}$ $x$s shouldn't be errors.
+ ^^^^^^^^^^^^^^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+Approximately $\frac{2x}{1+x}$ $x$s shouldn't be errors.
+ ^^^
Message 22 in Test.tex: Comment displayed.
% Warning 30
^
@@ -448,6 +499,9 @@ Message 22 in Test.tex: Comment displayed.
Message 38 in Test.tex: You should not use punctuation in front of quotes.
``An example,'' he said, ``would be great.''
^
+Message 38 in Test.tex: You should not use punctuation in front of quotes.
+``An example,'' he said, ``would be great.''
+ ^
Message 22 in Test.tex: Comment displayed.
% Warning 39
^
@@ -536,6 +590,12 @@ Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
For every $p\nmid n$ you have a cute prime which doesn't divide $n$.
^^^
Message 22 in Test.tex: Comment displayed.
+% Warning about optional arguments inside optional arguments
+^
+Message 22 in Test.tex: Comment displayed.
+% Shouldn't warn
+^
+Message 22 in Test.tex: Comment displayed.
% Math mode check
^
Message 35 in Test.tex: You should perhaps use `\sin' instead.
@@ -557,6 +617,18 @@ Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
Also, $x(3)\text{ is not x(3) but it is $x(3)$}$
^^^^^^
Message 22 in Test.tex: Comment displayed.
+% breqn mode check
+^
+Message 35 in Test.tex: You should perhaps use `\sin' instead.
+sin x
+^^^
+Message 46 in Test.tex: Use \( ... \) instead of $ ... $.
+is not the same as sin x, but is the same as $sin x$
+ ^^^^^^^
+Message 35 in Test.tex: You should perhaps use `\sin' instead.
+is not the same as sin x, but is the same as $sin x$
+ ^^^
+Message 22 in Test.tex: Comment displayed.
This is\\% a comment. Nothing here should be checked(right)?
^
Message 36 in Test.tex: You should put a space in front of parenthesis.
@@ -605,6 +677,18 @@ Message 31 in Test.tex: This text may be ignored.
\end{verbatim} FOO
^^^
Message 22 in Test.tex: Comment displayed.
+% WipeArg
+^
+Message 22 in Test.tex: Comment displayed.
+% Bug 60197 -- "double math mode" should be handled okay
+^
+Message 22 in Test.tex: Comment displayed.
+% Warning 49
+^
+Message 49 in Test.tex: Expected math mode to be on here.
+\]
+^
+Message 22 in Test.tex: Comment displayed.
% Warning 16,15
^
Message 45 in Test.tex: Use \[ ... \] instead of $$ ... $$.
@@ -622,6 +706,9 @@ Message 22 in Test.tex: Comment displayed.
Message 22 in Test.tex: Comment displayed.
% There should be no newline at the end of this file to test bug #46539
^
+Message 48 in Test.tex: No match found for `text' (ConTeXt).
+\starttext
+ ^^^^
Message 16 in Test.tex: Mathmode still on at end of LaTeX file.
diff --git a/Build/source/texk/chktex/chktex-src/Test.tex b/Build/source/texk/chktex/chktex-src/Test.tex
index 9a7fc05fa04..12854473552 100644
--- a/Build/source/texk/chktex/chktex-src/Test.tex
+++ b/Build/source/texk/chktex/chktex-src/Test.tex
@@ -13,10 +13,6 @@ are nonsense in a TeXnical manner.
So is this \foo
\smallskip This is a not. $\foo Neither$ is this.
-\startsection[title={Testing ConTeXt}]
-These should now be an error.
-\stoptext
-
% Warning 2
This is a faulty reference to \ref{foo}
@@ -55,7 +51,7 @@ in plain TeX---are the key
% Using DashExcpt
The Birch--Swinnerton-Dyer conjecture is correct.
The Birch--Swinnerton--Dyer conjecture is not correct.
-The Birch-Swinnerton-Dyer conjecture is not correct (but not caught).
+The Birch-Swinnerton-Dyer conjecture is not correct (is now caught).
% Warning 9-10
@@ -70,6 +66,18 @@ The Birch-Swinnerton-Dyer conjecture is not correct (but not caught).
\begin{foo} \begin{bar} \end{bar}\end{foo}
+% Warning 47 -- ConTeXt environment mismatch -- split from 9
+\startsection[title={Testing ConTeXt}]
+These should now be an error.
+\stoptext
+\starttext
+
+% (Un)fortunately, this is not an error
+\begin{foo}
+\startbar
+\end{foo}
+\stopbar
+
% Warning 11
Foo...bar. $1,...,3$. $1+...+3$. $1,\cdots,3$. $1\cdot\ldots\cdot3$.
@@ -80,11 +88,31 @@ Foo\dots bar. $1,\ldots,3$. $1+\cdots+3$. $1,\ldots,3$. $1\cdot\cdots\cdot3$.
1st. Foo Inc. Ab.cd. foo ab.cd. Foo. bar baz., billy.; bob.: joe.! frank.? james.. george
1st.\ foo Inc.\ ab.cd.\ foo ab.cd.\ Foo.\ bar baz., billy.; bob.:\ joe.!\ frank.?\ james..\ george
+% Bug 54751
+
+Mr. ``X'' and Mrs. \(Y\)
+
+% ignore commands by default
+\Mr. ``X'' and \Mrs. \(Y\)
+
% Warning 13
Look at THIS! It's an error.
Look at THIS\@! It's an error. D. E. Knuth.
+% after frenchspacing it's not an error
+\frenchspacing
+Look at THIS! It's not an error.
+Look at THIS\@! It's not an error. D. E. Knuth.
+
+% warning again
+\nonfrenchspacing
+Look at THIS! It's an error.
+Look at THIS\@! It's not an error. D. E. Knuth.
+
+% ignore commands by default
+Look at \THIS\@! It's not an error. D. E. Knuth.
+
% Warning 14
\hat
@@ -133,10 +161,12 @@ Do you understand?
\input input.tex
\input input
+\input input/file
% Warning 29
The program opens a screen sized 640x200 pixels
The program opens a screen sized $640\times200$ pixels
+Approximately $\frac{2x}{1+x}$ $x$s shouldn't be errors.
% Warning 30
@@ -197,10 +227,34 @@ You should always write a good introduction.
For every $p\not|n$ you have an ugly prime which doesn't divide $n$.
For every $p\nmid n$ you have a cute prime which doesn't divide $n$.
+% Warning about optional arguments inside optional arguments
+\begin{something}[\cite2[1231]{adadsd}]\end{something}
+[dasd{dasda[ ads[ dasd ]]}]
+adssd[ {}[]]
+\begin{something}[\cite{adadsd}[1231]]\end{something}
+\begin{something}[ ][\cite{adadsd}[1231]]\end{something}
+
+% Shouldn't warn
+\begin{something}[{\cite{adadsd}[1231]}]\end{something}
+\begin{something}[{\cite{{adadsd}}[1231]}]\end{something}
+\begin{something}[{\cite{adadsd}[1231]}]\end{something}
+\begin{something}[ ]{\cite{adadsd}[1231]}\end{something}
+\begin{something}[ ][{\cite{adadsd}[1231]}]\end{something}
+\begin{something}[{} ]{\cite{adadsd}[1231]}\end{something}
+
+
% Math mode check
\ensuremath{sin x\text{is not the same as sin x, but is the same as $sin x$}}
Also, $x(3)\text{ is not x(3) but it is $x(3)$}$
+% breqn mode check
+\begin{darray*}
+sin x
+\begin{dsuspend}
+is not the same as sin x, but is the same as $sin x$
+\end{dsuspend}
+\end{darray*}
+
This is\\% a comment. Nothing here should be checked(right)?
a broken line.
But this is not a \% comment, so we should find this error(right)?
@@ -227,6 +281,23 @@ In section~\ref{sec:4} it is suppressed. % chktex -1
\this is
\end{verbatim} FOO
+% WipeArg
+\autocite[34-35]{text--1---1}
+
+% Bug 60197 -- "double math mode" should be handled okay
+\begin{align}
+ \begin{array} {l}
+ abc
+ \end{array} \\
+ 3 - 2 = 1
+ \pi
+\end{align}
+
+
+% Warning 49
+
+\]
+
% Warning 16,15
$$(
diff --git a/Build/source/texk/chktex/chktex-src/Utility.c b/Build/source/texk/chktex/chktex-src/Utility.c
index 6f05e98f617..390d83d28ff 100644
--- a/Build/source/texk/chktex/chktex-src/Utility.c
+++ b/Build/source/texk/chktex/chktex-src/Utility.c
@@ -87,8 +87,7 @@ int fexists(const char *Filename)
#else
FILE *fh;
-
- if (fh = fopen(Filename, "r"))
+ if ((fh = fopen(Filename, "r")))
{
Retval = TRUE;
fclose(fh);
@@ -97,6 +96,12 @@ int fexists(const char *Filename)
Retval = FALSE;
#endif
+ /* Ensure that it's not a directory */
+ if (Retval && !IsRegFile(Filename))
+ {
+ Retval = FALSE;
+ }
+
return (Retval);
}
@@ -115,7 +120,7 @@ void *sfmemset(void *to, int c, long n)
{
if (to && (n > 0))
{
- n = min(n, BUFSIZ);
+ n = min(n, BUFFER_SIZE);
return (memset(to, c, (size_t) n));
}
@@ -325,7 +330,7 @@ void strwrite(char *To, const char *From, unsigned long Len)
unsigned long i, j;
unsigned long FromLen = strlen(From);
- Len = min(Len, BUFSIZ);
+ Len = min(Len, BUFFER_SIZE);
if (To && From)
{
@@ -681,7 +686,7 @@ void *StkTop(struct Stack *Stack)
int PushFileName(const char *Name, struct Stack *stack)
{
FILE *fh = NULL;
- static char NameBuf[BUFSIZ];
+ static char NameBuf[BUFFER_SIZE];
if (Name && stack)
{
@@ -701,6 +706,7 @@ int PushFileName(const char *Name, struct Stack *stack)
int PushFile(const char *Name, FILE * fh, struct Stack *stack)
{
struct FileNode *fn;
+ uint64_t *filesupp;
if (Name && fh && stack)
{
@@ -710,6 +716,21 @@ int PushFile(const char *Name, FILE * fh, struct Stack *stack)
{
fn->fh = fh;
fn->Line = 0L;
+ if ((filesupp = malloc(sizeof(uint64_t))))
+ {
+ *filesupp = 0;
+ StkPush(filesupp, &FileSuppStack);
+ }
+ else
+ PrintPrgErr(pmNoStackMem);
+ if ((filesupp = malloc(sizeof(uint64_t))))
+ {
+ *filesupp = 0;
+ StkPush(filesupp, &UserFileSuppStack);
+ }
+ else
+ PrintPrgErr(pmNoStackMem);
+
if (StkPush(fn, stack))
return (TRUE);
free(fn->Name);
@@ -754,6 +775,9 @@ char *FGetsStk(char *Dest, unsigned long len, struct Stack *stack)
free(fn->Name);
free(fn);
HasSeenLong = 0;
+
+ StkPop(&FileSuppStack);
+ StkPop(&UserFileSuppStack);
}
while (!Retval && (fn = StkTop(stack)));
}
@@ -805,8 +829,27 @@ unsigned long CurStkLine(struct Stack *stack)
return (LastLine);
}
+long CurStkMode(struct Stack *stack)
+{
+ long * Mode;
+ if ((Mode = StkTop(stack)))
+ return *Mode;
+ /* printf("Empty stack\n"); */
+ return FALSE;
+}
+long *PushMode(long mode, struct Stack *stack)
+{
+ long *m;
+ if ((m = malloc(sizeof(long))))
+ {
+ *m = mode;
+ StkPush(m, stack);
+ return m;
+ }
+ return NULL;
+}
/************************** CHARACTER STACK ******************************/
/*
diff --git a/Build/source/texk/chktex/chktex-src/Utility.h b/Build/source/texk/chktex/chktex-src/Utility.h
index b1b31ec7739..7dc7c9a3178 100644
--- a/Build/source/texk/chktex/chktex-src/Utility.h
+++ b/Build/source/texk/chktex/chktex-src/Utility.h
@@ -89,12 +89,6 @@ struct FileNode
unsigned long Line;
};
-/* Rotates x n bits left (should be an int, long, etc.) */
-#define ROTATEL(x,n) ((x<<n) | (x>>((CHAR_BIT*sizeof(x)) - n)))
-
-/* Rotates x n bits right (should be an int, long, etc.) */
-#define ROTATER(x,n) ((x>>n) | (x<<((CHAR_BIT*sizeof(x)) - n)))
-
/* Subtract 1 because sizeof includes the null terminator.
* WARNING: To use this on a variable, the type should be char[]
* rather than char*, since for some versions of gcc these give
@@ -132,6 +126,8 @@ void *StkTop(struct Stack *Stack);
FILE *CurStkFile(struct Stack *stack);
const char *CurStkName(struct Stack *stack);
unsigned long CurStkLine(struct Stack *stack);
+long CurStkMode(struct Stack *stack);
+long *PushMode(long mode, struct Stack *stack);
char *FGetsStk(char *Dest, unsigned long len, struct Stack *stack);
int PushFileName(const char *Name, struct Stack *stack);
int PushFile(const char *, FILE *, struct Stack *);
diff --git a/Build/source/texk/chktex/chktex-src/chktexrc b/Build/source/texk/chktex/chktex-src/chktexrc
deleted file mode 100644
index c6355f8db12..00000000000
--- a/Build/source/texk/chktex/chktex-src/chktexrc
+++ /dev/null
@@ -1,802 +0,0 @@
-##
-## ChkTeX, example resource file for ChkTeX.
-## Copyright (C) 1995-96 Jens T. Berger Thielemann
-##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation; either version 2 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-##
-## Contact the author at:
-## Jens Berger
-## Spektrumvn. 4
-## N-0666 Oslo
-## Norway
-## E-mail: <jensthi@ifi.uio.no>
-##
-
-#####################################################################
-#
-# Note: The format has changed slightly (again). The { ... }
-# syntax does now mean case-sensitive comparing, while [ ... ] means
-# case-insensitive comparing of the keywords. Case-insensitive
-# comparing of the keywords is only supported on a few of the
-# keywords (it's not meaningful in all contexts, and it slows ChkTeX
-# down). Keywords supporting this are marked throughout the file.
-#
-# You may also reset a list by saying "KEYWORD = { ... }"; it will
-# then be set equal to the contents of the list you specify.
-#
-# Comments begin with `#', and continues for the rest of the line.
-# Blank lines plus leading and trailing spaces are of course ignored.
-#
-# The general format of this file is the following:
-#
-# KEYWORD { item item ...} [ item item ... ] /* Adds items */
-#
-# KEYWORD [ item item ...] { item item ... } /* Adds items */
-#
-# KEYWORD = item
-#
-# KEYWORD = { item item ... } /* Clears list before adding */
-#
-# KEYWORD = [ item item ... ] /* Clears list before adding */
-#
-# This does _not_ mean that you may alternate the forms; certain
-# keywords demands a list, other a single value. You thus have to
-# look at the examples of their use.
-#
-# Please also note that if you specify a list-keyword twice, we'll
-# concatenate the lists. If you specify a item-keyword twice, we'll
-# kill the previous value.
-#
-# We are slightly context-sensitive when detecting tokens like "}"
-# and "]"; they have to be preceded by a space. This generally makes
-# life easier.
-#
-# Items are separated by spaces. Newlines are considered as spaces,
-# but can't be escaped. You may surround items with quotes (`"') to
-# easily put spaces into them.
-#
-# Escape sequences available:
-#
-# Sequence Resulting character
-# ! A space (type `! ', not just a exclamation mark)
-# !" "
-# !# #
-# !! !
-# !{ {
-# !} }
-# ![ [
-# !] ]
-# != =
-# !b Backspace
-# !n New line
-# !r Carriage return
-# !t Tab
-# !f Form feed
-# !xNN NN must be a hexadecimal number (00 - ff),
-# _both_ characters must be included.
-# !dNNN DDD must be a decimal number (000 - 255), all
-# three characters must be included. Unspecified
-# results if DDD > 255.
-# !NNN DDD must be a octal number (000 - 377), all
-# three characters must be included. Unspecified
-# results if DDD > 377.
-#
-# Minor note: As you can see, most of these escape sequences are
-# equal to those in C (with some extensions); however, we use !
-# instead of \ as escape character for obvious reasons.
-#
-#
-# Quick summary of keywords follows. Keywords marked with a * accept
-# keywords accepting case-insensitive lists.
-#
-# Abbrev* - A list of abbreviations not automatically caught.
-# CenterDots - Commands/characters which should have \cdots in
-# between.
-# CmdLine - Default commandline options. These will be
-# processed before the ones you give on the command
-# line.
-# HyphDash \
-# NumDash - Number of dashes allowed in different contexts.
-# WordDash /
-# IJAccent - Commands which puts an accent _over_ their
-# argument.
-# Italic - Commands immediately turning on italic mode.
-# ItalCmd - Commands putting their argument into italic.
-# Linker - Commands which should have a non-breaking space in
-# front.
-# LowDots - Commands/characters which should have \ldots in
-# between.
-# MathEnvir - Environments which turn on math mode.
-# MathCmd - Commands which turn on math mode.
-# TextCmd - Commands which turn off math mode.
-# MathRoman - Mathematical operators with LaTeX replacement
-# defined.
-# NoCharNext - Insists on that certain commands aren't followed by
-# certain characters.
-# NonItalic - Commands immediately turning off italic mode.
-# NotPreSpaced- Commands which should not have a space in front of
-# them.
-# Primitives - Primitive TeX commands.
-# PostLink - Commands which generates a page reference.
-# OutFormat - Formats to use for output. See the -f & -v switch
-# in the main doc.
-# QuoteStyle - Either "Traditional" or "Logical". See main doc,
-# warning 38.
-# Silent - These commands do not produce any textual output;
-# and are thus allowed to have a space after them.
-# TabSize - Tab size you are using.
-# TeXInputs - Paths to search \input and \include files for.
-# UserWarn* - These strings will be searched for throughout the
-# text.
-# VerbEnvir - Environments which contents should be ignored.
-# VerbClear - String we will overwrite unwanted data with.
-# WipeArg - Commands (with arguments) which should be ignored
-# in the checking.
-#
-
-
-#####################################################################
-#
-# Enter which type of quote-style you are using here. Currently, we
-# support the following styles:
-#
-# Style Example of use
-# Traditional "An example," he said, "would be great."
-# Logical "An example", he said, "would be great".
-#
-
-QuoteStyle = Logical
-
-#####################################################################
-#
-# Enter here what interval you have between your tabs. Only regular
-# intervals are supported.
-#
-
-TabSize = 8
-
-#####################################################################
-#
-# Here, you can put default commandline options; most users would for
-# instance like to put -v2 here.
-#
-
-CmdLine
-{
-
-}
-
-#####################################################################
-#
-# These patterns will be searched for through the text; no matter
-# whether they appear as normal text, commands or whatever.
-# Currently case-sensitive. They are not found in comments.
-#
-# I usually define a special command like this:
-#
-# \def\unknown{\large\bf??}
-#
-# which I use whenever there is some information I don't have at the
-# moment of writing. Thus, it makes sense to search for it.
-#
-# You should be able to develop your own uses for this.
-#
-
-UserWarn
-{
-
- \unknown
-###
-#
-# Another example; one should write \chktex or Chk\TeX - never ChkTeX.
-#
-###
-
- ChkTeX
-}
-[
-
-###
-#
-# You may put case-insensitive patterns here.
-#
-###
-
-]
-
-
-###
-#
-# These patterns will be searched for, no matter whether they appear
-# as normal text, commands or arguments. However, they will _not_
-# match in verbatim environments.
-#
-# Remember that you have to escape (with a !) the following
-# characters: "#!= as well as spaces and {}[] if they are proceeded by
-# a space.
-#
-# Since these are PCRE regular expressions, you can use (?i) to make
-# the expression case insensitive. See the man pages (man pcresyntax)
-# or the nicely formatted http://perldoc.perl.org/perlre.html for
-# documentation on the regular expression syntax. Note however that
-# some the features of perl regular expression are not available such
-# as running code (callouts), and replacing.
-#
-# An initial PCRE comment (?# ... ) can be used change what is
-# displayed, thereby reminding yourself how to fix the problem.
-#
-###
-UserWarnRegex
-{
-
- (?!#Always! use! \nmid)\\not! *(\||\\mid)
-
- # capitalize section when saying Section 6.
- (?!#-1:Capitalize! before! references)PCRE:\b(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref
- (?!#1:Capitalize! before! references)POSIX:([^[:alnum:]]|^)(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref
-
- # spell it out.
- # PCRE:(?i)\bintro\b(?!#Spell! it! out.! This! comment! is! not! used.)
- # POSIX:([^[:alnum:]]|^)intro([^[:alnum:]]|$)
-
- # Pretty tables--see http://texdoc.net/texmf-dist/doc/latex/booktabs/booktabs.pdf
- (?!#-2:Use! \toprule,! midrule,! or! \bottomrule! from! booktabs)\\hline
- # This relies on it being on a single line, and not having anything
- # else on that line. With PCRE we could match balanced [] and {},
- # but I wonder if it's worth the complexity...
- (?!#-2:Vertical! rules! in! tables! are! ugly)\\begin\{(array|tabularx?\*?)\}(\[.*\])?\{.*\|.*\}
-
-}
-
-
-#####################################################################
-#
-# Here you can list the path of where ChkTeX should look for files it
-# \inputs. The // postfix is now supported; if you append a double
-# path-separator we'll recursively search that directory directories.
-# MS-DOS users must append \\ instead, e.g. "C:\EMTEX\\".
-#
-# If you under either MS-DOS or UNIX wish to search an entire
-# partition or the complete directory tree, you must use *three*
-# slashes, e.g. "c:\\\" or "///". This may be considered to be a bug.
-#
-# By default, we'll search the current directory (not recursively,
-# put "//" in the list for this); any paths specified below will be
-# searched in addition to this.
-#
-
-TeXInputs
-{
-
-}
-
-#####################################################################
-#
-# Here you may specify more output formats for use with the -v option,
-# it simply indexes into this list. Remember to use ! instead of \,
-# though.
-#
-# For explanation of how % fields expand; look at ChkTeX.{dvi,ps,pdf}.
-#
-# We will by default select entry number _two_ in this list (we count
-# from 0), and -v without any parameter selects entry number _three_.
-#
-
-OutFormat
-{
-
-# -v0; silent mode
-%f%b%l%b%c%b%n%b%m!n
-
-# -v1; normal mode
-"%k %n in %f line %l: %m!n%r%s%t!n%u!n"
-
-# -v2; fancy mode
-"%k %n in %f line %l: %m!n%r%i%s%I%t!n!n"
-
-# -v3; lacheck mode
-"!"%f!", line %l: %m!n"
-
-# -v4; verbose lacheck mode
-"!"%f!", line %l: %m!n%r%s%t!n%u!n"
-
-# -v5; no line number, ease auto-test
-"%k %n in %f: %m!n%r%s%t!n%u!n"
-
-# -v6; emacs compilation mode
-"!"%f!", line %l.%c:(#%n) %m!n"
-
-}
-
-
-
-#####################################################################
-#
-# These commands should be ignored when detecting whether a command
-# is ended by a space. You can specify regular expressions in the []
-# section in case you have many custom macros that can be safely
-# terminated with a space.
-#
-
-Silent
-{
- \rm \em \bf \it \sl \sf \sc \tt \selectfont
- \rmfamily \sffamily \ttfamily \mdseries \bfseries
- \slshape \scshape \relax
- \vskip \pagebreak \nopagebreak
-
- \textrm \textem \textbf \textit \textsl \textsf \textsc \texttt
-
- \clearpage \ddots \dotfill \flushbottom \fussy \indent \linebreak
- \onecolumn \pagebreak \pushtabs \poptabs \scriptsize \sloppy
- \twocolumn \vdots
- \today \kill \newline \thicklines \thinlines
-
- \columnsep \space \item \tiny \footnotesize \small \normalsize
- \normal \large \Large \LARGE \huge \Huge \printindex
-
- \newpage \listoffigures \listoftables \tableofcontents
- \maketitle \makeindex
-
- \hline \hrule \vrule
-
- \centering
-
- \bigskip \medskip \smallskip
-
- \noindent \expandafter
-
- \makeatletter \makeatother
-
- \columnseprule
-
- \textwidth \textheight \hsize \vsize
-
- \if \fi \else
-
- \csname \endcsname
-
- \z@ \p@ \@warning \typeout
-
- \dots \ldots \input \endinput \nextline \leavevmode \cdots
- \appendix \listfiles \and \quad
- \hskip \vfill \vfil \hfill \hfil \topmargin \oddsidemargin
- \frenchspacing \nonfrenchspacing
- \begingroup \endgroup \par
-
- \vrefwarning \upshape \headheight \headsep \hoffset \voffset
- \cdot \qquad
- \left \right
- \qedhere
-
- \xspace
-
- \addlinespace \cr \fill \frontmatter
- \toprule \midrule \bottomrule
-
-}[
-# Here you can put regular expressions to match Silent macros. It was
-# designed for the case where you have many custom macros sharing a
-# common prefix, but can of course be used for other things.
-
-# Support ConTeXt to at least some extent
-\\start.* \\stop.*
-
-]
-
-#####################################################################
-#
-# Here, you can specify the length of various dashes. We sort the
-# dash according to which type of characters that are on the left and
-# right of it. We are only conclusive if they are the same.
-#
-# We associate as follows:
-#
-# Name Type of character on each side
-# HyphDash Alphabetic (foo-bar)
-# NumDash Numeric (2--3)
-# WordDash Space (like this --- see?)
-#
-# Below you specify how many dashes which are legal in each case. We
-# define 0 as a magic constant which always generates an error. You
-# may specify more than one legal dash-length.
-#
-# Let's look at an example. You use the following dash-syntax:
-#
-# foo-bar
-# 2--3
-# like this---see?
-#
-#
-# HYPHDASH { 1 3 } # Either a hyphen, or inter-word
-# NUMDASH { 2 } # Between words
-# WORDDASH { 0 } # We never use this
-#
-
-HyphDash
-{
- 1 3
-}
-
-NumDash
-{
- 2
-}
-
-WordDash
-{
- 3
-}
-
-#####################################################################
-#
-# Here are exceptions to the dash rules above. For example, an
-# n-dash -- between words is usually wrong, but in some cases it is
-# correct, such as when naming a theorem. The Birch--Swinnerton-Dyer
-# conjecture is one example where the difference matters. You can
-# tell that Birch is one person and Swinnerton-Dyer is another.
-#
-# Adding line suppressions for these is possible, but can quickly
-# become tedious if a certain theorem is referenced often. For this
-# reason exceptions can be specified here. They are case-sensitive.
-#
-
-DashExcpt
-{
- Birch--Swinnerton-Dyer
-}
-
-#####################################################################
-#
-# This keyword indicates commands whose argument isn't LaTeX code,
-# and thus should be ignored.
-#
-# After the command, you may place arguments that you wish that
-# should be wiped in the process; use [] for optional arguments, {}
-# for required ones and * if the command supports an alternative
-# variant. These should be separated from the command with a colon.
-# Some commands (e.g. \cmidrule) use () to delimit and optional
-# argument and so this syntax is supported as well.
-#
-# For instance, if you would like to wipe the \newcommand command,
-# you would declare it as \newcommand:*[][]{}
-#
-# These commands may be "executed" before they're wiped, so you will
-# typically also wish to list filehandling commands and similar here.
-#
-
-WipeArg
-{
- \label:{} \ref:{} \eqref:{} \vref:{} \pageref:{} \index:[]{}
- \cite:[][]{} \nocite:{}
- \input:{} \verbatiminput:[]{} \listinginput:[]{}{}
- \verbatimtabinput:[]{} \include:{} \includeonly:{}
- \bibitem:[]{}
- \cline:{} \cmidrule:[](){}
- \href:{}{}
- # Cleveref -- there are many others that could be here as well...
- \cref:*{} \cpageref:*{} \crefrange:*{}{} \cpagerefrange:*{}{}
- \Cref:*{} \Cpageref:*{} \Crefrange:*{}{} \Cpagerefrange:*{}{}
- # natbib
- \citet:*[][]{} \citep:*[][]{} \citealt:*{} \citealp:*[]{} \citeauthor:*{}
- \Citet:*[][]{} \Citep:*[][]{} \Citealt:*{} \Citealp:*[]{} \Citeauthor:{}
- \citetext:{} \citeyear:*{} \citeyearpar:{}
- # tipa which uses "
- \textipa:{}
-}
-
-#####################################################################
-#
-# These environments contain material which will be typeset as
-# mathematics by LaTeX. This turns on/off some warnings.
-#
-# We will automagically append a * to each keyword.
-#
-
-MathEnvir
-{
- displaymath math eqnarray array equation
- align alignat gather flalign multline
-}
-
-#####################################################################
-#
-# These commands contain material which will be typeset as mathematics
-# by LaTeX. The commands are assumed to have one mandatory argument
-# which is in math mode. This turns on/off some warnings.
-#
-
-MathCmd
-{
- \ensuremath
-}
-
-#####################################################################
-#
-# These commands contain material which will _not_ be typeset as
-# mathematics by LaTeX even if it would otherwise be in mathmode. The
-# commands are assumed to have one mandatory argument which is in text
-# mode. This turns on/off some warnings.
-#
-
-TextCmd
-{
- \text \intertext \shortintertext \mbox
-}
-
-#####################################################################
-#
-# These environments contains material which contents should be
-# ignored.
-#
-# We will automagically append a * to each keyword.
-#
-
-VerbEnvir
-{
- verbatim comment listing verbatimtab rawhtml errexam picture texdraw
- filecontents pgfpicture tikzpicture minted lstlisting IPA
-}
-
-#####################################################################
-#
-# ChkTeX does automagically catch most abbreviations; the ones we
-# need to list here, are those which are most likely to be followed
-# by a word with an upper-case letter (that is not the beginning of a
-# new sentence).
-#
-# The case-insensitive abbreviations are not really case-insensitive,
-# it seems to be more practical to only let the first character be
-# case-insensitive, while the remaining are case-sensitive.
-#
-# To speed up the searching process somewhat, we require that these
-# end in a `.', this should not be a problem.
-#
-# Much of this work (both the abbreviations below, and the regexps
-# necessary to catch the remaining automatically) have been provided
-# by Russ Bubley, <russ@scs.leeds.ac.uk>.
-#
-
-Abbrev
-{
-# Ordinals
-1st. 2nd. 3rd. 4th.
-# Titles
-Mr. Mrs. Miss. Ms. Dr. Prof. St.
-
-#
-# Days
-# Mon. Tue. Wed. Thu. Fri. Sat. Sun.
-#
-# Months
-# Jan. Feb. Mar. Apr. May. Jun. Jul. Aug. Sep. Oct. Nov. Dec.
-#
-# Letters
-# Kt. Jr.
-#
-# Corporate
-# Co. Ltd.
-#
-# Addresses
-# Rd. Dr. St. Ave. Cres. Gdns. Sq. Circ. Terr. Pl. Arc. La. Clo. Ho. Est. Gn.
-#
-# Misc.
-# oe. pbab. ps. rsvp. Tx.
-}
-[
-###
-#
-# The first letter is case-insensitive in the abbrevs in this
-# list. Due to the nature of the checking algorithm used for
-# this, entries consisting of only one character will be
-# silently ignored.
-#
-##
-
-# Latin
-# cf. "et al." etc. qed. qv. viz.
-#
-# Corporate
-# inc. plc.
-#
-# Misc
-# fax. pcs. qty. tel. misc.
-]
-
-#####################################################################
-#
-# Commands which accent characters, meaning that \i or \j (\imath and
-# \jmath in mathmode) should be used instead of `i' and `j'
-#
-
-IJAccent
-{
- \hat \check \breve \acute \grave \tilde \bar \vec \dot \ddot
-
- \' \` \^ \" \~ \= \. \u \v \H \t
-
-###
-#
-# The remaining accent commands (\c,\d,\b) put their accent _under_
-# the character, not above, and should thus be used with normal i's
-# and j's.
-#
-###
-
-}
-
-#####################################################################
-#
-# Commands which, when the group is terminated, needs italic
-# correction.
-#
-
-Italic
-{
- \it \em \sl
- \itshape \slshape
-}
-
-#####################################################################
-#
-# Commands which makes the font non-italic.
-#
-
-NonItalic
-{
- \bf \rm \sf \tt \sc
- \upshape
-}
-
-#####################################################################
-#
-# Commands which put their argument into italic (and thus possibly
-# needs italic correction in the end).
-#
-# This is currently empty, since \textit, \textsl and \emph do that
-# automatically.
-#
-
-ItalCmd
-{
-}
-
-#####################################################################
-#
-# These commands all have in common that a pagebreak right in front
-# of them is highly undesirable; thus there should be no space in
-# front of them.
-#
-
-PostLink
-{
- \index \label
-}
-
-#####################################################################
-#
-# These commands should not have a space in front of them for various
-# reasons. I.e. much the same as POSTLINK, but produces another
-# warning.
-#
-
-NotPreSpaced
-{
- \footnote \footnotemark \/
-}
-
-#####################################################################
-#
-# The commands listed here, should be prepended with a `~', as in
-# "look in table~\ref{foo}", to avoid the references being split
-# across lines.
-#
-
-Linker
-{
- \ref \vref \pageref \eqref \cite
-}
-
-#####################################################################
-#
-# Commands/characters which should have \cdots in between, e.g.
-# $1+2+3+\cdots+n$.
-#
-
-CenterDots
-{
- = + - \cdot \div & \times \geq \leq < >
-}
-
-#####################################################################
-#
-# Commands/characters which should have \ldots in between, e.g.
-# $1,2,3,\ldots,n$.
-#
-
-LowDots
-{
- . , ;
-}
-
-#####################################################################
-#
-# In maths mode, there are certain aliases for mathematical operators
-# like sin, cos, etc. Ignore the leading backslash in the commands,
-# and so forth. You should list these below.
-#
-
-MathRoman
-{
- log lg ln lim limsup liminf sin arcsin sinh cos arccos cosh tan
- arctan tanh cot coth sec csc max min sup inf arg ker dim hom det
- exp Pr gcd deg bmod pmod mod
-}
-
-#####################################################################
-#
-# These TeX commands have become unnecessary, as there are LaTeX
-# commands that does the same. Purists should thus avoid these in
-# their code.
-#
-# (These are a spell-corrected version of those lacheck uses).
-#
-
-Primitives
-{
- \above \advance \catcode \chardef \closein \closeout \copy \count
- \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
- \expandafter \font \hskip \vskip \openout
-}
-
-#####################################################################
-#
-# Format: \command:characters
-#
-# We'll emit a warning if any of characters are found after the
-# command.
-#
-
-NoCharNext
-{
- \left:{}$ \right:{}$
-}
-
-#####################################################################
-#
-# We're killing \verb@...@ commands and the arguments of the commands
-# listed above in WipeArg by overwriting them with a string or a
-# single character.
-#
-# This should not contain an alphabetic character (in case the user
-# writes (\foo\verb@bar@), neither should it contain be one of
-# LaTeX's reserved characters (`#$%&~_^\{}'), or any parenthesis
-# character ('()[]{}'). If possible, don't use a punctuation
-# character, either, or any spacing character.
-#
-# The asterisk is also unsuitable, as some commands behave in another
-# way if they are appended with an asterisk. Which more or less
-# leaves us with the pipe.
-#
-# Please note that this may also be a _string_, which will be
-# repeated until the proper length is reached.
-#
-
-VerbClear = "|"
-
-#
-# All for now - have fun.
-#
-#####################################################################
diff --git a/Build/source/texk/chktex/chktex-src/chktexrc.in b/Build/source/texk/chktex/chktex-src/chktexrc.in
new file mode 100644
index 00000000000..491a5792fc8
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/chktexrc.in
@@ -0,0 +1,989 @@
+#### -*- conf -*- ####
+##### TODO: Do I want a TOC? Index?...
+##### TODO: Use something besides errexam?
+##### TODO: Color/frame for default value
+###############################################################################
+#### This fiie is input to a simple "tangle" process. The extions of .in is
+#### a little misleading in that it's not managed by autotools or m4. Sorry.
+####
+#### Two different files are created from this file by calling MakeChkTeXRC.pl
+#### 1. chktexrc, a self-documenting chktecrc example
+#### a. Lines with 3 (or more) leading #'s are discarded
+#### b. Other lines are kept as is
+#### 2. ChkTeXRC.tex, LaTeX documentation for chktecrc.
+#### a. Lines with 4 (or more) leading #'s are discarded
+#### b. Lines with 0 or 2 (exactly) leading #'s are discarded
+#### c. Lines with 1 or 3 (exactly) leading #'s are turned in (LaTeX-only) lines
+####
+#### In other words
+#### 1. Lines with 1 or 3 leading #'s are included in the LaTeX
+#### documentation with the #'s stripped off
+#### 2. Lines with 0, 1 or 2 are included as is in the example
+#### chktexrc file
+#### #
+###############################################################################
+## Example resource file for ChkTeX.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+##
+## For more information visit https://www.nongnu.org/chktex/
+##
+
+### \subsubsection{The \rsrc\ file format}
+## chktexrc file format
+#
+# The chktecrc file is essentially a bunch of variable assignments.
+# There are two types of variables, those that take single items and
+# those that take lists.
+#
+# In turn, there are two types of lists, case-sensitive and case-insentive.
+# Case-sensitive lists are delimited by @verb@{@endverb@ and @verb@}@endverb@
+# while case-insensitive are delimited by @verb@[@endverb@ and @verb@]@endverb@.
+# Only some variables support case insensitive lists, since in many
+# cases it doesn't make sense and would be unnecessarily slow. Those
+# variables that @emph@do@endemph@ support case-insensitive lists will be marked as
+# such throughout the file.
+#
+# Variables can be set with or without an equals sign. If included, the
+# @verb@=@endverb@ causes the variable to be overwritten. This is the only thing
+# that makes sense for varibles taking a single item and so we always
+# include it in that case. For list variables, omitting the equals
+# sign will cause the items in the list to be appended instead of
+# overwriting the entire list.
+#
+# Below are all the ways in which a variable can be set. Note that lists
+# can span lines, though this is not shown here for brevity.
+#
+#
+### \begin{verbatim}
+# VariableName = item
+# # Overwrites
+# VariableName = { Item1 Item2 ... }
+# VariableName = [ item1 item2 ... ]
+# VariableName = { Item1 Item2 ... } [ item item ... ]
+# VariableName = [ item1 item2 ... ] { Item Item ... }
+# # Appends
+# VariableName { Item3 Item4 ... }
+# VariableName [ item3 item4 ... ]
+# VariableName { Item3 Item4 ... } [ item item ... ]
+# VariableName [ item3 item4 ... ] { Item Item ... }
+### \end{verbatim}
+#
+#
+# Comments begin with @verb@#@endverb@, and continue for the end of the line.
+# Blank lines plus leading and trailing spaces are ignored.
+# Items are separated by spaces.
+# Newlines are considered spaces, but can't be escaped.
+# You can use double quotes @verb@"@endverb@ to surround an item with spaces, or you can
+# escape spaces as described later.
+#
+# Detection of tokens like @verb@}@endverb@ are somewhat context sensitve---they
+# have to be preceded by a space (or newline). This allows them to be
+# part of an item without escaping. Since some variables require such
+# characters, this generally makes life easier.
+#
+# To include characters that might otherwise interfere, escape
+# sequences are provided. They are similar to those in C, but use
+# @verb@!@endverb@ instead of @verb@\@endverb@ for obvious reasons.
+# The entire list is below.
+#
+### \vspace{0.5\baselineskip}
+### \begin{tabular}{p{0.2\textwidth}p{0.7\textwidth}}
+# @bf Sequence @&@ @bf Resulting character @\\@
+# @verb@! @endverb@ @&@ Space @\\@
+# @verb@!"@endverb@ @&@ @verb@"@endverb@ @\\@
+# @verb@!#@endverb@ @&@ @verb@#@endverb@ @\\@
+# @verb@!!@endverb@ @&@ @verb@!@endverb@ @\\@
+# @verb@!{@endverb@ @&@ @verb@{@endverb@ @\\@
+# @verb@!}@endverb@ @&@ @verb@}@endverb@ @\\@
+# @verb@![@endverb@ @&@ @verb@[@endverb@ @\\@
+# @verb@!]@endverb@ @&@ @verb@]@endverb@ @\\@
+# @verb@!=@endverb@ @&@ @verb@=@endverb@ @\\@
+# @verb@!b@endverb@ @&@ Backspace @\\@
+# @verb@!n@endverb@ @&@ New line @\\@
+# @verb@!r@endverb@ @&@ Carriage return @\\@
+# @verb@!t@endverb@ @&@ Tab @\\@
+# @verb@!f@endverb@ @&@ Form feed @\\@
+# @verb@!xNN@endverb@ @&@ NN must be a hexadecimal number (00 - ff),
+# both characters must be included. @\\@
+# @verb@!dNNN@endverb@ @&@ NNN must be a decimal number (000 - 255), all
+# three characters must be included.
+# Unspecified results if NNN > 377. @\\@
+# @verb@!NNN@endverb@ @&@ NNN must be a octal number (000 - 377), all
+# three characters must be included.
+# Unspecified results if NNN > 377.
+### \end{tabular}
+
+### \subsubsection{Settings in the \rsrc\ file}
+## Available Settings
+#
+# All avaiable settings follow.
+#
+
+## QuoteStyle
+### \medskip
+### \begin{chktexrcsimplevar}{QuoteStyle}
+#
+# The type of quote-style you are using. There are currently two
+# styles:
+#
+# Traditional:
+### \begin{errexam}
+# "An example," he said, "would be great."
+### \end{errexam}
+#
+# Logical:
+### \begin{errexam}
+# "An example", he said, "would be great".
+### \end{errexam}
+#
+### \chktexrcdefault\begin{verbatim}
+QuoteStyle = Logical
+### \end{verbatim}
+### \end{chktexrcsimplevar}
+
+
+## TabSize
+### \begin{chktexrcsimplevar}{TabSize}
+#
+# The width of a tab. This is used for formatting the error message.
+# Only positive integers are allowed.
+#
+### \chktexrcdefault\begin{verbatim}
+TabSize = 8
+### \end{verbatim}
+### \end{chktexrcsimplevar}
+
+
+## CmdSpaceStyle
+### \medskip
+### \begin{chktexrcsimplevar}{CmdSpaceStyle}
+#
+# How to treat a command is followed by punction. In all cases the
+# warnings are also governed by the main warning settings, namely
+# warnings 12 and 13 about interword and intersentence spacings.
+### These can be found on page~\pageref{warn:interword}.
+#
+# If set to Ignore, then it won't print any warnings when pucntuation
+# follows a command.
+#
+#
+# If CmdSpaceStyle is set to InterWord, then it will print warnings
+# when interword spacing should (potentially) be used. For example,
+# without a command the following will trigger warning 12
+#
+### \begin{errexam}
+# @verb@I've seen a UFOs, etc. in my life.@endverb@
+### \end{errexam}
+#
+# And if set to InterWord, so will
+#
+### \begin{errexam}
+# @verb@I've seen a UFOs, \etc. in my life.@endverb@
+### \end{errexam}
+#
+#
+# If set to InterSentence, then it will print warnings when
+# intersentence spacing should (potentially) be used. For example,
+# without a command the following will trigger warning 13
+#
+### \begin{errexam}
+# @verb@I've seen an UFO! Right over there!@endverb@
+### \end{errexam}
+#
+# And if set to InterSentence, so will
+#
+### \begin{errexam}
+# @verb@I've seen an \UFO! Right over there!@endverb@
+### \end{errexam}
+#
+#
+# Setting CmdSpaceStyle to Both will cause warnings to be printed in
+# both cases.
+#
+### \chktexrcdefault\begin{verbatim}
+CmdSpaceStyle = Ignore
+### \end{verbatim}
+### \end{chktexrcsimplevar}
+
+
+## CmdLine
+### \begin{chktexrclistvar}{CmdLine}
+#
+# Default command-line options. For instance, you might like to put
+# @verb@-v2@endverb@ here.
+#
+### \chktexrcdefault\begin{verbatim}
+CmdLine
+{
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## UserWarn
+### \begin{chktexrclistvar*}{UserWarn}
+#
+# Arbitrary strings to warn about. You can put here to help you find
+# your own little foibles. See also@ref@UserWarnRegex@endref@.
+#
+# These patterns will be searched for throughout the text; regardless
+# of whether they appear as normal text, commands, in math mode, etc.
+# They are @emph@not@endemph@ found in comments.
+#
+# Suppose you define a special command like this:
+### \begin{verbatim}
+# \def\unknown{\large\bf??}
+### \end{verbatim}
+# which you use whenever you don't have some information at the time
+# of writing. Thus, it makes sense to warn on it, and this is a
+# convenient way to do so.
+#
+### \chktexrcdefault\begin{verbatim}
+UserWarn
+{
+ \unknown
+ # One should write \chktex or Chk\TeX - never ChkTeX.
+ ChkTeX
+}
+[ # You may put case-insensitive patterns here.
+]
+### \end{verbatim}
+### \end{chktexrclistvar*}
+
+
+## UserWarnRegex
+### \begin{chktexrclistvar}{UserWarnRegex}
+#
+# A more sophisticated version of@ref@UserWarn@endref@ using regular
+# expressions. Use of these will be automatically disabled if @ChkTeX@
+# was built without regular expression support. Because @ChkTeX@ can be
+# with support for either POSIX or PCRE flavors of regular expression,
+# some of the following will not apply in all cases. An expression
+# can be defined only when PCRE is enabled by prepending the
+# expression with @verb@PCRE:@endverb@ and similarly with @verb@POSIX:@endverb@.
+#
+# These patterns will be searched for, no matter whether they appear
+# as normal text, commands, or arguments. However, they will @emph@not@endemph@
+# match in verbatim environments (see@ref@VerbEnvir@endref@).
+#
+# Remember that you have to escape (with a @verb@!@endverb@) the characters
+# @verb@"#!=@endverb@, as well as spaces and @verb@{}[]@endverb@ if they are
+# proceeded by a space.
+#
+# When using PCRE regular expressions, you can use @verb@(?i)@endverb@ to make
+# the expression case insensitive. See the man pages (man pcresyntax)
+# or the nicely formatted http://perldoc.perl.org/perlre.html for
+# documentation on the regular expression syntax. Note, however, that
+# some the features of perl regular expression are not available such
+# as running code (callouts), and replacing.
+#
+# An initial PCRE-style comment @verb@(?# ... )@endverb@ can be used
+# to change what is displayed, thereby reminding yourself how to fix
+# the problem. This works even for POSIX expressions.
+#
+### \chktexrcdefault\begin{verbatim}
+UserWarnRegex
+{
+ (?!#Always! use! \nmid)\\not! *(\||\\mid)
+
+ # Capitalize section when saying Section 6.
+ (?!#-1:Capitalize! before! references)PCRE:\b(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref
+ (?!#1:Capitalize! before! references)POSIX:([^[:alnum:]]|^)(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref
+
+ # Spell it introduction
+ # PCRE:(?i)\bintro\b(?!#Spell! it! out.! This! comment! is! not! used.)
+ # POSIX:([^[:alnum:]]|^)intro([^[:alnum:]]|$)
+
+ # Pretty tables--see http://texdoc.net/texmf-dist/doc/latex/booktabs/booktabs.pdf
+ (?!#-2:Use! \toprule,! midrule,! or! \bottomrule! from! booktabs)\\hline
+ # This relies on it being on a single line, and not having anything
+ # else on that line. With PCRE we could match balanced [] and {},
+ # but I wonder if it's worth the complexity...
+ (?!#-2:Vertical! rules! in! tables! are! ugly)\\begin\{(array|tabularx?\*?)\}(\[.*\])?\{.*\|.*\}
+
+ (?!#-3:Optional! arguments! []! inside! optional! arguments! []! must! be! enclosed! in! {})\[(?!![^\]\[{}]*{(?!![^\]\[{}]*}))[^\]]*\[
+
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## TeXInputs
+### \begin{chktexrclistvar}{TeXInputs}
+#
+# A list of paths where @ChkTeX@ should look for files it @verb@\input@endverb@s.
+# By default, the current directory is searched (not recursively, use
+# @verb@//@endverb@ for that, see below).
+#
+# A @verb@//@endverb@ postfix is supported:
+# if you append a double path-separator we'll recursively search that
+# directory's directories. MS-DOS users must append @verb@\\@endverb@
+# instead, e.g. @verb@C:\EMTEX\\@endverb@. In order to search an
+# entire directory tree, you must use @emph@three@endemph@ slashes,
+# e.g. @verb@c:\\\@endverb@ or @verb@///@endverb@.
+#
+### \chktexrcdefault\begin{verbatim}
+TeXInputs
+{
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## OutFormat
+### \begin{chktexrclistvar}{OutFormat}
+#
+# Output formats which can be selected from the command-line. The
+# @verb@-v@endverb@ option simply indexes into this list. By default, entry number
+# @emph@two@endemph@ in this list is chosen (counting from 0), and @verb@-v@endverb@
+# without any parameter selects entry number @emph@three@endemph@.
+#
+# For explanation of the @verb@%@endverb@ format specifiers see the
+# documentation of the @verb@--format@endverb@ command-line argument
+### \begin{comment}
+# in the manual.
+### \end{comment}
+### on page~\pageref{clarg:format}.
+#
+# Recall that to use @verb@!@endverb@ is the escape character, not @verb@\@endverb@.
+#
+### \chktexrcdefault\begin{verbatim}
+OutFormat
+{
+ # -v0; silent mode
+ %f%b%l%b%c%b%n%b%m!n
+ # -v1; normal mode
+ "%k %n in %f line %l: %m!n%r%s%t!n%u!n"
+ # -v2; fancy mode
+ "%k %n in %f line %l: %m!n%r%i%s%I%t!n!n"
+ # -v3; lacheck mode
+ "!"%f!", line %l: %m!n"
+ # -v4; verbose lacheck mode
+ "!"%f!", line %l: %m!n%r%s%t!n%u!n"
+ # -v5; no line number, ease auto-test
+ "%k %n in %f: %m!n%r%s%t!n%u!n"
+ # -v6; emacs compilation mode
+ "!"%f!", line %l.%c:(#%n) %m!n"
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## Silent
+### \begin{chktexrclistvar*}{Silent}
+#
+# Commands which should not trigger a warning if terminated by a space.
+# This warning will not trigger in math mode.
+#
+# You can also specify regular expressions in the @verb@[]@endverb@
+# section in case you have many custom macros that can be safely
+# terminated with a space.
+#
+### \chktexrcdefault\begin{verbatim}
+Silent
+{
+ \rm \em \bf \it \sl \sf \sc \tt \selectfont
+ \rmfamily \sffamily \ttfamily \mdseries \bfseries \itshape
+ \slshape \scshape \relax
+ \vskip \pagebreak \nopagebreak
+
+ \textrm \textem \textbf \textit \textsl \textsf \textsc \texttt
+
+ \clearpage \ddots \dotfill \flushbottom \fussy \indent \linebreak
+ \onecolumn \pagebreak \pushtabs \poptabs \scriptsize \sloppy
+ \twocolumn \vdots
+ \today \kill \newline \thicklines \thinlines
+
+ \columnsep \space \item \tiny \footnotesize \small \normalsize
+ \normal \large \Large \LARGE \huge \Huge \printindex
+
+ \newpage \listoffigures \listoftables \tableofcontents
+ \maketitle \makeindex
+
+ \hline \hrule \vrule
+
+ \centering
+
+ \noindent \expandafter
+
+ \makeatletter \makeatother
+
+ \columnseprule
+
+ \textwidth \textheight \hsize \vsize
+
+ \if \fi \else
+
+ \csname \endcsname
+
+ \z@ \p@ \@warning \typeout
+
+ \dots \ldots \input \endinput \nextline \leavevmode \cdots
+ \appendix \listfiles \and \quad \bigskip \medskip \smallskip
+ \hskip \vfill \vfil \hfill \hfil \topmargin \oddsidemargin
+ \frenchspacing \nonfrenchspacing
+ \begingroup \endgroup \par
+
+ \vrefwarning \upshape \headheight \headsep \hoffset \voffset
+ \cdot \qquad \left \right \qedhere \xspace
+
+ \addlinespace \cr \fill \frontmatter
+ \toprule \midrule \bottomrule
+}[
+ # Here you can put regular expressions to match Silent macros. It
+ # was designed for use with many custom macros sharing a common
+ # prefix, but can of course be used for other things.
+
+ # Support ConTeXt to at least some extent
+ \\start.* \\stop.*
+]
+### \end{verbatim}
+### \end{chktexrclistvar*}
+
+
+## HyphDash
+### \begin{chktexrclistvar}{HyphDash}
+#
+# The number of dashes allowed between two alphabetic characters.
+# Use 0 to always return an error. For example:
+### \begin{errexam}
+# foo-bar @\\@
+# Use of two--dashes is not usually allowed in English. @\\@
+# like this---see?
+### \end{errexam}
+#
+# For English, this will often be a single dash (hyphen). If you like
+# m-dashes with no spaces between them and the surrounding words, then
+# it should include 3 as well. There @emph@are@endemph@ cases when an n-dash
+# is valid between two alphabetic characters. See@ref@DashExcpt@endref@.
+#
+### \chktexrcdefault\begin{verbatim}
+HyphDash { 1 3 }
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## NumDash
+### \begin{chktexrclistvar}{NumDash}
+#
+# The number of dashes allowed between two numeric characters.
+# Use 0 to always return an error. This does @emph@not@endemph@ apply in
+# math mode. For example:
+### \begin{errexam}
+# 123--456 is a range @\\@
+# $12-4$ \% okay because it's in math mode
+### \end{errexam}
+#
+# For English, this should be 2 because an n-dash is used to indicate
+# a range of numbers and subtraction should be in math mode where this
+# does not apply.
+#
+### \chktexrcdefault\begin{verbatim}
+NumDash { 2 }
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## WordDash
+### \begin{chktexrclistvar}{WordDash}
+#
+# The number of dashes allowed between two space characters.
+# Use 0 to always return an error. For example:
+### \begin{errexam}
+# not like - this, @\\@
+# or like -- this. @\\@
+# like this --- see?
+### \end{errexam}
+#
+### \chktexrcdefault\begin{verbatim}
+WordDash { 3 }
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## DashExcpt
+### \begin{chktexrclistvar}{DashExcpt}
+#
+# Exceptions to the dash rules above. For example, an n-dash
+# @verb@--@endverb@ between words is usually wrong, but in some cases it is correct,
+# such as when naming a theorem. The Birch--Swinnerton-Dyer
+# conjecture is one example where the difference matters. You can
+# tell that Birch is one person and Swinnerton-Dyer is another based
+# on the dashes used.
+#
+# Adding line suppressions for these is possible, but can quickly
+# become tedious if a certain theorem is referenced often. For this
+# reason exceptions can be specified here. They are case-sensitive.
+#
+# Unfortunately, there are no warnings if the dashes are surrounded by differing
+# types of characters. For example:
+### \begin{errexam}
+# like this ---see? (space and alphabet) @\\@
+# a--123 (number and alphabet) @\\@
+# a.--b. (other character, namely @verb@.@endverb@)
+### \end{errexam}
+# Similarly, no warnings are issued if the hyphenation is correct,
+# according to the other rules, for example:
+### \begin{errexam}
+# Birch-Swinnerton-Dyer
+### \end{errexam}
+#
+### \chktexrcdefault\begin{verbatim}
+DashExcpt
+{
+ Birch--Swinnerton-Dyer
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## WipeArg
+### \begin{chktexrclistvar}{WipeArg}
+#
+# Commands whose arguments aren't @LaTeX@ code, and thus should be
+# ignored.
+#
+# After the command, you may place arguments (separated from the
+# command with a colon) that should be wiped. Use @verb@[]@endverb@ for optional
+# arguments, @verb@{}@endverb@ for required ones, and @verb@*@endverb@ if the command supports a
+# star variant. Some commands (e.g.\@ @verb@\cmidrule@endverb@) use @verb@()@endverb@ to
+# delimit an optional argument and so this syntax is supported as well.
+#
+# For instance, if you would like to wipe the @verb@\newcommand@endverb@ command,
+# you would declare it as @verb@\newcommand:*[][]{}@endverb@ since it has a
+# star variant, two optional arguments, and one required argument.
+#
+# These commands may be ``evaluated'' before they're wiped, so you will
+# typically list filehandling commands and similar here.
+#
+### \chktexrcdefault\begin{verbatim}
+WipeArg
+{
+ \label:{} \ref:{} \eqref:{} \vref:{} \pageref:{} \index:[]{}
+ \cite:[][]{} \nocite:{}
+ \input:{} \verbatiminput:[]{} \listinginput:[]{}{}
+ \graphicspath:{}
+ \verbatimtabinput:[]{} \include:{} \includeonly:{}
+ \bibitem:[]{}
+ \cline:{} \cmidrule:[](){}
+ \href:{}{}
+ # Cleveref -- there are many others that could be here as well...
+ \cref:*{} \cpageref:*{} \crefrange:*{}{} \cpagerefrange:*{}{}
+ \Cref:*{} \Cpageref:*{} \Crefrange:*{}{} \Cpagerefrange:*{}{}
+ # natbib
+ \citet:*[][]{} \citep:*[][]{} \citealt:*{} \citealp:*[]{} \citeauthor:*{}
+ \Citet:*[][]{} \Citep:*[][]{} \Citealt:*{} \Citealp:*[]{} \Citeauthor:{}
+ \citetext:{} \citeyear:*{} \citeyearpar:{}
+ # biblatex - not including special commands
+ \autocite:*[][]{} \autocites:*[][]{} \Autocite:*[][]{} \Autocites:*[][]{}
+ \parencite:*[][]{} \parencites:*[][]{} \Parencite:*[][]{} \Parencites:*[][]{}
+ \footcite:*{} \footcites:*[][]{} \Footcite:*[][]{} \Footcites:*[][]{}
+ \textcite:*{} \textcites:*[][]{} \Textcite:*[][]{} \Textcites:*[][]{}
+ \citeauthor:*{} \citeauthors:*[][]{} \Citeauthor:*[][]{} \Citeauthors:*[][]{}
+ \citeyear:*{} \citeyears:*[][]{} \Citeyear:*[][]{} \Citeyears:*[][]{}
+ \citetitle:*{} \citetitles:*[][]{} \Citetitle:*[][]{} \Citetitles:*[][]{}
+ # tipa which uses "
+ \textipa:{}
+ # LuaTeX
+ \directlua:{} \luaescapestring:{}
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## MathEnvir
+### \begin{chktexrclistvar}{MathEnvir}
+#
+# Environments which typeset their contents as mathematics.
+# This turns on/off some warnings.
+#
+# A @verb@*@endverb@ variant is automatically added for each keyword.
+#
+### \chktexrcdefault\begin{verbatim}
+MathEnvir
+{
+ displaymath math eqnarray array equation
+ align alignat gather flalign multline
+ dmath dgroup darray
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## TextEnvir
+### \begin{chktexrclistvar}{TextEnvir}
+#
+# Environments which typeset their contents as text, for use inside
+# mathematics. This turns on/off some warnings.
+#
+### \chktexrcdefault\begin{verbatim}
+TextEnvir
+{
+ dsuspend
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## MathCmd
+### \begin{chktexrclistvar}{MathCmd}
+#
+# Commands whose argument will be typeset as mathematics.
+# The commands are assumed to have one mandatory argument which is in
+# math mode. This turns on/off some warnings.
+#
+### \chktexrcdefault\begin{verbatim}
+MathCmd
+{
+ \ensuremath
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## TextCmd
+### \begin{chktexrclistvar}{TextCmd}
+#
+# Commands whose argument will @emph@not@endemph@ be typeset as
+# mathematics even if it would otherwise be in math mode.
+# The commands are assumed to have one mandatory argument which is in
+# text mode. This turns on/off some warnings.
+#
+### \chktexrcdefault\begin{verbatim}
+TextCmd
+{
+ \text \intertext \shortintertext \mbox \condition
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## VerbEnvir
+### \begin{chktexrclistvar}{VerbEnvir}
+#
+# Environments containing non-@LaTeX@ content of some kind, and
+# therefore should not trigger any warnings.
+#
+# A @verb@*@endverb@ variant is automatically added for each keyword.
+#
+### \chktexrcdefault\begin{verbatim}
+VerbEnvir
+{
+ verbatim comment listing verbatimtab rawhtml errexam picture texdraw
+ filecontents pgfpicture tikzpicture minted lstlisting IPA
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## Abbrev
+### \begin{chktexrclistvar*}{Abbrev}
+#
+# Abbreviations not automatically handled by @ChkTeX@.
+#
+# @ChkTeX@ automagically catches most abbreviations; the ones we need to
+# list here, are those which are most likely to be followed by a word
+# with an upper-case letter which is not the beginning of a new
+# sentence.
+#
+# The case-insensitive abbreviations are not fully case-insensitive.
+# Rather, only the first character is case-insensitive, while the
+# remaining characters are case-sensitive.
+#
+# To speed up the searching process somewhat, we require that these
+# end in a @verb@.@endverb@ which should not be a problem in practice.
+#
+# Much of this work (both the abbreviations below, and the regular
+# expressions necessary to catch the remaining automatically) have
+# been provided by Russ Bubley, <russ@scs.leeds.ac.uk>.
+#
+### \chktexrcdefault\begin{verbatim}
+Abbrev
+{
+ # Ordinals
+ 1st. 2nd. 3rd. 4th.
+ # Titles
+ Mr. Mrs. Miss. Ms. Dr. Prof. St.
+ #
+ # Days
+ # Mon. Tue. Wed. Thu. Fri. Sat. Sun.
+ #
+ # Months
+ # Jan. Feb. Mar. Apr. May. Jun. Jul. Aug. Sep. Oct. Nov. Dec.
+ #
+ # Letters
+ # Kt. Jr.
+ #
+ # Corporate
+ # Co. Ltd.
+ #
+ # Addresses
+ # Rd. Dr. St. Ave. Cres. Gdns. Sq. Circ. Terr. Pl. Arc. La. Clo. Ho. Est. Gn.
+ #
+ # Misc.
+ # oe. pbab. ps. rsvp. Tx.
+}
+[
+ # The first letter is case-insensitive in the abbrevs in this
+ # list. Due to the nature of the checking algorithm used for
+ # this, entries consisting of only one character will be
+ # silently ignored.
+ #
+ # Latin
+ # cf. "et al." etc. qed. qv. viz.
+ #
+ # Corporate
+ # inc. plc.
+ #
+ # Misc
+ # fax. pcs. qty. tel. misc.
+]
+### \end{verbatim}
+### \end{chktexrclistvar*}
+
+
+## IJAccent
+### \begin{chktexrclistvar}{IJAccent}
+#
+# Commands which add accents above characters. This means that @verb@\i@endverb@ or @verb@\j@endverb@
+# (@verb@\imath@endverb@ and @verb@\jmath@endverb@ in mathmode) should be used instead of @verb@i@endverb@ and @verb@j@endverb@.
+#
+# Other accent commands such as @verb@\c@endverb@, @verb@\d@endverb@, and @verb@\b@endverb@, put their accent under
+# the character, and thus should be used with normal @verb@i@endverb@s and @verb@j@endverb@s.
+#
+### \chktexrcdefault\begin{verbatim}
+IJAccent
+{
+ \hat \check \breve \acute \grave \tilde \bar \vec \dot \ddot
+ \' \` \^ \" \~ \= \. \u \v \H \t
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## Italic
+### \begin{chktexrclistvar}{Italic}
+#
+# Commands which need italic correction when the group is terminated.
+#
+### \chktexrcdefault\begin{verbatim}
+Italic
+{
+ \it \em \sl \itshape \slshape
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## NonItalic
+### \begin{chktexrclistvar}{NonItalic}
+#
+# Commands which makes the font non-italic.
+#
+### \chktexrcdefault\begin{verbatim}
+NonItalic
+{
+ \bf \rm \sf \tt \sc
+ \upshape
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## ItalCmd
+### \begin{chktexrclistvar}{ItalCmd}
+#
+# Commands which put their argument into italic (and thus possibly
+# needs italic correction in the end).
+#
+# This is currently empty, since @verb@\textit@endverb@, @verb@\textsl@endverb@, and @verb@\emph@endverb@
+# automatically add italic corecction.
+#
+### \chktexrcdefault\begin{verbatim}
+ItalCmd
+{
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## PostLink
+### \begin{chktexrclistvar}{PostLink}
+#
+# Commands in front of which a page break is highly undesirable.
+# Thus there should be no space in front of them.
+#
+### \chktexrcdefault\begin{verbatim}
+PostLink
+{
+ \index \label
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## NotPreSpaced
+### \begin{chktexrclistvar}{NotPreSpaced}
+#
+# Commands that should not have a space in front of them for various
+# reasons. Much the same as@ref@PostLink@endref@, but produces a different warning.
+#
+### \chktexrcdefault\begin{verbatim}
+NotPreSpaced
+{
+ \footnote \footnotemark \/
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## Linker
+### \begin{chktexrclistvar}{Linker}
+#
+# Commands that should be prepended with a @verb@~@endverb@. For example
+### \begin{errexam}
+# @verb@look in table~\ref{foo}@endverb@
+### \end{errexam}
+# to avoid the references being split across lines.
+#
+### \chktexrcdefault\begin{verbatim}
+Linker
+{
+ \ref \vref \pageref \eqref \cite
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## CenterDots
+### \begin{chktexrclistvar}{CenterDots}
+#
+# Commands or characters which should have @verb@\cdots@endverb@ in between.
+# For example, $1+2+3+\cdots+n$.
+#
+### \chktexrcdefault\begin{verbatim}
+CenterDots
+{
+ = + - \cdot \div & \times \geq \leq < >
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## LowDots
+### \begin{chktexrclistvar}{LowDots}
+#
+# Commands or characters which should have @verb@\ldots@endverb@ in between.
+# For example, $1,2,3,\ldots,n$.
+#
+### \chktexrcdefault\begin{verbatim}
+LowDots
+{
+ . , ;
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## MathRoman
+### \begin{chktexrclistvar}{MathRoman}
+#
+# Words that should appear in roman (upright) in math mode. There are
+# certain aliases for mathematical operators (like sin or cos) that
+# appear in roman rather than the usual italic (slanted) font.
+#
+# These entries do not need a leading slash since the mistake is often
+# to @emph@not@endemph@ include the leading slash.
+#
+### \chktexrcdefault\begin{verbatim}
+MathRoman
+{
+ log lg ln lim limsup liminf sin arcsin sinh cos arccos cosh tan
+ arctan tanh cot coth sec csc max min sup inf arg ker dim hom det
+ exp Pr gcd deg bmod pmod mod
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## Primitives
+### \begin{chktexrclistvar}{Primitives}
+#
+# Commands that are used in @TeX@ but have become unnecessary in
+# @LaTeX@, as there are @LaTeX@ commands which do the same. Purists
+# should thus avoid these in their code.
+#
+### \chktexrcdefault\begin{verbatim}
+Primitives
+{
+ \above \advance \catcode \chardef \closein \closeout \copy \count
+ \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
+ \expandafter \font \hskip \vskip \openout
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## NoCharNext
+### \begin{chktexrclistvar}{NoCharNext}
+#
+# Commands and a set of characters that should @emph@not@endemph@ follow them. For
+# example, in math mode, @verb@\left@endverb@ should be followed by a delimiter
+# which is to change size. Therefore, it should not be followed by the
+# end of math mode @verb@$@endverb@ or a grouping character @verb@{@endverb@ or @verb@}@endverb@.
+#
+# The format is @verb@\command:characters@endverb@.
+#
+### \chktexrcdefault\begin{verbatim}
+NoCharNext
+{
+ \left:{}$ \right:{}$
+}
+### \end{verbatim}
+### \end{chktexrclistvar}
+
+
+## VerbClear
+### \begin{chktexrcsimplevar}{VerbClear}
+#
+# The character to replace verbatim text with.
+#
+# The arguments of commands listed in@ref@WipeArg@endref@, as well as
+# @verb@\verb+...+@endverb@ commands, are replaced with an innocuous character
+# to prevent that data from inadvertantly producing a warning.
+#
+# This should not contain an alphabetic character (in case the user
+# writes (@verb@\foo\verb+bar+@endverb@), neither should it contain be one of
+# @LaTeX@'s reserved characters (@verb@#$%&~_^\{}@endverb@), or any parenthesis
+# character (@verb@()[]{}@endverb@). If possible, don't use a punctuation
+# character or any spacing characters either. All of these characters
+# have warnings associated with them and thus could cause spurious
+# warnings to appear.
+#
+# The asterisk is also unsuitable, as some commands behave in another
+# way if they are appended with an asterisk. Which more or less
+# leaves us with the pipe.
+#
+# Please note that this may also be a @verb@string@endverb@, which will be
+# repeated until the proper length is reached.
+#
+### \chktexrcdefault\begin{verbatim}
+VerbClear = "|"
+### \end{verbatim}
+### \end{chktexrcsimplevar}
+
+
+## That's all for now - Happy @LaTeX@ing!
diff --git a/Build/source/texk/chktex/chktex-src/configure.in b/Build/source/texk/chktex/chktex-src/configure.ac
index 0508bcac258..3cb717df7f4 100644
--- a/Build/source/texk/chktex/chktex-src/configure.in
+++ b/Build/source/texk/chktex/chktex-src/configure.ac
@@ -27,7 +27,7 @@ dnl
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(ChkTeX, 1.7.6)
+AC_INIT([ChkTeX],[1.7.8])
AC_SUBST(SCRIPTS)
AC_SUBST(BUILT_SCRIPTS)
AC_SUBST(CLEAN)
@@ -111,6 +111,7 @@ fi
AC_CHECK_PROGS(GROFF, 'groff -man -P-bu -Tlatin1' 'nroff -man', 'nroff -man')
+AC_PATH_PROG(PDFLATEX, pdflatex, no)
AC_PATH_PROG(LATEX, latex, no)
dnl if test "$LATEX" = no; then
dnl AC_MSG_ERROR([No LaTeX on the system, cannot find latex program.])
@@ -125,8 +126,6 @@ dnl Checks for libraries.
AC_CHECK_LIB(termlib, tgetent)
AC_CHECK_LIB(termcap, tgetent)
-dnl Checks for header files.
-AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS(limits.h stat.h strings.h stdarg.h dnl
sys/stat.h termcap.h termlib.h unistd.h)
@@ -188,6 +187,7 @@ else
fi
-AC_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
-AC_OUTPUT(Makefile deweb rmeheader ChkTeX.tex)
+AC_CONFIG_FILES([Makefile deweb rmeheader ChkTeX.tex])
+AC_OUTPUT
diff --git a/Build/source/texk/chktex/chktex-src/input/file b/Build/source/texk/chktex/chktex-src/input/file
new file mode 100644
index 00000000000..3ebbc3d6a89
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/input/file
@@ -0,0 +1,8 @@
+% -*- TeX -*-
+% chktex-file 22
+% This file tests that file suppressions are only valid in the current file.
+
+% It also ensures that git will create the input/
+% directory. That ensures that the \input input in Test.tex is able
+% to distinguish between directories and regular files.
+% This was bug #56520.
diff --git a/Build/source/texk/chktex/chktex-src/m4/ax_cflags_strict_prototypes.m4 b/Build/source/texk/chktex/chktex-src/m4/ax_cflags_strict_prototypes.m4
deleted file mode 100644
index 06ec9e2f27b..00000000000
--- a/Build/source/texk/chktex/chktex-src/m4/ax_cflags_strict_prototypes.m4
+++ /dev/null
@@ -1,170 +0,0 @@
-# ===========================================================================
-# http://autoconf-archive.cryp.to/ax_cflags_strict_prototypes.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CFLAGS_STRICT_PROTOTYPES [(shellvar [,default, [A/NA]]
-#
-# DESCRIPTION
-#
-# Try to find a compiler option that requires strict prototypes.
-#
-# The sanity check is done by looking at sys/signal.h which has a set of
-# macro-definitions SIG_DFL and SIG_IGN that are cast to the local
-# signal-handler type. If that signal-handler type is not fully qualified
-# then the system headers are not seen as strictly prototype clean.
-#
-# For the GNU CC compiler it will be -fstrict-prototypes
-# -Wstrict-prototypes The result is added to the shellvar being CFLAGS by
-# default.
-#
-# DEFAULTS:
-#
-# - $1 shell-variable-to-add-to : CFLAGS
-# - $2 add-value-if-not-found : nothing
-# - $3 action-if-found : add value to shellvariable
-# - $4 action-if-not-found : nothing
-#
-# LAST MODIFICATION
-#
-# 2008-04-12
-#
-# COPYLEFT
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Macro Archive. When you make and
-# distribute a modified version of the Autoconf Macro, you may extend this
-# special exception to the GPL to apply to your modified version as well.
-
-AC_DEFUN([AX_CFLAGS_STRICT_PROTOTYPES],[dnl
-AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
-AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_strict_prototypes])dnl
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
-VAR,[VAR="no, unknown"
- AC_LANG_SAVE
- AC_LANG_C
- ac_save_[]FLAGS="$[]FLAGS"
-for ac_arg dnl
-in "-pedantic % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
- "-pedantic % -Wstrict-prototypes" dnl try to warn atleast
- "-pedantic % -Wmissing-prototypes" dnl or another warning
- "-pedantic % -Werror-implicit-function-declaration" dnl
- "-pedantic % -Wimplicit-function-declaration" dnl
- #
-do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
- AC_TRY_COMPILE([],[return 0;],
- [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
-done
-case ".$VAR" in
- .|.no|.no,*) ;;
- *) # sanity check with signal() from sys/signal.h
- cp config.log config.tmp
- AC_TRY_COMPILE([#include <signal.h>],[
- if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
- if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
- dnl the original did use test -n `$CC testprogram.c`
- [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
-then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
-then VAR="no, suppressed, signal.h," ; fi ; fi],
- [VAR="no, suppressed, signal.h"])
- rm config.tmp
- ;;
-esac
- FLAGS="$ac_save_[]FLAGS"
- AC_LANG_RESTORE
-])
-case ".$VAR" in
- .ok|.ok,*) m4_ifvaln($3,$3) ;;
- .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
- AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
- m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
- *) m4_ifvaln($3,$3,[
- if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
- then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
- else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
- m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
- fi ]) ;;
-esac
-AS_VAR_POPDEF([VAR])dnl
-AS_VAR_POPDEF([FLAGS])dnl
-])
-
-dnl the only difference - the LANG selection... and the default FLAGS
-
-AC_DEFUN([AX_CXXFLAGS_STRICT_PROTOTYPES],[dnl
-AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
-AS_VAR_PUSHDEF([VAR],[ac_cv_cxxflags_strict_prototypes])dnl
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for strict prototypes],
-VAR,[VAR="no, unknown"
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- ac_save_[]FLAGS="$[]FLAGS"
-for ac_arg dnl
-in "-pedantic -Werror % -fstrict-prototypes -Wstrict-prototypes" dnl GCC
- "-pedantic -Werror % -Wstrict-prototypes" dnl try to warn atleast
- "-pedantic -Werror % -Wmissing-prototypes" dnl try to warn atleast
- "-pedantic -Werror % -Werror-implicit-function-declaration" dnl
- "-pedantic -Werror % -Wimplicit-function-declaration" dnl
- "-pedantic % -Wstrict-prototypes %% no, unsupported in C++" dnl oops
- #
-do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
- AC_TRY_COMPILE([],[return 0;],
- [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
-done
-case ".$VAR" in
- .|.no|.no,*) ;;
- *) # sanity check with signal() from sys/signal.h
- cp config.log config.tmp
- AC_TRY_COMPILE([#include <signal.h>],[
- if (signal (SIGINT, SIG_IGN) == SIG_DFL) return 1;
- if (signal (SIGINT, SIG_IGN) != SIG_DFL) return 2;],
- dnl the original did use test -n `$CC testprogram.c`
- [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
-then if test `diff config.log config.tmp | grep -i warning | wc -l` != 1
-then VAR="no, suppressed, signal.h," ; fi ; fi],
- [VAR="no, suppressed, signal.h"])
- rm config.tmp
- ;;
-esac
- FLAGS="$ac_save_[]FLAGS"
- AC_LANG_RESTORE
-])
-case ".$VAR" in
- .ok|.ok,*) m4_ifvaln($3,$3) ;;
- .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
- AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
- m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
- *) m4_ifvaln($3,$3,[
- if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
- then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
- else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
- m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
- fi ]) ;;
-esac
-AS_VAR_POPDEF([VAR])dnl
-AS_VAR_POPDEF([FLAGS])dnl
-])
diff --git a/Build/source/texk/chktex/chktex-src/m4/vl_prog_cc_warnings.m4 b/Build/source/texk/chktex/chktex-src/m4/vl_prog_cc_warnings.m4
deleted file mode 100644
index fe2f6145450..00000000000
--- a/Build/source/texk/chktex/chktex-src/m4/vl_prog_cc_warnings.m4
+++ /dev/null
@@ -1,111 +0,0 @@
-AC_DEFUN([VL_PROG_CC_WARNINGS], [
- ansi=$1
- if test -z "$ansi"; then
- msg="for C compiler warning flags"
- else
- msg="for C compiler warning and ANSI conformance flags"
- fi
- AC_CACHE_CHECK($msg, vl_cv_prog_cc_warnings, [
- if test -n "$CC"; then
- cat > conftest.c <<EOF
-int main(int argc, char **argv) { return 0; }
-EOF
-
- dnl GCC
- if test "$GCC" = "yes"; then
- if test -z "$ansi"; then
- vl_cv_prog_cc_warnings="-Wall"
- else
- vl_cv_prog_cc_warnings="-Wall -ansi -pedantic"
- fi
-
- dnl Most compilers print some kind of a version string with some command
- dnl line options (often "-V"). The version string should be checked
- dnl before doing a test compilation run with compiler-specific flags.
- dnl This is because some compilers (like the Cray compiler) only
- dnl produce a warning message for unknown flags instead of returning
- dnl an error, resulting in a false positive. Also, compilers may do
- dnl erratic things when invoked with flags meant for a different
- dnl compiler.
-
- dnl Solaris C compiler
- elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 &&
- $CC -c -v -Xc conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- if test -z "$ansi"; then
- vl_cv_prog_cc_warnings="-v"
- else
- vl_cv_prog_cc_warnings="-v -Xc"
- fi
-
- dnl Digital Unix C compiler
- elif $CC -V 2>&1 | grep -i "Digital UNIX Compiler" > /dev/null 2>&1 &&
- $CC -c -verbose -w0 -warnprotos -std1 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- if test -z "$ansi"; then
- vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos"
- else
- vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos -std1"
- fi
-
- dnl C for AIX Compiler
- elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 &&
- $CC -c -qlanglvl=ansi -qinfo=all conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- if test -z "$ansi"; then
- vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd"
- else
- vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd -qlanglvl=ansi"
- fi
-
- dnl IRIX C compiler
- elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 &&
- $CC -c -fullwarn -ansi -ansiE conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- if test -z "$ansi"; then
- vl_cv_prog_cc_warnings="-fullwarn"
- else
- vl_cv_prog_cc_warnings="-fullwarn -ansi -ansiE"
- fi
-
- dnl HP-UX C compiler
- elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 &&
- $CC -c -Aa +w1 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- if test -z "$ansi"; then
- vl_cv_prog_cc_warnings="+w1"
- else
- vl_cv_prog_cc_warnings="+w1 -Aa"
- fi
-
- dnl The NEC SX-5 (Super-UX 10) C compiler
- elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 &&
- $CC -c -pvctl[,]fullmsg -Xc conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- if test -z "$ansi"; then
- vl_cv_prog_cc_warnings="-pvctl[,]fullmsg"
- else
- vl_cv_prog_cc_warnings="-pvctl[,]fullmsg -Xc"
- fi
-
- dnl The Cray C compiler (Unicos)
- elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 &&
- $CC -c -h msglevel 2 conftest.c > /dev/null 2>&1 &&
- test -f conftest.o; then
- if test -z "$ansi"; then
- vl_cv_prog_cc_warnings="-h msglevel 2"
- else
- vl_cv_prog_cc_warnings="-h msglevel 2 -h conform"
- fi
-
- fi
- rm -f conftest.*
- fi
- if test -n "$vl_cv_prog_cc_warnings"; then
- CFLAGS="$CFLAGS $vl_cv_prog_cc_warnings"
- else
- vl_cv_prog_cc_warnings="unknown"
- fi
- ])
-])dnl
-
diff --git a/Build/source/texk/chktex/chktex-src/tests/main.expected b/Build/source/texk/chktex/chktex-src/tests/main.expected
new file mode 100644
index 00000000000..5cf8374c47d
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/tests/main.expected
@@ -0,0 +1,27 @@
+Message 22 in main.tex: Comment displayed.
+%% main.tex
+^
+Message 22 in sub1/file.tex: Comment displayed.
+%% comment1
+^
+Message 22 in sub1/subsub/subsubfile.tex: Comment displayed.
+%% subsubcomment
+^
+Message 22 in sub1/file.tex: Comment displayed.
+%% comment2
+^
+Message 22 in sub1/subsub/subsubfile.tex: Comment displayed.
+%% subsubcomment
+^
+Message 22 in sub2/file1.tex: Comment displayed.
+%% comment 2.1
+^
+Message 22 in sub2/file2.tex: Comment displayed.
+%% comment 2.2
+^
+Message 22 in sub2/file1.tex: Comment displayed.
+%% comment 2.1 cont.
+^
+Message 22 in sub2/file2.tex: Comment displayed.
+%% comment 2.2
+^
diff --git a/Build/source/texk/chktex/chktex-src/tests/main.tex b/Build/source/texk/chktex/chktex-src/tests/main.tex
new file mode 100644
index 00000000000..027c5a9e273
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/tests/main.tex
@@ -0,0 +1,14 @@
+\documentclass{article}
+
+%% main.tex
+\begin{document}
+
+\input{sub1/file.tex}
+
+\input{sub1/subsub/subsubfile.tex}
+
+\input{sub2/file1.tex}
+
+\input{sub2/file2.tex}
+
+\end{document}
diff --git a/Build/source/texk/chktex/chktex-src/tests/run-tests.sh b/Build/source/texk/chktex/chktex-src/tests/run-tests.sh
new file mode 100755
index 00000000000..8d0b4aae1b7
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/tests/run-tests.sh
@@ -0,0 +1,137 @@
+#!/bin/dash
+# -- remember to change this to sh
+
+set -e
+
+usage() {
+ echo "$0 BUILDDIR SRCDIR"
+}
+
+if [ "x$1" = x ] || [ "x$2" = x ]; then
+ usage
+ exit 1
+fi
+
+builddir="$(cd $1; pwd)"
+srcdir="$(cd $2; pwd)"
+
+testsdir="$srcdir/tests"
+output="$testsdir/main.out"
+expected="$testsdir/main.expected"
+
+check_results() {
+ sed -i -e 's~Message 22 in .*tests/~Message 22 in ~;' "$output"
+ if cmp -s "$expected" "$output"; then
+ echo ">>> OK!"
+ rm -f "$output"
+ return 0
+ else
+ echo "***WARNING***";
+ echo "Unexpected test output";
+ diff -u "$expected" "$output";
+ return 1
+ fi
+}
+
+
+# We don't check in the test files because CTAN can't handle files
+# with the same names, and we need several that are named chktexrc.
+# Also, they don't like invisible files (start with '.') so we
+# generate those as well.
+echo ">>> Generating test files..."
+mkdir -p $testsdir/sub
+cat > $testsdir/sub/chktexrc <<EOF
+OutFormat
+{
+"loaded chktex/tests/sub %f!n"
+}
+EOF
+
+mkdir -p $testsdir/sub1/.config
+cat > $testsdir/sub1/.config/chktexrc <<EOF
+OutFormat
+{
+"loaded chktex/tests/sub1/.config/chktexrc %f!n"
+}
+EOF
+
+cat > $testsdir/sub2/.chktexrc <<EOF
+OutFormat
+{
+"loaded chktex/tests/sub2/.chktexrc %f!n"
+}
+EOF
+
+# Run the actual tests for inclusion
+echo ">>> Testing that inclusion works correctly..."
+# absolute path
+rm -f "$output"
+${builddir}/chktex -mall -r -g0 -l$srcdir/chktexrc -v5 -q \
+ $testsdir/main.tex 2>/dev/null \
+ 1> $testsdir/main.out
+check_results
+
+# relative path
+cd "$srcdir"
+${builddir}/chktex -mall -r -g0 -l$srcdir/chktexrc -v5 -q \
+ tests/main.tex 2>/dev/null \
+ 1> tests/main.out
+check_results
+
+# file in the same directory
+cd "$testsdir"
+${builddir}/chktex -mall -r -g0 -l$srcdir/chktexrc -v5 -q \
+ main.tex 2>/dev/null \
+ 1> main.out
+check_results
+
+echo ">>> Testing that correct chktexrc files are loaded"
+# XDG variables
+unset HOME
+echo '%' \
+ | XDG_CONFIG_HOME=${testsdir}/sub \
+ ${builddir}/chktex -mall -v0 -q \
+ | grep 'loaded chktex/tests/sub stdin' \
+ || (echo XDG_CONFIG_HOME/chktexrc inclusion failed; exit 1)
+echo '%' \
+ | HOME=${testsdir}/sub1 \
+ ${builddir}/chktex -mall -v0 -q \
+ | grep 'loaded chktex/tests/sub1/.config/chktexrc stdin' \
+ || (echo HOME/.config/chktexrc inclusion failed; exit 1)
+
+# HOME, LOGDIR
+echo '%' \
+ | HOME=${testsdir}/sub2 \
+ ${builddir}/chktex -mall -v0 -q \
+ | grep 'loaded chktex/tests/sub2/.chktexrc stdin' \
+ || (echo HOME/.chktexrc inclusion failed; exit 1)
+echo '%' \
+ | LOGDIR=${testsdir}/sub2 \
+ ${builddir}/chktex -mall -v0 -q \
+ | grep 'loaded chktex/tests/sub2/.chktexrc stdin' \
+ || (echo LOGDIR/.chktexrc inclusion failed; exit 1)
+
+# CHKTEXRC
+echo '%' \
+ | CHKTEXRC=${testsdir}/sub2 \
+ ${builddir}/chktex -mall -v0 -q \
+ | grep 'loaded chktex/tests/sub2/.chktexrc stdin' \
+ || (echo CHKTEXRC/.chktexrc inclusion failed; exit 1)
+
+# CWD
+echo '%' \
+ | (cd ${testsdir}/sub2; \
+ ${builddir}/chktex -mall -v0 -q) \
+ | grep 'loaded chktex/tests/sub2/.chktexrc stdin' \
+ || (echo PWD/.chktexrc inclusion failed; exit 1)
+
+# Not sure how to test KPSE variables...
+# TEXMFMAIN CHKTEX_CONFIG
+echo ">>> OK!"
+
+# Command line options
+echo "Checking command line RC settings..."
+(${builddir}/chktex -d 4 -STabSize=7 </dev/null 2>&1 \
+ | grep -A1 TabSize | grep -E '\t7$' >/dev/null) \
+ || (echo Setting TabSize from command line failed; exit 1)
+echo ">>> OK!"
diff --git a/Build/source/texk/chktex/chktex-src/tests/sub1/file.tex b/Build/source/texk/chktex/chktex-src/tests/sub1/file.tex
new file mode 100644
index 00000000000..00870dd8419
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/tests/sub1/file.tex
@@ -0,0 +1,8 @@
+file1
+%% comment1
+
+\input{sub1/subsub/subsubfile}
+
+%% comment2
+
+more file1
diff --git a/Build/source/texk/chktex/chktex-src/tests/sub1/subsub/subsubfile.tex b/Build/source/texk/chktex/chktex-src/tests/sub1/subsub/subsubfile.tex
new file mode 100644
index 00000000000..fc99c7a58d6
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/tests/sub1/subsub/subsubfile.tex
@@ -0,0 +1,2 @@
+%% subsubcomment
+subsubfile
diff --git a/Build/source/texk/chktex/chktex-src/tests/sub2/file1.tex b/Build/source/texk/chktex/chktex-src/tests/sub2/file1.tex
new file mode 100644
index 00000000000..3504c7c37d4
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/tests/sub2/file1.tex
@@ -0,0 +1,7 @@
+subfile 2.1
+
+%% comment 2.1
+\input{sub2/file2.tex}
+
+%% comment 2.1 cont.
+more subfile 2.1
diff --git a/Build/source/texk/chktex/chktex-src/tests/sub2/file2.tex b/Build/source/texk/chktex/chktex-src/tests/sub2/file2.tex
new file mode 100644
index 00000000000..c270ff6372d
--- /dev/null
+++ b/Build/source/texk/chktex/chktex-src/tests/sub2/file2.tex
@@ -0,0 +1,2 @@
+%% comment 2.2
+subfile 2.2
diff --git a/Build/source/texk/chktex/chktex.test b/Build/source/texk/chktex/chktex.test
index a9357dc7951..7f4f8d06c78 100755
--- a/Build/source/texk/chktex/chktex.test
+++ b/Build/source/texk/chktex/chktex.test
@@ -1,6 +1,6 @@
#! /bin/sh -vx
# $Id$
-# Copyright 2017 Karl Berry <tex-live@tug.org>
+# Copyright 2017-2022 Karl Berry <tex-live@tug.org>
# Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
@@ -9,7 +9,7 @@ rm -f chktest
(bld=`pwd`
cd $srcdir/$CHKTEX_TREE || exit 1
CHKTEX_CONFIG=chktexrc \
- $bld/chktex -mall -r -g0 -lchktexrc -v5 Test.tex || exit 1
+ $bld/chktex -mall -r -g0 -l../chktexrc -v5 Test.tex || exit 1
) >chktest || exit 1
diff $srcdir/$CHKTEX_TREE/Test.posix-ere.out chktest || exit 1
diff --git a/Build/source/texk/chktex/chktexrc b/Build/source/texk/chktex/chktexrc
new file mode 100644
index 00000000000..d829ffacb73
--- /dev/null
+++ b/Build/source/texk/chktex/chktexrc
@@ -0,0 +1,794 @@
+## Example resource file for ChkTeX.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+##
+## For more information visit https://www.nongnu.org/chktex/
+##
+
+## chktexrc file format
+#
+# The chktecrc file is essentially a bunch of variable assignments.
+# There are two types of variables, those that take single items and
+# those that take lists.
+#
+# In turn, there are two types of lists, case-sensitive and case-insentive.
+# Case-sensitive lists are delimited by `{' and `}'
+# while case-insensitive are delimited by `[' and `]'.
+# Only some variables support case insensitive lists, since in many
+# cases it doesn't make sense and would be unnecessarily slow. Those
+# variables that *do* support case-insensitive lists will be marked as
+# such throughout the file.
+#
+# Variables can be set with or without an equals sign. If included, the
+# `=' causes the variable to be overwritten. This is the only thing
+# that makes sense for varibles taking a single item and so we always
+# include it in that case. For list variables, omitting the equals
+# sign will cause the items in the list to be appended instead of
+# overwriting the entire list.
+#
+# Below are all the ways in which a variable can be set. Note that lists
+# can span lines, though this is not shown here for brevity.
+#
+#
+# VariableName = item
+# # Overwrites
+# VariableName = { Item1 Item2 ... }
+# VariableName = [ item1 item2 ... ]
+# VariableName = { Item1 Item2 ... } [ item item ... ]
+# VariableName = [ item1 item2 ... ] { Item Item ... }
+# # Appends
+# VariableName { Item3 Item4 ... }
+# VariableName [ item3 item4 ... ]
+# VariableName { Item3 Item4 ... } [ item item ... ]
+# VariableName [ item3 item4 ... ] { Item Item ... }
+#
+#
+# Comments begin with `#', and continue for the end of the line.
+# Blank lines plus leading and trailing spaces are ignored.
+# Items are separated by spaces.
+# Newlines are considered spaces, but can't be escaped.
+# You can use double quotes `"' to surround an item with spaces, or you can
+# escape spaces as described later.
+#
+# Detection of tokens like `}' are somewhat context sensitve---they
+# have to be preceded by a space (or newline). This allows them to be
+# part of an item without escaping. Since some variables require such
+# characters, this generally makes life easier.
+#
+# To include characters that might otherwise interfere, escape
+# sequences are provided. They are similar to those in C, but use
+# `!' instead of `\' for obvious reasons.
+# The entire list is below.
+#
+# Sequence Resulting character
+# `! ' Space
+# `!"' `"'
+# `!#' `#'
+# `!!' `!'
+# `!{' `{'
+# `!}' `}'
+# `![' `['
+# `!]' `]'
+# `!=' `='
+# `!b' Backspace
+# `!n' New line
+# `!r' Carriage return
+# `!t' Tab
+# `!f' Form feed
+# `!xNN' NN must be a hexadecimal number (00 - ff),
+# both characters must be included.
+# `!dNNN' NNN must be a decimal number (000 - 255), all
+# three characters must be included.
+# Unspecified results if NNN > 377.
+# `!NNN' NNN must be a octal number (000 - 377), all
+# three characters must be included.
+# Unspecified results if NNN > 377.
+
+## Available Settings
+#
+# All avaiable settings follow.
+#
+
+## QuoteStyle
+#
+# The type of quote-style you are using. There are currently two
+# styles:
+#
+# Traditional:
+# "An example," he said, "would be great."
+#
+# Logical:
+# "An example", he said, "would be great".
+#
+QuoteStyle = Logical
+
+
+## TabSize
+#
+# The width of a tab. This is used for formatting the error message.
+# Only positive integers are allowed.
+#
+TabSize = 8
+
+
+## CmdSpaceStyle
+#
+# How to treat a command is followed by punction. In all cases the
+# warnings are also governed by the main warning settings, namely
+# warnings 12 and 13 about interword and intersentence spacings.
+#
+# If set to Ignore, then it won't print any warnings when pucntuation
+# follows a command.
+#
+#
+# If CmdSpaceStyle is set to InterWord, then it will print warnings
+# when interword spacing should (potentially) be used. For example,
+# without a command the following will trigger warning 12
+#
+# `I've seen a UFOs, etc. in my life.'
+#
+# And if set to InterWord, so will
+#
+# `I've seen a UFOs, \etc. in my life.'
+#
+#
+# If set to InterSentence, then it will print warnings when
+# intersentence spacing should (potentially) be used. For example,
+# without a command the following will trigger warning 13
+#
+# `I've seen an UFO! Right over there!'
+#
+# And if set to InterSentence, so will
+#
+# `I've seen an \UFO! Right over there!'
+#
+#
+# Setting CmdSpaceStyle to Both will cause warnings to be printed in
+# both cases.
+#
+CmdSpaceStyle = Ignore
+
+
+## CmdLine
+#
+# Default command-line options. For instance, you might like to put
+# `-v2' here.
+#
+CmdLine
+{
+}
+
+
+## UserWarn
+#
+# Arbitrary strings to warn about. You can put here to help you find
+# your own little foibles. See also UserWarnRegex.
+#
+# These patterns will be searched for throughout the text; regardless
+# of whether they appear as normal text, commands, in math mode, etc.
+# They are *not* found in comments.
+#
+# Suppose you define a special command like this:
+# \def\unknown{\large\bf??}
+# which you use whenever you don't have some information at the time
+# of writing. Thus, it makes sense to warn on it, and this is a
+# convenient way to do so.
+#
+UserWarn
+{
+ \unknown
+ # One should write \chktex or Chk\TeX - never ChkTeX.
+ ChkTeX
+}
+[ # You may put case-insensitive patterns here.
+]
+
+
+## UserWarnRegex
+#
+# A more sophisticated version of UserWarn using regular
+# expressions. Use of these will be automatically disabled if ChkTeX
+# was built without regular expression support. Because ChkTeX can be
+# with support for either POSIX or PCRE flavors of regular expression,
+# some of the following will not apply in all cases. An expression
+# can be defined only when PCRE is enabled by prepending the
+# expression with `PCRE:' and similarly with `POSIX:'.
+#
+# These patterns will be searched for, no matter whether they appear
+# as normal text, commands, or arguments. However, they will *not*
+# match in verbatim environments (see VerbEnvir).
+#
+# Remember that you have to escape (with a `!') the characters
+# `"#!=', as well as spaces and `{}[]' if they are
+# proceeded by a space.
+#
+# When using PCRE regular expressions, you can use `(?i)' to make
+# the expression case insensitive. See the man pages (man pcresyntax)
+# or the nicely formatted http://perldoc.perl.org/perlre.html for
+# documentation on the regular expression syntax. Note, however, that
+# some the features of perl regular expression are not available such
+# as running code (callouts), and replacing.
+#
+# An initial PCRE-style comment `(?# ... )' can be used
+# to change what is displayed, thereby reminding yourself how to fix
+# the problem. This works even for POSIX expressions.
+#
+UserWarnRegex
+{
+ (?!#Always! use! \nmid)\\not! *(\||\\mid)
+
+ # Capitalize section when saying Section 6.
+ (?!#-1:Capitalize! before! references)PCRE:\b(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref
+ (?!#1:Capitalize! before! references)POSIX:([^[:alnum:]]|^)(chapter|(sub)?section|theorem|lemma|proposition|corollary|appendix)~\\ref
+
+ # Spell it introduction
+ # PCRE:(?i)\bintro\b(?!#Spell! it! out.! This! comment! is! not! used.)
+ # POSIX:([^[:alnum:]]|^)intro([^[:alnum:]]|$)
+
+ # Pretty tables--see http://texdoc.net/texmf-dist/doc/latex/booktabs/booktabs.pdf
+ (?!#-2:Use! \toprule,! midrule,! or! \bottomrule! from! booktabs)\\hline
+ # This relies on it being on a single line, and not having anything
+ # else on that line. With PCRE we could match balanced [] and {},
+ # but I wonder if it's worth the complexity...
+ (?!#-2:Vertical! rules! in! tables! are! ugly)\\begin\{(array|tabularx?\*?)\}(\[.*\])?\{.*\|.*\}
+
+ (?!#-3:Optional! arguments! []! inside! optional! arguments! []! must! be! enclosed! in! {})\[(?!![^\]\[{}]*{(?!![^\]\[{}]*}))[^\]]*\[
+
+}
+
+
+## TeXInputs
+#
+# A list of paths where ChkTeX should look for files it `\input's.
+# By default, the current directory is searched (not recursively, use
+# `//' for that, see below).
+#
+# A `//' postfix is supported:
+# if you append a double path-separator we'll recursively search that
+# directory's directories. MS-DOS users must append `\\'
+# instead, e.g. `C:\EMTEX\\'. In order to search an
+# entire directory tree, you must use *three* slashes,
+# e.g. `c:\\\' or `///'.
+#
+TeXInputs
+{
+}
+
+
+## OutFormat
+#
+# Output formats which can be selected from the command-line. The
+# `-v' option simply indexes into this list. By default, entry number
+# *two* in this list is chosen (counting from 0), and `-v'
+# without any parameter selects entry number *three*.
+#
+# For explanation of the `%' format specifiers see the
+# documentation of the `--format' command-line argument
+# in the manual.
+#
+# Recall that to use `!' is the escape character, not `\'.
+#
+OutFormat
+{
+ # -v0; silent mode
+ %f%b%l%b%c%b%n%b%m!n
+ # -v1; normal mode
+ "%k %n in %f line %l: %m!n%r%s%t!n%u!n"
+ # -v2; fancy mode
+ "%k %n in %f line %l: %m!n%r%i%s%I%t!n!n"
+ # -v3; lacheck mode
+ "!"%f!", line %l: %m!n"
+ # -v4; verbose lacheck mode
+ "!"%f!", line %l: %m!n%r%s%t!n%u!n"
+ # -v5; no line number, ease auto-test
+ "%k %n in %f: %m!n%r%s%t!n%u!n"
+ # -v6; emacs compilation mode
+ "!"%f!", line %l.%c:(#%n) %m!n"
+}
+
+
+## Silent
+#
+# Commands which should not trigger a warning if terminated by a space.
+# This warning will not trigger in math mode.
+#
+# You can also specify regular expressions in the `[]'
+# section in case you have many custom macros that can be safely
+# terminated with a space.
+#
+Silent
+{
+ \rm \em \bf \it \sl \sf \sc \tt \selectfont
+ \rmfamily \sffamily \ttfamily \mdseries \bfseries \itshape
+ \slshape \scshape \relax
+ \vskip \pagebreak \nopagebreak
+
+ \textrm \textem \textbf \textit \textsl \textsf \textsc \texttt
+
+ \clearpage \ddots \dotfill \flushbottom \fussy \indent \linebreak
+ \onecolumn \pagebreak \pushtabs \poptabs \scriptsize \sloppy
+ \twocolumn \vdots
+ \today \kill \newline \thicklines \thinlines
+
+ \columnsep \space \item \tiny \footnotesize \small \normalsize
+ \normal \large \Large \LARGE \huge \Huge \printindex
+
+ \newpage \listoffigures \listoftables \tableofcontents
+ \maketitle \makeindex
+
+ \hline \hrule \vrule
+
+ \centering
+
+ \noindent \expandafter
+
+ \makeatletter \makeatother
+
+ \columnseprule
+
+ \textwidth \textheight \hsize \vsize
+
+ \if \fi \else
+
+ \csname \endcsname
+
+ \z@ \p@ warning \typeout
+
+ \dots \ldots \input \endinput \nextline \leavevmode \cdots
+ \appendix \listfiles \and \quad \bigskip \medskip \smallskip
+ \hskip \vfill \vfil \hfill \hfil \topmargin \oddsidemargin
+ \frenchspacing \nonfrenchspacing
+ \begingroup \endgroup \par
+
+ \vrefwarning \upshape \headheight \headsep \hoffset \voffset
+ \cdot \qquad \left \right \qedhere \xspace
+
+ \addlinespace \cr \fill \frontmatter
+ \toprule \midrule \bottomrule
+}[
+ # Here you can put regular expressions to match Silent macros. It
+ # was designed for use with many custom macros sharing a common
+ # prefix, but can of course be used for other things.
+
+ # Support ConTeXt to at least some extent
+ \\start.* \\stop.*
+]
+
+
+## HyphDash
+#
+# The number of dashes allowed between two alphabetic characters.
+# Use 0 to always return an error. For example:
+# foo-bar
+# Use of two--dashes is not usually allowed in English.
+# like this---see?
+#
+# For English, this will often be a single dash (hyphen). If you like
+# m-dashes with no spaces between them and the surrounding words, then
+# it should include 3 as well. There *are* cases when an n-dash
+# is valid between two alphabetic characters. See DashExcpt.
+#
+HyphDash { 1 3 }
+
+
+## NumDash
+#
+# The number of dashes allowed between two numeric characters.
+# Use 0 to always return an error. This does *not* apply in
+# math mode. For example:
+# 123--456 is a range
+# $12-4$ \% okay because it's in math mode
+#
+# For English, this should be 2 because an n-dash is used to indicate
+# a range of numbers and subtraction should be in math mode where this
+# does not apply.
+#
+NumDash { 2 }
+
+
+## WordDash
+#
+# The number of dashes allowed between two space characters.
+# Use 0 to always return an error. For example:
+# not like - this,
+# or like -- this.
+# like this --- see?
+#
+WordDash { 3 }
+
+
+## DashExcpt
+#
+# Exceptions to the dash rules above. For example, an n-dash
+# `--' between words is usually wrong, but in some cases it is correct,
+# such as when naming a theorem. The Birch--Swinnerton-Dyer
+# conjecture is one example where the difference matters. You can
+# tell that Birch is one person and Swinnerton-Dyer is another based
+# on the dashes used.
+#
+# Adding line suppressions for these is possible, but can quickly
+# become tedious if a certain theorem is referenced often. For this
+# reason exceptions can be specified here. They are case-sensitive.
+#
+# Unfortunately, there are no warnings if the dashes are surrounded by differing
+# types of characters. For example:
+# like this ---see? (space and alphabet)
+# a--123 (number and alphabet)
+# a.--b. (other character, namely `.')
+# Similarly, no warnings are issued if the hyphenation is correct,
+# according to the other rules, for example:
+# Birch-Swinnerton-Dyer
+#
+DashExcpt
+{
+ Birch--Swinnerton-Dyer
+}
+
+
+## WipeArg
+#
+# Commands whose arguments aren't LaTeX code, and thus should be
+# ignored.
+#
+# After the command, you may place arguments (separated from the
+# command with a colon) that should be wiped. Use `[]' for optional
+# arguments, `{}' for required ones, and `*' if the command supports a
+# star variant. Some commands (e.g. `\cmidrule') use `()' to
+# delimit an optional argument and so this syntax is supported as well.
+#
+# For instance, if you would like to wipe the `\newcommand' command,
+# you would declare it as `\newcommand:*[][]{}' since it has a
+# star variant, two optional arguments, and one required argument.
+#
+# These commands may be ``evaluated'' before they're wiped, so you will
+# typically list filehandling commands and similar here.
+#
+WipeArg
+{
+ \label:{} \ref:{} \eqref:{} \vref:{} \pageref:{} \index:[]{}
+ \cite:[][]{} \nocite:{}
+ \input:{} \verbatiminput:[]{} \listinginput:[]{}{}
+ \graphicspath:{}
+ \verbatimtabinput:[]{} \include:{} \includeonly:{}
+ \bibitem:[]{}
+ \cline:{} \cmidrule:[](){}
+ \href:{}{}
+ # Cleveref -- there are many others that could be here as well...
+ \cref:*{} \cpageref:*{} \crefrange:*{}{} \cpagerefrange:*{}{}
+ \Cref:*{} \Cpageref:*{} \Crefrange:*{}{} \Cpagerefrange:*{}{}
+ # natbib
+ \citet:*[][]{} \citep:*[][]{} \citealt:*{} \citealp:*[]{} \citeauthor:*{}
+ \Citet:*[][]{} \Citep:*[][]{} \Citealt:*{} \Citealp:*[]{} \Citeauthor:{}
+ \citetext:{} \citeyear:*{} \citeyearpar:{}
+ # biblatex - not including special commands
+ \autocite:*[][]{} \autocites:*[][]{} \Autocite:*[][]{} \Autocites:*[][]{}
+ \parencite:*[][]{} \parencites:*[][]{} \Parencite:*[][]{} \Parencites:*[][]{}
+ \footcite:*{} \footcites:*[][]{} \Footcite:*[][]{} \Footcites:*[][]{}
+ \textcite:*{} \textcites:*[][]{} \Textcite:*[][]{} \Textcites:*[][]{}
+ \citeauthor:*{} \citeauthors:*[][]{} \Citeauthor:*[][]{} \Citeauthors:*[][]{}
+ \citeyear:*{} \citeyears:*[][]{} \Citeyear:*[][]{} \Citeyears:*[][]{}
+ \citetitle:*{} \citetitles:*[][]{} \Citetitle:*[][]{} \Citetitles:*[][]{}
+ # tipa which uses "
+ \textipa:{}
+ # LuaTeX
+ \directlua:{} \luaescapestring:{}
+}
+
+
+## MathEnvir
+#
+# Environments which typeset their contents as mathematics.
+# This turns on/off some warnings.
+#
+# A `*' variant is automatically added for each keyword.
+#
+MathEnvir
+{
+ displaymath math eqnarray array equation
+ align alignat gather flalign multline
+ dmath dgroup darray
+}
+
+
+## TextEnvir
+#
+# Environments which typeset their contents as text, for use inside
+# mathematics. This turns on/off some warnings.
+#
+TextEnvir
+{
+ dsuspend
+}
+
+
+## MathCmd
+#
+# Commands whose argument will be typeset as mathematics.
+# The commands are assumed to have one mandatory argument which is in
+# math mode. This turns on/off some warnings.
+#
+MathCmd
+{
+ \ensuremath
+}
+
+
+## TextCmd
+#
+# Commands whose argument will *not* be typeset as
+# mathematics even if it would otherwise be in math mode.
+# The commands are assumed to have one mandatory argument which is in
+# text mode. This turns on/off some warnings.
+#
+TextCmd
+{
+ \text \intertext \shortintertext \mbox \condition
+}
+
+
+## VerbEnvir
+#
+# Environments containing non-LaTeX content of some kind, and
+# therefore should not trigger any warnings.
+#
+# A `*' variant is automatically added for each keyword.
+#
+VerbEnvir
+{
+ verbatim comment listing verbatimtab rawhtml errexam picture texdraw
+ filecontents pgfpicture tikzpicture minted lstlisting IPA
+}
+
+
+## Abbrev
+#
+# Abbreviations not automatically handled by ChkTeX.
+#
+# ChkTeX automagically catches most abbreviations; the ones we need to
+# list here, are those which are most likely to be followed by a word
+# with an upper-case letter which is not the beginning of a new
+# sentence.
+#
+# The case-insensitive abbreviations are not fully case-insensitive.
+# Rather, only the first character is case-insensitive, while the
+# remaining characters are case-sensitive.
+#
+# To speed up the searching process somewhat, we require that these
+# end in a `.' which should not be a problem in practice.
+#
+# Much of this work (both the abbreviations below, and the regular
+# expressions necessary to catch the remaining automatically) have
+# been provided by Russ Bubley, <russ@scs.leeds.ac.uk>.
+#
+Abbrev
+{
+ # Ordinals
+ 1st. 2nd. 3rd. 4th.
+ # Titles
+ Mr. Mrs. Miss. Ms. Dr. Prof. St.
+ #
+ # Days
+ # Mon. Tue. Wed. Thu. Fri. Sat. Sun.
+ #
+ # Months
+ # Jan. Feb. Mar. Apr. May. Jun. Jul. Aug. Sep. Oct. Nov. Dec.
+ #
+ # Letters
+ # Kt. Jr.
+ #
+ # Corporate
+ # Co. Ltd.
+ #
+ # Addresses
+ # Rd. Dr. St. Ave. Cres. Gdns. Sq. Circ. Terr. Pl. Arc. La. Clo. Ho. Est. Gn.
+ #
+ # Misc.
+ # oe. pbab. ps. rsvp. Tx.
+}
+[
+ # The first letter is case-insensitive in the abbrevs in this
+ # list. Due to the nature of the checking algorithm used for
+ # this, entries consisting of only one character will be
+ # silently ignored.
+ #
+ # Latin
+ # cf. "et al." etc. qed. qv. viz.
+ #
+ # Corporate
+ # inc. plc.
+ #
+ # Misc
+ # fax. pcs. qty. tel. misc.
+]
+
+
+## IJAccent
+#
+# Commands which add accents above characters. This means that `\i' or `\j'
+# (`\imath' and `\jmath' in mathmode) should be used instead of `i' and `j'.
+#
+# Other accent commands such as `\c', `\d', and `\b', put their accent under
+# the character, and thus should be used with normal `i's and `j's.
+#
+IJAccent
+{
+ \hat \check \breve \acute \grave \tilde \bar \vec \dot \ddot
+ \' \` \^ \" \~ \= \. \u \v \H \t
+}
+
+
+## Italic
+#
+# Commands which need italic correction when the group is terminated.
+#
+Italic
+{
+ \it \em \sl \itshape \slshape
+}
+
+
+## NonItalic
+#
+# Commands which makes the font non-italic.
+#
+NonItalic
+{
+ \bf \rm \sf \tt \sc
+ \upshape
+}
+
+
+## ItalCmd
+#
+# Commands which put their argument into italic (and thus possibly
+# needs italic correction in the end).
+#
+# This is currently empty, since `\textit', `\textsl', and `\emph'
+# automatically add italic corecction.
+#
+ItalCmd
+{
+}
+
+
+## PostLink
+#
+# Commands in front of which a page break is highly undesirable.
+# Thus there should be no space in front of them.
+#
+PostLink
+{
+ \index \label
+}
+
+
+## NotPreSpaced
+#
+# Commands that should not have a space in front of them for various
+# reasons. Much the same as PostLink, but produces a different warning.
+#
+NotPreSpaced
+{
+ \footnote \footnotemark \/
+}
+
+
+## Linker
+#
+# Commands that should be prepended with a `~'. For example
+# `look in table~\ref{foo}'
+# to avoid the references being split across lines.
+#
+Linker
+{
+ \ref \vref \pageref \eqref \cite
+}
+
+
+## CenterDots
+#
+# Commands or characters which should have `\cdots' in between.
+# For example, $1+2+3+\cdots+n$.
+#
+CenterDots
+{
+ = + - \cdot \div & \times \geq \leq < >
+}
+
+
+## LowDots
+#
+# Commands or characters which should have `\ldots' in between.
+# For example, $1,2,3,\ldots,n$.
+#
+LowDots
+{
+ . , ;
+}
+
+
+## MathRoman
+#
+# Words that should appear in roman (upright) in math mode. There are
+# certain aliases for mathematical operators (like sin or cos) that
+# appear in roman rather than the usual italic (slanted) font.
+#
+# These entries do not need a leading slash since the mistake is often
+# to *not* include the leading slash.
+#
+MathRoman
+{
+ log lg ln lim limsup liminf sin arcsin sinh cos arccos cosh tan
+ arctan tanh cot coth sec csc max min sup inf arg ker dim hom det
+ exp Pr gcd deg bmod pmod mod
+}
+
+
+## Primitives
+#
+# Commands that are used in TeX but have become unnecessary in
+# LaTeX, as there are LaTeX commands which do the same. Purists
+# should thus avoid these in their code.
+#
+Primitives
+{
+ \above \advance \catcode \chardef \closein \closeout \copy \count
+ \countdef \cr \crcr \csname \delcode \dimendef \dimen \divide
+ \expandafter \font \hskip \vskip \openout
+}
+
+
+## NoCharNext
+#
+# Commands and a set of characters that should *not* follow them. For
+# example, in math mode, `\left' should be followed by a delimiter
+# which is to change size. Therefore, it should not be followed by the
+# end of math mode `$' or a grouping character `{' or `}'.
+#
+# The format is `\command:characters'.
+#
+NoCharNext
+{
+ \left:{}$ \right:{}$
+}
+
+
+## VerbClear
+#
+# The character to replace verbatim text with.
+#
+# The arguments of commands listed in WipeArg, as well as
+# `\verb+...+' commands, are replaced with an innocuous character
+# to prevent that data from inadvertantly producing a warning.
+#
+# This should not contain an alphabetic character (in case the user
+# writes (`\foo\verb+bar+'), neither should it contain be one of
+# LaTeX's reserved characters (`#$%&~_^\{}'), or any parenthesis
+# character (`()[]{}'). If possible, don't use a punctuation
+# character or any spacing characters either. All of these characters
+# have warnings associated with them and thus could cause spurious
+# warnings to appear.
+#
+# The asterisk is also unsuitable, as some commands behave in another
+# way if they are appended with an asterisk. Which more or less
+# leaves us with the pipe.
+#
+# Please note that this may also be a `string', which will be
+# repeated until the proper length is reached.
+#
+VerbClear = "|"
+
+
+## That's all for now - Happy LaTeXing!
diff --git a/Build/source/texk/chktex/configure b/Build/source/texk/chktex/configure
index 951c78047f1..725c526b33c 100755
--- a/Build/source/texk/chktex/configure
+++ b/Build/source/texk/chktex/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for ChkTeX (TeX Live) 1.7.6.
+# Generated by GNU Autoconf 2.71 for ChkTeX (TeX Live) 1.7.8.
#
# Report bugs to <tex-k@tug.org>.
#
@@ -629,8 +629,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ChkTeX (TeX Live)'
PACKAGE_TARNAME='chktex--tex-live-'
-PACKAGE_VERSION='1.7.6'
-PACKAGE_STRING='ChkTeX (TeX Live) 1.7.6'
+PACKAGE_VERSION='1.7.8'
+PACKAGE_STRING='ChkTeX (TeX Live) 1.7.8'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
@@ -1386,7 +1386,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ChkTeX (TeX Live) 1.7.6 to adapt to many kinds of systems.
+\`configure' configures ChkTeX (TeX Live) 1.7.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1458,7 +1458,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ChkTeX (TeX Live) 1.7.6:";;
+ short | recursive ) echo "Configuration of ChkTeX (TeX Live) 1.7.8:";;
esac
cat <<\_ACEOF
@@ -1578,7 +1578,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ChkTeX (TeX Live) configure 1.7.6
+ChkTeX (TeX Live) configure 1.7.8
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2102,7 +2102,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ChkTeX (TeX Live) $as_me 1.7.6, which was
+It was created by ChkTeX (TeX Live) $as_me 1.7.8, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -8425,7 +8425,7 @@ fi
# Define the identity of the package.
PACKAGE='chktex--tex-live-'
- VERSION='1.7.6'
+ VERSION='1.7.8'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -14934,7 +14934,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-ChkTeX (TeX Live) config.lt 1.7.6
+ChkTeX (TeX Live) config.lt 1.7.8
configured by $0, generated by GNU Autoconf 2.71.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -16541,7 +16541,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ChkTeX (TeX Live) $as_me 1.7.6, which was
+This file was extended by ChkTeX (TeX Live) $as_me 1.7.8, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16609,7 +16609,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-ChkTeX (TeX Live) config.status 1.7.6
+ChkTeX (TeX Live) config.status 1.7.8
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/texk/chktex/version.ac b/Build/source/texk/chktex/version.ac
index 8379d9ddf7f..9dd2a91432a 100644
--- a/Build/source/texk/chktex/version.ac
+++ b/Build/source/texk/chktex/version.ac
@@ -1,4 +1,5 @@
dnl
+dnl Copyright 2017-2022 Karl Berry <tex-live@tug.org>
dnl Copyright 2012-2015 Peter Breitenlohner <tex-live@tug.org>
dnl
dnl This file is free software; the copyright holder
@@ -8,4 +9,4 @@ dnl
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current chktex version
-m4_define([chktex_version], [1.7.6])
+m4_define([chktex_version], [1.7.8])