TeX errors are conventionally marked by the sequence <LF>!<SPACE>… in log files.
However, sometimes one can accidentally get this sequence of characters in a log file even if no error occured.
For example, consider this LaTeX document test.tex:
\documentclass{scrartcl}
\begin{document}
test
\immediate\write18{%
echo This is a sentence that accidentally ends in an exclamation mark!
This is problematic.
}
\end{document}
Running with pdflatex -shell-escape test.tex, the following appears in the log file:
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2016.9.6) 7 SEP 2016 01:07
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**test.tex
(./test.tex
LaTeX2e <2016/03/31> patch level 3
… (removed for brevity)
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2.
LaTeX Font Info: ... okay on input line 2.
runsystem(echo This is a sentence that accidentally ends in an exclamation mark
! This is problematic. )...executed.
[1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux) )
Here is how much of TeX's memory you used:
… (removed for brevity)
Notice the line that says ! This is problematic. )...executed..
My LaTeX editor (TeXStudio) received a bug report with just this problem a while ago, but apparently decided against trying to distinguish these cases in its log file parsing, so I’m getting false-positive errors during my LaTeX runs.
But this is not just about TeXStudio: I’m certain that many log-parsing tools would show this case as a false positive.
Now, my idea for the specific case of \write18 was to insert linebreaks in the argument, but I don’t know how/if this is possible.
Another possibility would be to change my configuration (texmf.cnf) to avoid the forced linebreaks inserted by TeX into the log file, but the file /usr/share/texlive/texmf-dist/web2c/texmf.cnf that came with my installation of TeX Live 2016 warns about error_line, half_error_line and max_print_line: “It's probably inadvisable to change these.”.
Moreover, since I’m collaborating with others, I’d like to avoid having to tell all of them that this is not an actual error and how to change their configuration.
So, how can I avoid these fake errors considering my situation?
!that should be doable. Where do these arguments of\write18come from? – Bruno Le Floch Sep 07 '16 at 00:32!– David Carlisle Sep 07 '16 at 06:53\write18comes from thepullquotepackage (which needs ImageMagick): https://bazaar.launchpad.net/~tex-sx/tex-sx/development/view/head:/pullquote.dtx – Socob Sep 07 '16 at 14:08pullquotethen you can count characters in the file path to adapt the number of spaces. It's admittedly a bit painful to write the appropriate code but I know many people here could: if you don't get a general answer soon maybe describe more precisely your specific situation. – Bruno Le Floch Sep 07 '16 at 15:23