git.iko.soy/typeable/pandoc
on master help sign in
Various fixes in markdown2pdf.

+ Add a trailing ':' to TEXTINPUTS as per the instruction in TeX FAQ: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=graphicspath In the lack of it, pdflatex silently fails, for example, with the following command: 'TEXINPUTS=/tmp markdown2pdf' + Put the origdir at the front for the correct directory search order. + pdflatex didn't create log file on one occasion (the above command) that made sed commands failed. Test the existence of log before filtering it. + A few non-essential changes. git-svn-id: https://pandoc.googlecode.com/svn/trunk@459 788f1e2b-df1e-0410-8736-df70ead52e1b

commit8b98ef22da5857cb03b7418e2071aa7d37c35f04 authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 8 Jan 2007, 21:50 (20 years ago) parent965f80a
1 file changed+20−17
src/wrappers/markdown2pdf.in+20−17
src/wrappers/markdown2pdf.in+20−17
@@ -9,7 +9,6 @@ SYNOPSIS="converts markdown-formatted text to PDF, using pdflatex."
99
1010texname=output
1111logfile=$THIS_TEMPDIR/log
12−origdir=$(pwd)
1312
1413pandoc -s -r markdown -w latex "$@" -o - >$THIS_TEMPDIR/$texname.tex \
15142>$logfile
@@ -23,23 +22,27 @@ else
2322fi
2423
2524(
25+ origdir=$(pwd)
2626 cd $THIS_TEMPDIR
27− TEXINPUTS=$TEXINPUTS:$origdir pdflatex -interaction=batchmode \
28− $texname.tex >/dev/null 2>&1 || {
29− errorcode=$?
30− err "${THIS}: pdfLaTeX error context:"
31− sed -ne '/^!/,/^[[:space:]]*$/p' \
32− -ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
33− -ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
34− if grep -q "File \`ucs.sty' not found" $texname.log; then
35− err "${THIS}: Please install the 'unicode' package from CTAN:"
36− err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
37− fi
38− if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
39− err "${THIS}: Please install the 'fancyvrb' package from CTAN:"
40− err " http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
41− fi
42− exit $errorcode
27+ TEXINPUTS=$origdir:$TEXINPUTS:
28+ pdflatex -interaction=batchmode $texname.tex >/dev/null || {
29+ errcode=$?
30+ err "${THIS}: pdfLaTeX failed with error code $errcode"
31+ [ -f $texname.log ] && {
32+ err "${THIS}: error context:"
33+ sed -ne '/^!/,/^[[:space:]]*$/p' \
34+ -ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
35+ -ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
36+ if grep -q "File \`ucs.sty' not found" $texname.log; then
37+ err "${THIS}: Please install the 'unicode' package from CTAN:"
38+ err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
39+ fi
40+ if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
41+ err "${THIS}: Please install the 'fancyvrb' package from CTAN:"
42+ err " http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
43+ fi
44+ }
45+ exit $errcode
4346 }
4447) || exit $?
4548