From 52666e230135eb2872a3c1c67bacc3ef13770bec Mon Sep 17 00:00:00 2001 From: roktas Date: Sun, 7 Jan 2007 05:09:07 +0000 Subject: + Revert previous commit which is wrong and insufficient on some parts. + Improve sed filter to extract the following error contexts: 1. From a line starting with ! to the next blank line. 2. From a line beginning "LaTeX Warning:" to the next blank line. 3. From a line beginning "Error:" to the next blank line, or EOF. + Improve the error message headers (perhaps needs a proof reading). Prepend the wrapper name to the error headers for easy spotting. git-svn-id: https://pandoc.googlecode.com/svn/trunk@451 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/wrappers/markdown2pdf.in | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'src') 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 -- cgit v1.2.3