[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Avoid ignoring LaTeX export output errors when org-latex-pdf

From: Ihor Radchenko
Subject: Re: [PATCH] Avoid ignoring LaTeX export output errors when org-latex-pdf-process is a list
Date: Thu, 26 May 2022 12:44:06 +0800

Daniel Fleischer <danflscr@gmail.com> writes:

> Ihor Radchenko [2022-05-22 Sun 11:51] wrote:
>> The attached patch is fixing a rather annoying problem when
>> org-latex-pdf-process is set to a list. Currently, only output of the
>> last command in the list is preserved in *Org PDF LaTeX output* buffer,
>> which sometimes prevents ox-latex from detecting compilation warnings.
>> ox-latex relies on *Org PDF LaTeX output* to contain the output of latex
>> compiler. However, unless the last command in the org-latex-pdf-process
>> is something like pdflatex, the compiler errors are erased by
>> `shell-command' called by `org-compile-file'.
> Looks good. So the log buffer is going to be a concatenation of all the
> logs. Will ox-latex parse the longer log in a meaningful way?

ox-latex parses warnings according to org-latex--collect-warnings and
org-latex-known-warnings. It simply uses regular expressions.

By default, org-latex-pdf-process is using latexmk and will have no
issues. In theory, if the user adds some funny command outputting
warning/error-like string to org-latex-pdf-process, there might be a
confusing. But I see it as unlikely. The current behavior of keeping
only the last command output is worse, IMHO.

>  Is it just for the user to find issues by herself after a failed
> compilation?

It is orthogonal to the patch, but yes.
org-latex-compile does the following if it finds warnings/errors:

(let ((warnings (org-latex--collect-warnings log-buf)))
        (message (concat "PDF file produced"
                          ((eq warnings 'error) " with errors.")
                          (warnings (concat " with warnings: " warnings))
                          (t ".")))))

You just get a message indicating that there are some errors/warnings
(or even no message in some cases, when the proposed patch is not


reply via email to

[Prev in Thread] Current Thread [Next in Thread]