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

resolves #1553 extract error message #1616

Merged
merged 1 commit into from
Aug 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions tikz/tikz2svg
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
}

Expand All @@ -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)
Expand Down