aboutsummaryrefslogtreecommitdiff
path: root/src/wrappers
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrappers')
-rw-r--r--src/wrappers/markdown2pdf.in23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/wrappers/markdown2pdf.in b/src/wrappers/markdown2pdf.in
index 1189c69ff..a81ef061d 100644
--- a/src/wrappers/markdown2pdf.in
+++ b/src/wrappers/markdown2pdf.in
@@ -27,23 +27,18 @@ destname="${outfile:-$defaultdest}"
(
cd $THIS_TEMPDIR
- if ! pdflatex -interaction=batchmode $texname.tex >$texname.log 2>&1; then
- shortlog="$(sed -ne 's/^[Ee]rror:*[[:space:]]*//p' $texname.log)"
- if [ -n "$shortlog" ]; then
- err "Errors:"
- err "$shortlog"
- else
- # Short log is not available, dump the whole log.
- err "pdfLaTeX log:"
- cat $texname.log >&2
- fi
+ if ! pdflatex -interaction=batchmode $texname.tex >/dev/null 2>&1; then
+ err "${THIS}: pdfLaTeX error context:"
+ sed -ne '/^![[:space:]]/,/^[[:space:]]*$/p' \
+ -ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
+ -ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
if grep -q "File \`ucs.sty' not found" $texname.log; then
- err "Please install the 'unicode' package from CTAN:"
- err "http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
+ err "${THIS}: Please install the 'unicode' package from CTAN:"
+ err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
fi
if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
- err "Please install the 'fancyvrb' package from CTAN:"
- err "http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
+ err "${THIS}: Please install the 'fancyvrb' package from CTAN:"
+ err " http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
fi
exit 1
fi