emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Add catch-up all LaTeX errors
@ 2013-10-11  8:11 Francesco Pizzolante
       [not found] ` <87vc14i5wp.fsf-oHC15RC7JGTNLxjTenLetw@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Francesco Pizzolante @ 2013-10-11  8:11 UTC (permalink / raw)
  To: mailing-list-org-mode

Hi,

This is not a definitive patch. It's just a first step in getting a better one.

The issue is the fact that, when exporting to PDF, in some cases, Org tells
that the export has been done successfully while the PDF file has not been
produced!

As an example, if you open the target PDF file with Adobe Reader and, in the
meantime, you export your Org file again to PDF, you'll see that Org will tell
you it's OK (Process Completed) while, if you look at the *Org PDF LaTeX
Output* buffer, you'll see an error such as:

--8<---------------cut here---------------start------------->8---
! I can't write on file `toto.pdf'.
[...]
--8<---------------cut here---------------end--------------->8---

The problem comes from the fact that Org just checks for a couple of error
messages (defined in org-latex-known-errors) and report it's OK if it doesn't
find those messages:

--8<---------------cut here---------------start------------->8---
(defcustom org-latex-known-errors
  '(("Reference.*?undefined" .  "[undefined reference]")
    ("Citation.*?undefined" .  "[undefined citation]")
    ("Undefined control sequence" .  "[undefined control sequence]")
    ("^! LaTeX.*?Error" .  "[LaTeX error]")
    ("^! Package.*?Error" .  "[package error]")
    ("Runaway argument" .  "Runaway argument"))
[...]
--8<---------------cut here---------------end--------------->8---

In order to be sure to check for ALL errors, we should check for any line
beginning with '!' (http://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings).
That's the idea of this patch.

Though, the issue with this patch is that some error can match 2 messages, and
you get the following display:

--8<---------------cut here---------------start------------->8---
Process completed with errors: [LaTeX error] [Unknown error]
--8<---------------cut here---------------end--------------->8---

To this issue, I see 2 solutions:

1. Either catch all errors with a single regexp (and remove all other regexps):

--8<---------------cut here---------------start------------->8---
(defcustom org-latex-known-errors
  '(("^!.*" .  "LaTeX error"))
[...]
--8<---------------cut here---------------end--------------->8---

2. Stop on the first error found and report it.

In all cases, it would be much better to be able to report the error line such
as:

--8<---------------cut here---------------start------------->8---
Process completed with errors: [! I can't write on file `toto.pdf'.]
--8<---------------cut here---------------end--------------->8---

Can someone do this or help me to achieve it?

Best regards,
 Francesco

---
 lisp/ox-latex.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 9262ded..2cffe38 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -862,7 +862,8 @@ logfiles to remove, set `org-latex-logfiles-extensions'."
     ("Undefined control sequence" .  "[undefined control sequence]")
     ("^! LaTeX.*?Error" .  "[LaTeX error]")
     ("^! Package.*?Error" .  "[package error]")
-    ("Runaway argument" .  "Runaway argument"))
+    ("Runaway argument" .  "Runaway argument")
+    ("^!.*" . "[Unknown error]"))
   "Alist of regular expressions and associated messages for the user.
 The regular expressions are used to find possible errors in the
 log of a latex-run."
--
1.7.9

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-03-28 13:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-11  8:11 [PATCH] Add catch-up all LaTeX errors Francesco Pizzolante
     [not found] ` <87vc14i5wp.fsf-oHC15RC7JGTNLxjTenLetw@public.gmane.org>
2014-03-26 14:36   ` Francesco Pizzolante
2014-03-26 14:51     ` Nicolas Goaziou
     [not found]       ` <87zjkdt3le.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-26 15:39         ` Francesco Pizzolante
2014-03-26 16:12           ` Nicolas Goaziou
2014-03-26 18:55             ` Sebastien Vauban
2014-03-27 10:02               ` Nicolas Goaziou
2014-03-27 10:17                 ` Sebastien Vauban
2014-03-28 10:59                   ` Nicolas Goaziou
2014-03-28 13:53                     ` Sebastien Vauban
     [not found]             ` <87vbv1szuv.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-27 10:19               ` Francesco Pizzolante
2014-03-26 22:33       ` Charles Millar
     [not found]         ` <533355BA.1030003-H+0wwilmMs3R7s880joybQ@public.gmane.org>
2014-03-27 10:27           ` Francesco Pizzolante
2014-03-28  4:40         ` Marcin Borkowski
2014-03-28  8:14           ` Francesco Pizzolante

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).