git.iko.soy/typeable/pandoc
on master help sign in
+ 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

commit52666e230135eb2872a3c1c67bacc3ef13770bec authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 7 Jan 2007, 05:09 (20 years ago) parent900e352
1 file changed+9−14
src/wrappers/markdown2pdf.in+9−14
src/wrappers/markdown2pdf.in+9−14
@@ -27,23 +27,18 @@ destname="${outfile:-$defaultdest}"
2727
2828(
2929 cd $THIS_TEMPDIR
30− if ! pdflatex -interaction=batchmode $texname.tex >$texname.log 2>&1; then
31− shortlog="$(sed -ne 's/^[Ee]rror:*[[:space:]]*//p' $texname.log)"
32− if [ -n "$shortlog" ]; then
33− err "Errors:"
34− err "$shortlog"
35− else
36− # Short log is not available, dump the whole log.
37− err "pdfLaTeX log:"
38− cat $texname.log >&2
39− fi
30+ if ! pdflatex -interaction=batchmode $texname.tex >/dev/null 2>&1; then
31+ err "${THIS}: pdfLaTeX error context:"
32+ sed -ne '/^![[:space:]]/,/^[[:space:]]*$/p' \
33+ -ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
34+ -ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
4035 if grep -q "File \`ucs.sty' not found" $texname.log; then
41− err "Please install the 'unicode' package from CTAN:"
42− err "http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
36+ err "${THIS}: Please install the 'unicode' package from CTAN:"
37+ err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
4338 fi
4439 if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
45− err "Please install the 'fancyvrb' package from CTAN:"
46− err "http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
40+ err "${THIS}: Please install the 'fancyvrb' package from CTAN:"
41+ err " http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
4742 fi
4843 exit 1
4944 fi