Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve parsing of multiline LaTeX3 warnings/errors #1410

Closed
tweh opened this issue Dec 31, 2020 · 3 comments
Closed

Improve parsing of multiline LaTeX3 warnings/errors #1410

tweh opened this issue Dec 31, 2020 · 3 comments

Comments

@tweh
Copy link

tweh commented Dec 31, 2020

This issue might be linked to issue #318 could be tagged “enhancement”.

Environment

  • TeXstudio: 3.0.1
  • Qt: 5.15.0
  • OS: macOS 10.15.7
  • TeX distribution: texlive 2020

Actual behavior

For longer warnings issued by LaTeX2e using \MessageBreak or by LaTeX3 package in general in the LOG file for every line except the first one the message is indented and the line starts with (<pkg>) (marked red). The latter text is then parsed by TeXstudio to be part of the message in the table view. For warnings without \MessageBreak the parsing is fine, since the format of the message in the LOG is different.
txswarning tex - TeXstudio 2020-12-31 11-34-54

Expected behavior

It would be nice if TeXstudio could filter these texts (marked red) and show only the real message text without interruption.

How to reproduce

Example to test

\documentclass{article}

\newcommand{\warningIIeA}{%
   \PackageWarning{demo}{This is a quite long warning message broken in multiple lines, but the parser incorporatdes the line prefix conatining the package name.}
}
\newcommand{\warningIIeB}{%
   \PackageWarning{demo}{This is a quite long warning message broken in multiple\MessageBreak lines, but the parser incorporatdes the line prefix\MessageBreak conatining the package name.}
}

\usepackage{xparse}

\ExplSyntaxOn
\msg_new:nnnn { demo } { message } { This~is~a~quite~long~warning~message~broken~in~multiple~lines,~but~the~parser~incorporatdes~the~line~prefix~conatining~the~package~name. } { no~futher~help~... }
\NewDocumentCommand{ \warningIII } { } {
   \msg_warning:nn { demo } { message }
}
\ExplSyntaxOff

\begin{document}
\LaTeXe\ warning message \warningIIeA

\LaTeXe\ warning message with message break \warningIIeB

\LaTeX3 warning message \warningIII
\end{document}
@muzimuzhi
Copy link
Contributor

Reproducible when using \MessageBreak in latex2e style \PackageWarning.

@tweh
Copy link
Author

tweh commented Dec 31, 2020

Thanks. I updated/generalised the title and comment.

@tobiasBora
Copy link

tobiasBora commented Dec 21, 2023

Note also that if the error message contains a long line like robustExternalize/robExt-ABC41082ADB6EF46AFE4D61D09630D7A.pdf here:

! Package robExt Error: On line 16: the pdf file
(robExt)               
robustExternalize/robExt-ABC41082ADB6EF46AFE4D61D09630D7A.pdf
(robExt)                is not present. The compilation command "cd
(robExt)                robustExternalize/ && gnuplot -c
(robExt)                "robExt-ABC41082ADB6EF46AFE4D61D09630D7A.tex" &&
(robExt)                echo "ok" >
(robExt)                "robExt-ABC41082ADB6EF46AFE4D61D09630D7A.pdf"" used
(robExt)                to compile the environment on line 16 certainly
(robExt)                failed with errors:
(robExt)                vvvvvv
(robExt)                some random message error from gnuplot
(robExt)                ^^^^^^
(robExt)                See full logs below or in
(robExt)               
robustExternalize/robExt-ABC41082ADB6EF46AFE4D61D09630D7A-compilation.log.

the error message is even worse as it will not even print anything past "On line 16: the pdf file".

--EDIT--
I tried to have a shorter file name fitting in one line, but the result is no better, I don't even see the multiple lines with the (robExt) in between sadly, only the first line:

image

Also, how are you getting the parsing the message to get the line number?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants