--- a/src/Pure/Thy/latex.scala Tue Mar 23 13:13:31 2021 +0100
+++ b/src/Pure/Thy/latex.scala Tue Mar 23 13:27:15 2021 +0100
@@ -138,6 +138,7 @@
"<everyeof>",
"<write>").mkString("^(?:", "|", ") (.*)$").r
+ val Bad_Font = """^LaTeX Font Warning: (Font .*\btxmia\b.* undefined).*$""".r
val Bad_File = """^! LaTeX Error: (File `.*' not found\.)$""".r
val error_ignore =
@@ -167,6 +168,8 @@
val pos = tex_file_position(file, line)
val msg2 = error_suffix1(rest1) orElse error_suffix2(rest1) getOrElse ""
filter(rest1, (Exn.cat_message(msg1, msg2), pos) :: result)
+ case Bad_Font(msg) :: rest =>
+ filter(rest, (msg, Position.none) :: result)
case Bad_File(msg) :: rest =>
filter(rest, (msg, Position.none) :: result)
case _ :: rest => filter(rest, result)
--- a/src/Pure/Thy/presentation.scala Tue Mar 23 13:13:31 2021 +0100
+++ b/src/Pure/Thy/presentation.scala Tue Mar 23 13:27:15 2021 +0100
@@ -680,12 +680,15 @@
val log_lines = result.out_lines ::: result.err_lines
- if (!result.ok) {
+ val errors =
+ (if (result.ok) Nil else List(result.err)) :::
+ Latex.latex_errors(doc_dir, root) :::
+ Bibtex.bibtex_errors(doc_dir, root)
+
+ if (errors.nonEmpty) {
val message =
Exn.cat_message(
- result.err,
- cat_lines(Latex.latex_errors(doc_dir, root) ::: Bibtex.bibtex_errors(doc_dir, root)),
- "Failed to build document " + quote(doc.name))
+ (errors ::: List("Failed to build document " + quote(doc.name))):_*)
throw new Build_Error(log_lines, message)
}
else if (!result_path.is_file) {