1

I am writing a parser for warnings. I have extended the width of LaTeX's output so that errors and warnings all occur on a single line.

However, I have a problem with multi-line, formatted warn warnings as these are more difficult to handle.

An example is the following:

Package biblatex Warning: Biber reported the following issues
(biblatex)                with 'kannan_random_1997':
(biblatex)                - Datamodel: Entry 'kannan_random_1997' 
(bibliography.bib): Invalid ISSN in value of field 'issn'.

Here I would like to remove the newline, the (biblatex) and the white-space after it so the warning appears on a single line such as the following:

Package biblatex Warning: Biber reported the following issues with 'kannan_random_1997': - Datamodel: Entry 'kannan_random_1997' Invalid ISSN in value of field 'issn'.

Is there a way of cutting down the output like the above, either by using LaTeX or by changing environment variables/parameters?

MWE:

\documentclass{article}
\begin{document}
    \fontfamily{asdf}\selectfont
    Hello, world!
\end{document}
5
  • 1
    Could you paste a self-contained example document that reproduces the error(s) you want to extract? I presume biblatex errors are not the only ones your want to fetch?
    – siracusa
    Commented Oct 19, 2018 at 19:53
  • 2
    probably \def\MessageBreak{} but untested as you provide no test code Commented Oct 19, 2018 at 20:01
  • note the latex2e message linebreak specifically puts the package name on each new line so that it's easier to parse these messages and recognise the continuation lines,... Commented Oct 19, 2018 at 20:03
  • @DavidCarlisle \def\MessageBreak{} doesn't seem to be working for me...
    – kcza
    Commented Oct 19, 2018 at 20:23
  • ah no you'd have to patch \GenericWarning where it locally defines \messageBreak Commented Oct 19, 2018 at 20:54

1 Answer 1

3
LaTeX Font Warning: Font shape `OT1/asdf/m/n' undefined using `OT1/cmr/m/n' ins
tead on input line 12.

from

\makeatletter
\DeclareRobustCommand{\GenericWarning}[2]{%
   \begingroup
      \def\MessageBreak{ }%^^J#1}%
      \set@display@protect
      \immediate\write\@unused{^^J#2\on@line.^^J}%
   \endgroup
}
\makeatother
\documentclass{article}
\begin{document}
    \fontfamily{asdf}\selectfont
    Hello, world!
\end{document}

You must log in to answer this question.

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