From a0af39430544190a6e48b7fff6349794684d52a9 Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Sun, 20 Aug 2023 10:26:25 +0200 Subject: [PATCH] resolves #1553 extract error message (#1616) --- tikz/tikz2svg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tikz/tikz2svg b/tikz/tikz2svg index f1703e8a3..fb8ac25e1 100755 --- a/tikz/tikz2svg +++ b/tikz/tikz2svg @@ -5,7 +5,6 @@ # Converts PGF/TikZ on stdin to one of the supported output formats (jpeg, # pdf, png, svg) on stdout. -set -x set -e # Latex Options: @@ -77,6 +76,10 @@ output_format="$1" tempdir=$(mktemp --directory) cleanup() { + if [ -f "$tempdir/file.log" ]; then + # retrieve errors + cat "$tempdir/file.log" | awk '/^\!/,/^l\.[0-9]+/ { print $0 }' + fi rm -rf $tempdir } @@ -88,7 +91,7 @@ cd $tempdir cat >raw_input.tex maybe_add_documentclass $output_format raw_input.tex > file.tex -latex $LATEX_OPTIONS -output-format=$(intermediate_format $output_format) file.tex 1>&2 +latex $LATEX_OPTIONS -output-format=$(intermediate_format $output_format) file.tex >/dev/null case "$output_format" in jpeg|png)