git.iko.soy/typeable/pandoc
on master help sign in
+ Fix a nasty bug in markdown2pdf. It used to send the log file to

/dev/null! + Another problem is the sed filter which returns nothing with pdfeTeX '3.141592-1.21a-2.2 (Web2C 7.5.4)' here. As the first cut towards fixing, use a somewhat heuristic approach: try to build a short log by matching against a magic error stamp, dump the whole log if the previous attempt failed. Note that, there is still room to improve this code. git-svn-id: https://pandoc.googlecode.com/svn/trunk@450 788f1e2b-df1e-0410-8736-df70ead52e1b

commit900e352f1cc53c06cc3ba95cd79630572e88f5a7 authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 7 Jan 2007, 03:17 (20 years ago) parent6f76111
1 file changed+10−3
src/wrappers/markdown2pdf.in+10−3
src/wrappers/markdown2pdf.in+10−3
@@ -27,9 +27,16 @@ destname="${outfile:-$defaultdest}"
2727
2828(
2929 cd $THIS_TEMPDIR
30− if ! pdflatex -interaction=batchmode $texname.tex >/dev/null 2>&1; then
31− err "LaTeX errors:"
32− sed -ne '/^!/,/^ *$/p' $texname.log >&2
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
3340 if grep -q "File \`ucs.sty' not found" $texname.log; then
3441 err "Please install the 'unicode' package from CTAN:"
3542 err "http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"