| 1 |
% texlogsieve - filter and summarize LaTeX log files |
| 2 |
% |
| 3 |
% Copyright (C) 2021-2026 Nelson Lago <[email protected]> |
| 4 |
% |
| 5 |
% This program is free software: you can redistribute it and/or modify |
| 6 |
% it under the terms of the GNU General Public License as published by |
| 7 |
% the Free Software Foundation, either version 3 of the License, or |
| 8 |
% (at your option) any later version. |
| 9 |
% |
| 10 |
% This program is distributed in the hope that it will be useful, |
| 11 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
% GNU General Public License for more details. |
| 14 |
% |
| 15 |
% You should have received a copy of the GNU General Public License |
| 16 |
% along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 17 |
% |
| 18 |
% Code etc: https://gitlab.com/lago/texlogsieve |
| 19 |
|
| 20 |
\documentclass{ltxdoc} |
| 21 |
|
| 22 |
\usepackage[hyperref,svgnames,x11names,table]{xcolor} |
| 23 |
\usepackage{url} |
| 24 |
\urlstyle{sf} |
| 25 |
\usepackage{hyperref} |
| 26 |
\hypersetup{ |
| 27 |
colorlinks=true, |
| 28 |
citecolor=DarkGreen, |
| 29 |
linkcolor=NavyBlue, |
| 30 |
urlcolor=DarkRed, |
| 31 |
filecolor=green, |
| 32 |
anchorcolor=black, |
| 33 |
} |
| 34 |
|
| 35 |
\usepackage{libertinus} |
| 36 |
\usepackage[scale=.85]{sourcecodepro} |
| 37 |
\usepackage{microtype} |
| 38 |
\usepackage{metalogo} |
| 39 |
|
| 40 |
\hyphenation{tex-log-sieve tex-log-sieverc} |
| 41 |
|
| 42 |
\RecordChanges |
| 43 |
|
| 44 |
\changes{1.0.0-beta-1}{2021/12/16}{First public prerelease} |
| 45 |
\changes{1.0.0-beta-2}{2022/01/04}{Automatically read \texttt{texlogsieverc} |
| 46 |
if it exists} |
| 47 |
\changes{1.0.0-beta-2}{2022/01/04}{Add options \texttt{-\/-be-redundant} |
| 48 |
and \texttt{-\/-box-detail}} |
| 49 |
\changes{1.0.0-beta-2}{2022/01/04}{Add options |
| 50 |
\texttt{-\/-set-to-level-[levelname]}} |
| 51 |
\changes{1.0.0-beta-2}{2022/01/04}{Include silenced messages in summaries} |
| 52 |
\changes{1.0.0-beta-2}{2022/01/04}{Substitute empty citation/label keys |
| 53 |
for ``???''} |
| 54 |
\changes{1.0.0-beta-2}{2022/01/04}{Fix bug that prevented |
| 55 |
\texttt{-\/-add-[info\textbar |
| 56 |
warning]-message} from working} |
| 57 |
\changes{1.0.0-beta-2}{2022/01/04}{Misc small bugfixes} |
| 58 |
\changes{1.0.0-beta-3}{2022/02/02}{Add options |
| 59 |
\texttt{-\/-summary-detail}, |
| 60 |
\texttt{-\/-ref-detail}, |
| 61 |
\texttt{-\/-cite-detail}} |
| 62 |
\changes{1.0.0-beta-3}{2022/02/02}{Abort on invalid command-line options} |
| 63 |
\changes{1.0.0-beta-3}{2022/02/02}{Detect ``please rerun`` messages and |
| 64 |
add them to the summary} |
| 65 |
\changes{1.0.0-beta-3}{2022/02/02}{Fix line unwrapping with \XeTeX} |
| 66 |
\changes{1.0.0-final={1.0.0}}{2022/02/09}{Better compatibility with MiK\TeX\ for |
| 67 |
Windows} |
| 68 |
\changes{1.0.0-final={1.0.0}}{2022/02/09}{If possible, use the \texttt{.fls} file} |
| 69 |
\changes{1.0.0-final={1.0.0}}{2022/02/09}{Add options \texttt{-\/-file-banner} |
| 70 |
and \texttt{-\/-color}} |
| 71 |
\changes{1.0.0-final={1.0.0}}{2022/02/09}{Changed the effect of filters on the summary} |
| 72 |
\changes{1.1.0}{2022/03/04}{Print ``No important messages to show'' when |
| 73 |
nothing is printed} |
| 74 |
\changes{1.1.0}{2022/03/04}{Fix bug with filename and URL on the same line} |
| 75 |
\changes{1.1.0}{2022/03/04}{Print warning in the summary when there are |
| 76 |
error messages} |
| 77 |
\changes{1.1.0}{2022/03/04}{Do not lose messages if the file is truncated} |
| 78 |
\changes{1.1.1}{2022/03/05}{Fix error in variable scope} |
| 79 |
\changes{1.1.2}{2022/03/14}{Fix bug unwrapping lines starting with ``]''} |
| 80 |
\changes{1.1.3}{2022/04/22}{Be more careful with continuation lines in error |
| 81 |
msgs} |
| 82 |
\changes{1.2.0}{2022/07/21}{Fix bug with missing citations} |
| 83 |
\changes{1.2.0}{2022/07/21}{Colored keys with missing citations / chars} |
| 84 |
\changes{1.2.0}{2022/07/21}{Improved example latexmkrc in TIPS section} |
| 85 |
\changes{1.2.0}{2022/07/21}{Summary messages include line numbers} |
| 86 |
\changes{1.2.0}{2022/07/21}{Summary messages use singular and plural |
| 87 |
for pages and files} |
| 88 |
\changes{1.2.0}{2022/07/21}{Add unused labels to summary} |
| 89 |
\changes{1.3.0}{2022/08/05}{Sort line numbers in summary} |
| 90 |
\changes{1.3.0}{2022/08/05}{Indicate whether there were parse errors |
| 91 |
in summary} |
| 92 |
\changes{1.3.0}{2022/08/05}{Add line number to parse error messages} |
| 93 |
\changes{1.3.0}{2022/08/05}{Add \texttt{-\/-verbose} option} |
| 94 |
\changes{1.3.0}{2022/08/05}{Search for a config file in the user's homedir too} |
| 95 |
\changes{1.3.1}{2022/09/05}{Fix bug when searching for config files in Windows} |
| 96 |
\changes{1.4.0}{2023/11/30}{Add tips on how to fix some warnings} |
| 97 |
\changes{1.4.0}{2023/11/30}{Handle files opened during shipout} |
| 98 |
\changes{1.4.1}{2024/01/15}{Look 5 lines ahead instead of 3} |
| 99 |
\changes{1.4.1}{2024/01/15}{Reduce priority of harmless font substitutions} |
| 100 |
\changes{1.4.1}{2024/01/15}{Recognize more messages} |
| 101 |
\changes{1.4.2}{2024/11/22}{Recognize more messages} |
| 102 |
\changes{1.4.2}{2024/11/22}{Correctly handle ``*full hbox while output\dots``} |
| 103 |
\changes{1.4.2}{2024/11/22}{Add mention to \texttt{pulp}} |
| 104 |
\changes{1.4.2}{2024/11/22}{Add messages from \texttt{comment} pkg} |
| 105 |
\changes{1.5.0}{2025/03/03}{Add .log extension if necessary} |
| 106 |
\changes{1.5.0}{2025/03/03}{Always convert \texttt{CR LF} to \texttt{LF} |
| 107 |
when reading the .log and .fls files} |
| 108 |
\changes{1.5.0}{2025/03/03}{When showing an UNKNOWN message, also show the |
| 109 |
previous one if it was suppressed, as they may |
| 110 |
be related} |
| 111 |
\changes{1.5.0}{2025/03/03}{Improved and refactored handling of error messages} |
| 112 |
\changes{1.5.0}{2025/03/03}{Allow for some messages that differ only in some |
| 113 |
details to be identified as the same message} |
| 114 |
\changes{1.5.0}{2025/03/03}{Identify some engine-specific errors and warnings} |
| 115 |
\changes{1.5.0}{2025/03/03}{Greatly improved shipoutFilesHandler (preventing |
| 116 |
weird errors)} |
| 117 |
\changes{1.5.0}{2025/03/03}{When adding a file or shipout to the stack, |
| 118 |
remove dangling ``DUMMY'' entry} |
| 119 |
\changes{1.5.0}{2025/03/03}{Fixed bug that prevented some summaries from |
| 120 |
being printed} |
| 121 |
\changes{1.6.0}{2025/03/11}{Refill the buffer more often} |
| 122 |
\changes{1.6.0}{2025/03/11}{\texttt{extraFilesHandler} now works correctly |
| 123 |
in RAW mode} |
| 124 |
\changes{1.6.0}{2025/03/11}{Correctly handle \texttt{-\null-no-blah} options |
| 125 |
even if \texttt{blah} is defined in the config |
| 126 |
file} |
| 127 |
\changes{1.6.0}{2025/03/11}{Fix subtle bug in |
| 128 |
\texttt{closeSquareBracketHandler:doit()}} |
| 129 |
\changes{1.6.0}{2025/03/11}{Fix bug \#19 in version 1.5.0 that could |
| 130 |
cause the program to freeze} |
| 131 |
\changes{1.6.0}{2025/03/11}{Greatly improved \texttt{epilogueHandler}; |
| 132 |
files loaded and other messages after the |
| 133 |
epilogue begins do not disappear anymore} |
| 134 |
\changes{1.6.1}{2026/01/12}{Improved handling of epilogue messages} |
| 135 |
\changes{1.6.1}{2026/01/12}{Added messages from the \texttt{contour} pkg} |
| 136 |
\changes{1.6.1}{2026/01/12}{Added support for the \texttt{scontents} pkg} |
| 137 |
\changes{1.6.1}{2026/01/12}{Added support for ``First Aid`` messages} |
| 138 |
|
| 139 |
\begin{document} |
| 140 |
|
| 141 |
\title{\textsf{texlogsieve}:\thanks{This document |
| 142 |
corresponds to \textsf{texlogsieve}~1.6.1, |
| 143 |
dated~2026-01-12.}\\[.3\baselineskip] |
| 144 |
{\normalsize(yet another program to)\\[-.6\baselineskip]} |
| 145 |
{\large filter and summarize \LaTeX\ log files} |
| 146 |
} |
| 147 |
|
| 148 |
\author{ |
| 149 |
Nelson Lago\\ |
| 150 |
\texttt{[email protected]}\\ |
| 151 |
~\\ |
| 152 |
\url{https://gitlab.com/lago/texlogsieve} |
| 153 |
} |
| 154 |
|
| 155 |
\maketitle |
| 156 |
|
| 157 |
\begin{abstract} |
| 158 |
|
| 159 |
\texttt{texlogsieve} reads a \LaTeX\ log file (or the standard input if |
| 160 |
no file is specified), filters out less relevant messages, and displays |
| 161 |
a summary report. Highlights: |
| 162 |
|
| 163 |
\begin{itemize} |
| 164 |
\item Two reports: the most important messages from the log file |
| 165 |
followed by a summary of repeated messages, undefined |
| 166 |
references etc.; |
| 167 |
\item The program goes to great lengths to correctly handle \TeX\ line |
| 168 |
wrapping and does a much better job at that than existing tools; |
| 169 |
\item Multiline messages are treated as a single entity; |
| 170 |
\item Several options to control which messages should be filtered out; |
| 171 |
\item No messages are accidentally removed. |
| 172 |
\end{itemize} |
| 173 |
|
| 174 |
\end{abstract} |
| 175 |
|
| 176 |
\section*{Introduction} |
| 177 |
|
| 178 |
The \LaTeX\ log file is very verbose, which is useful when debugging but |
| 179 |
a hindrance during document preparation, as warnings such as ``missing |
| 180 |
character'', ``undefined reference'', and others become buried among lots |
| 181 |
of less relevant messages. This program filters out such less relevant |
| 182 |
messages and outputs the rest, together with a final summary for the |
| 183 |
specially important ones. It is a \texttt{texlua} script, similar in |
| 184 |
spirit to tools such as \href{https://ctan.org/pkg/texfot}{\texttt{texfot}}, |
| 185 |
\href{https://ctan.org/pkg/texloganalyser}{\texttt{texloganalyser}}, |
| 186 |
\href{https://gitlab.com/latex-rubber/rubber}{\texttt{rubber-info}}, |
| 187 |
\href{https://ctan.org/pkg/texlog-extract}{\texttt{textlog\_extract}}, |
| 188 |
\href{https://github.com/reitzig/texlogparser}{\texttt{texlogparser}}, |
| 189 |
\href{https://gricad-gitlab.univ-grenoble-alpes.fr/labbeju/latex-packages} |
| 190 |
{\texttt{texlogfilter}}, \href{https://github.com/dmwit/pulp} |
| 191 |
{\texttt{pulp}}, and others. |
| 192 |
|
| 193 |
Note that it does not try to do anything smart about error messages (but |
| 194 |
it shows a warning in the summary if one is detected; check the ``Tips'' |
| 195 |
section regarding this); if there is an error, you probably want to take |
| 196 |
a look directly at the log file anyway. It also cannot detect if \LaTeX{} |
| 197 |
stops for user input, so you should \textbf{really} run \LaTeX\ in |
| 198 |
\texttt{nonstopmode} when \texttt{texlogsieve} is reading from a pipe. |
| 199 |
|
| 200 |
\texttt{texlogsieve} \textbf{must} be run from the same directory as |
| 201 |
\verb/[pdf|lua|xe]latex/, because it searches for the files used during |
| 202 |
compilation (packages loaded from the current directory, files included |
| 203 |
with \verb|\input| etc.). |
| 204 |
|
| 205 |
\pagebreak[1] |
| 206 |
The defaults are reasonable; hopefully, you can just do |
| 207 |
|
| 208 |
\begin{list}{}{} |
| 209 |
\small\item |
| 210 |
\verb/[pdf|lua|xe]latex -interaction nonstopmode myfile.tex | texlogsieve/ |
| 211 |
\par |
| 212 |
{\normalsize or\par} |
| 213 |
\verb|texlogsieve myfile.log| |
| 214 |
\end{list} |
| 215 |
|
| 216 |
\noindent and be satisfied with the result. |
| 217 |
|
| 218 |
Since it needs to know what messages to expect, \texttt{texlogsieve} is |
| 219 |
currently geared towards \LaTeX; I have no idea how it would work with |
| 220 |
Con\TeX{}t or plain \TeX. Still, adding support to them should not be |
| 221 |
too difficult. |
| 222 |
|
| 223 |
If you want to know more about the \TeX\ log file and the workings of the |
| 224 |
program, check the initial comments in the code. |
| 225 |
|
| 226 |
\section{Unwrapping Long Lines} |
| 227 |
|
| 228 |
\TeX\ wraps (breaks) lines longer than \texttt{max\_print\_line} (by |
| 229 |
default, 79 characters). Most tools detect lines that are exactly 79 |
| 230 |
characters long and treat the next line as a continuation, but that fails |
| 231 |
in quite a few cases (check the comments in the \texttt{texlogsieve} code |
| 232 |
for a discussion on that). So, if at all possible, it is a very good idea |
| 233 |
to set \texttt{max\_print\_line} to a really large value (such as 100,000), |
| 234 |
effectively disabling line wrapping. It was useful in the 1980s, but not |
| 235 |
anymore (your terminal or editor wraps automatically)\footnote{Likewise, |
| 236 |
\texttt{error\_line} and \texttt{half\_error\_line} should be, respectively, |
| 237 |
254 and 238 (more about these values here: |
| 238 |
\url{https://tex.stackexchange.com/a/525972}).}. |
| 239 |
|
| 240 |
Still, \texttt{texlogsieve} goes to great lengths to correctly handle |
| 241 |
\TeX{} line wrapping and does a pretty good job at that. It understands |
| 242 |
the \texttt{max\_print\_line} \TeX{} configuration variable and reads its |
| 243 |
value from the same places as \TeX. Setting \texttt{max\_print\_line} to |
| 244 |
a value larger than 9999 makes \texttt{texlogsieve} ignore line wrapping. |
| 245 |
|
| 246 |
\section{Unrecognized Messages} |
| 247 |
\label{unrecognized} |
| 248 |
|
| 249 |
\texttt{texlogsieve} automatically handles messages such as ``Package blah |
| 250 |
Info:\dots'' or ``LaTeX Warning:\dots''. However, many messages do not |
| 251 |
follow this pattern. To do its thing, \texttt{texlogsieve} should know about |
| 252 |
these other messages beforehand. This is important for three reasons: |
| 253 |
|
| 254 |
\begin{enumerate} |
| 255 |
\item Unknown messages are given maximum priority; if you do not want to |
| 256 |
see them, you have to use \texttt{-\/-silence-string}; |
| 257 |
\item If the message has more than one line, each line is treated as an |
| 258 |
independent message. This means you need to use |
| 259 |
\texttt{-\/-silence-string} multiple times; |
| 260 |
\item In some rare cases, an unrecognized message may make |
| 261 |
\texttt{texlogsieve} misclassify nearby wrapped lines (if it comes |
| 262 |
right after a 79 characters long line of a specific type), close |
| 263 |
file messages (if it includes an unmatched close parens character), |
| 264 |
or shipout messages (if it includes an unmatched close square bracket |
| 265 |
character or an open square bracket character followed only by |
| 266 |
numbers). |
| 267 |
\end{enumerate} |
| 268 |
|
| 269 |
While \texttt{texlogsieve} recognizes quite a few messages out of the box, |
| 270 |
you may run into a message generated by some package that it does not know |
| 271 |
about (you can check for this using \texttt{-l unknown}). If that is the |
| 272 |
case, you can use the \verb/--add-[debug|info|warning|critical]-message/ |
| 273 |
options to add it to the list of messages known to the program. |
| 274 |
|
| 275 |
\section{Configuration File} |
| 276 |
|
| 277 |
\texttt{texlogsieve} always searches automatically for the (optional) |
| 278 |
\texttt{texlogsieverc} configuration file in \texttt{\$TEXINPUTS} (i.e., |
| 279 |
it searches using \texttt{Kpathsea}). In the default configuration, the |
| 280 |
current directory is in \texttt{\$TEXINPUTS}, so adding a config file |
| 281 |
with that name to the project directory is enough to make it work. |
| 282 |
Options in the config file are exactly the same as the long command-line |
| 283 |
options described below, but without the preceding ``\texttt{-\/-}'' |
| 284 |
characters. Lines starting with a ``\#'' sign are comments. An example |
| 285 |
configuration file: |
| 286 |
|
| 287 |
\begin{quote} |
| 288 |
\begin{verbatim} |
| 289 |
no-summary-detail |
| 290 |
no-page-delay |
| 291 |
# no-page-delay enables shipouts, but we do not want that |
| 292 |
no-shipouts |
| 293 |
set-to-level-info=Hyperreferences in rotated content will be misplaced |
| 294 |
# no need to escape the "\" (or any other) character |
| 295 |
silence-string = Using \overbracket and \underbracket from `mathtools' |
| 296 |
# silence a string using lua pattern matching |
| 297 |
silence-string = ////luaotfload | aux : font no %d+ %(.-%) |
| 298 |
silence-files = *.sty |
| 299 |
\end{verbatim} |
| 300 |
\end{quote} |
| 301 |
|
| 302 |
If you'd like to also have a generic configuration file for all your projects |
| 303 |
(a good idea), put it at \texttt{\$HOME/.texlogsieverc} in unix-like systems; |
| 304 |
in Windows, put it either at \texttt{\%LOCALAPPDATA\%\textbackslash{}% |
| 305 |
texlogsieverc} (\texttt{C:\textbackslash{}Users\textbackslash{}<username>% |
| 306 |
\textbackslash{}AppData\textbackslash{}Local}) or \texttt{\%APPDATA\%% |
| 307 |
\textbackslash{}texlogsieverc} (\texttt{C:\textbackslash{}Documents and |
| 308 |
Settings\textbackslash{}<username>\textbackslash{}Application Data} or |
| 309 |
\texttt{C:\textbackslash{}Users\textbackslash{}<username>\textbackslash{}% |
| 310 |
AppData\textbackslash{}Roaming}). |
| 311 |
|
| 312 |
\section{Options} |
| 313 |
|
| 314 |
\begin{description} |
| 315 |
\item[\texttt{-\/-page-delay}, \texttt{-\/-no-page-delay}]~\\ |
| 316 |
Enable/disable grouping messages by page before display. When enabled, messages |
| 317 |
are only output after the current page is finished (shipout). The advantage is |
| 318 |
that the page number is included in the message (default enabled). |
| 319 |
\end{description} |
| 320 |
|
| 321 |
\begin{description} |
| 322 |
\item[\texttt{-\/-summary}, \texttt{-\/-no-summary}]~\\ |
| 323 |
Enable/disable final summary (default enabled). |
| 324 |
\end{description} |
| 325 |
|
| 326 |
\begin{description} |
| 327 |
\item[\texttt{-\/-only-summary}]~\\ |
| 328 |
No messages, show only the final summary (default disabled). |
| 329 |
\end{description} |
| 330 |
|
| 331 |
\begin{description} |
| 332 |
\item[\texttt{-\/-shipouts}, \texttt{-\/-no-shipouts}]~\\ |
| 333 |
Enable/disable reporting shipouts (default disabled with page-delay, enabled |
| 334 |
with no-page-delay). |
| 335 |
\end{description} |
| 336 |
|
| 337 |
\begin{description} |
| 338 |
\item[\texttt{-\/-file-banner}, \texttt{-\/-no-file-banner}]~\\ |
| 339 |
Show/don't show the ``From file\dots'' banner messages (default enabled, |
| 340 |
except with level \texttt{DEBUG} as that would be redundant and confusing). |
| 341 |
\end{description} |
| 342 |
|
| 343 |
\begin{description} |
| 344 |
\item[\texttt{-\/-repetitions}, \texttt{-\/-no-repetitions}]~\\ |
| 345 |
Allow/prevent repeated messages (default disabled, i.e., repeated messages |
| 346 |
are supressed). |
| 347 |
\end{description} |
| 348 |
|
| 349 |
\begin{description} |
| 350 |
\item[\texttt{-\/-be-redundant}, \texttt{-\/-no-be-redundant}]~\\ |
| 351 |
Present/suppress ordinary messages that will also appear in the summary. |
| 352 |
This affects messages that have special summaries (such as under/overfull |
| 353 |
boxes or undefined citations). With \texttt{-\/-no-be-redundant} (the |
| 354 |
default), these messages are filtered out and only appear in the final |
| 355 |
summary. |
| 356 |
\end{description} |
| 357 |
|
| 358 |
\begin{description} |
| 359 |
\item[\texttt{-\/-box-detail}, \texttt{-\/-no-box-detail}]~\\ |
| 360 |
Include/exclude detailed information on under/overfull boxes in the final |
| 361 |
summary. With \texttt{-\/-no-box-detail}, the summary presents only a list |
| 362 |
of pages and files that had under/overfull boxes (default enabled). |
| 363 |
\end{description} |
| 364 |
|
| 365 |
\begin{description} |
| 366 |
\item[\texttt{-\/-ref-detail}, \texttt{-\/-no-ref-detail}]~\\ |
| 367 |
Include/exclude detailed information on undefined references in the final |
| 368 |
summary. With \texttt{-\/-no-ref-detail}, the summary presents only a list of |
| 369 |
undefined references, without page numbers and filenames (default enabled). |
| 370 |
\end{description} |
| 371 |
|
| 372 |
\begin{description} |
| 373 |
\item[\texttt{-\/-cite-detail}, \texttt{-\/-no-cite-detail}]~\\ |
| 374 |
Include/exclude detailed information on undefined citations in the final |
| 375 |
summary. With \texttt{-\/-no-cite-detail}, the summary presents only a list |
| 376 |
of undefined citations, without page numbers and filenames (default enabled). |
| 377 |
\end{description} |
| 378 |
|
| 379 |
\begin{description} |
| 380 |
\item[\texttt{-\/-summary-detail}, \texttt{-\/-no-summary-detail}]~\\ |
| 381 |
Toggle \texttt{-\/-box-detail}, \texttt{-\/-ref-detail}, and |
| 382 |
\texttt{-\/-cite-detail} at once. |
| 383 |
\end{description} |
| 384 |
|
| 385 |
\begin{description} |
| 386 |
\item[\texttt{-\/-heartbeat}, \texttt{-\/-no-heartbeat}]~\\ |
| 387 |
Enable/disable progress gauge in page-delay mode (default enabled). |
| 388 |
\end{description} |
| 389 |
|
| 390 |
\begin{description} |
| 391 |
\item[\texttt{-\/-color}, \texttt{-\/-no-color}]~\\ |
| 392 |
Enable/disable colored output. On Windows, this will only work with |
| 393 |
an up-to-date Windows 10 or later (default disabled). |
| 394 |
\end{description} |
| 395 |
|
| 396 |
\begin{description} |
| 397 |
\item[\texttt{-\/-tips}, \texttt{-\/-no-tips}]~\\ |
| 398 |
Enable/disable suggesting fixes for some known warnings (default enabled). |
| 399 |
\end{description} |
| 400 |
|
| 401 |
\begin{description} |
| 402 |
\item[\texttt{-l LEVEL}, \texttt{-\/-minlevel=LEVEL}]~\\ |
| 403 |
Filter out messages with severity level lower than \texttt{LEVEL}. Valid |
| 404 |
levels are \texttt{DEBUG} (no filtering), \texttt{INFO}, \texttt{WARNING}, |
| 405 |
\texttt{CRITICAL}, and \texttt{UNKNOWN} (default \texttt{WARNING}). |
| 406 |
\end{description} |
| 407 |
|
| 408 |
\begin{description} |
| 409 |
\item[\texttt{-u}, \texttt{-\/-unwrap-only}]~\\ |
| 410 |
Do not filter messages and do not output the summary, only unwrap long, |
| 411 |
wrapped lines. The output should be very similar (but not equal) to the |
| 412 |
input file, but with wrapped lines reconstructed. This activates |
| 413 |
\texttt{-l debug}, \texttt{-\/-no-summary}, \texttt{-\/-no-page-delay}, |
| 414 |
\texttt{-\/-repetitions}, \texttt{-\/-be-redundant}, \texttt{-\/-shipouts}, |
| 415 |
and \texttt{-\/-no-file-banner}, and also supresses the verbose ``open/close |
| 416 |
file'' and ``shipout'' messages, simulating instead the \TeX{} format, with |
| 417 |
parens and square brackets. This is useful if you prefer the reports |
| 418 |
generated by some other tool but want to benefit from texlogsieve's line |
| 419 |
unwrapping algorithm; the output generated by this option should be |
| 420 |
parseable by other tools (but you probably need to coerce the other |
| 421 |
tool not to try to unwrap lines). |
| 422 |
\end{description} |
| 423 |
|
| 424 |
\begin{description} |
| 425 |
\item[\texttt{-\/-silence-package=PKGNAME}]~\\ |
| 426 |
Filter out messages that can be identified as coming from the given package. |
| 427 |
Use this option multiple times to suppress messages from several different |
| 428 |
packages. |
| 429 |
\end{description} |
| 430 |
|
| 431 |
\begin{description} |
| 432 |
\item[\texttt{-\/-silence-string=EXCERPT OF UNWANTED MESSAGE}]~\\ |
| 433 |
Filter out messages that contain the given string (you only need to provide |
| 434 |
part of the message text for the whole message to be suppressed). Use this |
| 435 |
option multiple times to suppress several different messages. The string |
| 436 |
should be a single line, but that is not a problem for multiline log |
| 437 |
messages: space characters in the provided string match any sequence of |
| 438 |
whitespace characters in the message, including newlines. If needed, you |
| 439 |
may precede the string with ``////'', in which case you can use lua-style |
| 440 |
pattern matching (\url{https://www.lua.org/pil/20.2.html}). Note that the |
| 441 |
string is used verbatim: you may need to enclose it in quotes or escape |
| 442 |
special characters such as ``\textbackslash'' for the benefit of the |
| 443 |
shell, but such quoting and escaping is unnecessary (and harmful) in |
| 444 |
the configuration file. |
| 445 |
\end{description} |
| 446 |
|
| 447 |
\begin{description} |
| 448 |
\item[\texttt{-\/-silence-file=FILENAME OR FILE GLOB}]~\\ |
| 449 |
Filter out messages that have been generated while the given file was being |
| 450 |
processed. Do \textbf{not} use absolute or relative paths, only filenames. |
| 451 |
Simple file globs, such as ``\texttt{*.cls}'', work as expected. If you are |
| 452 |
only using packages you already know, silencing ``\texttt{*.sty}'' may be a |
| 453 |
good idea (note that this does not suppress all messages from all packages, |
| 454 |
only the messages generated while the packages are being loaded). Use this |
| 455 |
option multiple times to suppress messages from several different files. |
| 456 |
\end{description} |
| 457 |
|
| 458 |
\begin{description} |
| 459 |
\item[\texttt{-\/-semisilence-file=FILENAME OR FILE GLOB}]~\\ |
| 460 |
Just like the previous option, but non-recursive. This means that messages |
| 461 |
generated while the given file was being processed are excluded, but messages |
| 462 |
generated by some other file that was opened by it are not. For example, |
| 463 |
if ``\texttt{chapters.tex}'' includes (with \textbackslash input) the |
| 464 |
files ``\texttt{chapter1.tex}'' and ``\texttt{chapter2.tex}'', using |
| 465 |
``\texttt{-\/-silence-file=chapters.tex}'' will prevent messages generated |
| 466 |
by any of the three files from being displayed. If, however, you use |
| 467 |
``\texttt{-\/-semisilence-file=chapters.tex}'', messages generated by |
| 468 |
\texttt{chapters.tex} will be suppressed, but messages generated by |
| 469 |
\texttt{chapter1.tex} or \texttt{chapter2.tex} will not. |
| 470 |
\end{description} |
| 471 |
|
| 472 |
\begin{description} |
| 473 |
\item[\texttt{-\/-add-[debug\textbar info\textbar warning\textbar |
| 474 |
critical]-message=MESSAGE}]~\\ |
| 475 |
Add \texttt{MESSAGE} to the list of messages known to the program with the |
| 476 |
given severity level; see Section \ref{unrecognized} for more information |
| 477 |
about this. Like \texttt{-\/-silence-string}, these should be a single line; |
| 478 |
unlike \texttt{-\/-silence-string}, you need to embed \verb|\n| explicitly |
| 479 |
to indicate line breaks (this is literally a backslash character followed |
| 480 |
by the letter ``n'', \textbf{not} a linefeed character). You may precede |
| 481 |
the string with ``////'' to use lua-style pattern matching, but embedding |
| 482 |
\verb|\n| to indicate line breaks is unavoidable. Use these options multiple |
| 483 |
times to add many different messages. |
| 484 |
\end{description} |
| 485 |
|
| 486 |
\begin{description} |
| 487 |
\item[\texttt{-\/-set-to-level-[debug\textbar info\textbar warning\textbar |
| 488 |
critical]=EXCERPT OF MESSAGE}]~\\ |
| 489 |
Redefine the severity level of messages that contain the provided string |
| 490 |
to the given level. Check the explanation for \texttt{-\/-silence-string}, |
| 491 |
as this works in a similar way. Use these options multiple times to change |
| 492 |
the severity level of many different messages. |
| 493 |
\end{description} |
| 494 |
|
| 495 |
\begin{description} |
| 496 |
\item[\texttt{-c CFGFILE}, \texttt{-\/-config-file=CFGFILE}]~\\ |
| 497 |
Read options from the given configuration file in addition to the |
| 498 |
default config files (see the ``Configuration File'' section). |
| 499 |
\end{description} |
| 500 |
|
| 501 |
\begin{description} |
| 502 |
\item[\texttt{-v}, \texttt{-\/-verbose}]~\\ |
| 503 |
Print the list of configuration files read and a short summary of the |
| 504 |
most important active configuration options. |
| 505 |
\end{description} |
| 506 |
|
| 507 |
\begin{description} |
| 508 |
\item[\texttt{-h}, \texttt{-\/-help}] |
| 509 |
Show concise options description. |
| 510 |
\end{description} |
| 511 |
|
| 512 |
\begin{description} |
| 513 |
\item[\texttt{-\/-version}] |
| 514 |
Print program version. |
| 515 |
\end{description} |
| 516 |
|
| 517 |
\section{Tips} |
| 518 |
|
| 519 |
\begin{itemize} |
| 520 |
\item If the program output is still too verbose to your liking, resist |
| 521 |
the urge to use \texttt{-l critical} or \texttt{-\/-only-summary}. Instead, |
| 522 |
create a configuration file with \texttt{no-summary-detail} and appropriate |
| 523 |
\texttt{silence-[something]} and \texttt{set-to-level-[something]} options: |
| 524 |
You will get reasonably quiet output but still be notified of problems. Since |
| 525 |
you probably always use essentially the same set of packages and classes, |
| 526 |
the file will be useable in other \LaTeX\ projects too; just put it in one |
| 527 |
of the places discussed in the ``Configuration File'' section. |
| 528 |
|
| 529 |
\item \texttt{texlogsieve} has no smarts to deal with error messages, but |
| 530 |
you may use options \texttt{-l unknown -\/-no-page-delay -\/-no-summary |
| 531 |
-\/-no-shipouts -\/-no-file-banner} to get almost nothing but errors. |
| 532 |
|
| 533 |
\item With \texttt{latexmk}, it is enough to put something like this in |
| 534 |
\texttt{latexmkrc}: |
| 535 |
|
| 536 |
\bgroup\small |
| 537 |
\begin{verbatim} |
| 538 |
set_tex_cmds("-halt-on-error -interaction nonstopmode %O %S|texlogsieve");\end{verbatim} |
| 539 |
\egroup |
| 540 |
|
| 541 |
However, this means you get to see the repeated output of all iterations |
| 542 |
needed to produce the document. To only see the output of the last iteration, |
| 543 |
you may do something like this: |
| 544 |
|
| 545 |
\bgroup\small |
| 546 |
\begin{verbatim} |
| 547 |
set_tex_cmds("-halt-on-error %O %S"); |
| 548 |
|
| 549 |
$silent = 1; # This adds "-interaction batchmode" |
| 550 |
$silence_logfile_warnings = 1; |
| 551 |
|
| 552 |
END { |
| 553 |
local $?; # do not override previous exit status |
| 554 |
if (-s "$root_filename.blg" |
| 555 |
and open my $bibfile, '<', "$root_filename.blg") { |
| 556 |
|
| 557 |
print("**********************\n"); |
| 558 |
print("bibtex/biber messages:\n"); |
| 559 |
while(my $line = <$bibfile>) { |
| 560 |
if ($line =~ /You.ve used/) { |
| 561 |
last; |
| 562 |
} else { |
| 563 |
print($line); |
| 564 |
}; |
| 565 |
}; |
| 566 |
close($bibfile); |
| 567 |
}; |
| 568 |
|
| 569 |
if (-s "$root_filename.ilg" |
| 570 |
and open my $indfile, '<', "$root_filename.ilg") { |
| 571 |
|
| 572 |
print("*************************\n"); |
| 573 |
print("makeindex/xindy messages:\n"); |
| 574 |
while(my $line = <$indfile>) { |
| 575 |
print($line); |
| 576 |
}; |
| 577 |
close($indfile); |
| 578 |
}; |
| 579 |
|
| 580 |
if (-s "$root_filename.log") { |
| 581 |
print("***************\n"); |
| 582 |
print("LaTeX messages:\n"); |
| 583 |
Run_subst("texlogsieve %R.log"); |
| 584 |
}; |
| 585 |
};\end{verbatim} |
| 586 |
\egroup |
| 587 |
\end{itemize} |
| 588 |
|
| 589 |
\section{License} |
| 590 |
|
| 591 |
Copyright © 2021--2026 Nelson Lago \textless [email protected]\textgreater\\ |
| 592 |
License GPLv3+: GNU GPL version 3 or later |
| 593 |
\url{https://gnu.org/licenses/gpl.html}.\\ |
| 594 |
This is free software: you are free to change and redistribute it.\\ |
| 595 |
There is NO WARRANTY, to the extent permitted by law. |
| 596 |
|
| 597 |
\PrintChanges |
| 598 |
|
| 599 |
\end{document} |