diff options
author | roktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-01-07 05:09:07 +0000 |
---|---|---|
committer | roktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-01-07 05:09:07 +0000 |
commit | 52666e230135eb2872a3c1c67bacc3ef13770bec (patch) | |
tree | 23d3d9df9eb157b043e643df0c4bb704c2b37bcc | |
parent | 900e352f1cc53c06cc3ba95cd79630572e88f5a7 (diff) | |
download | pandoc-52666e230135eb2872a3c1c67bacc3ef13770bec.tar.gz |
+ 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
-rw-r--r-- | src/wrappers/markdown2pdf.in | 23 |
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 |