git.iko.soy/typeable/pandoc
on master help sign in
Minor cleanups in markdown2pdf.in.
4814b0afiddlosopher
src/wrappers/markdown2pdf.in+18−19
@@ -10,8 +10,7 @@ SYNOPSIS="converts markdown-formatted text to PDF, using pdflatex."
10texname=output
10texname=output
11logfile=$THIS_TEMPDIR/log
11logfile=$THIS_TEMPDIR/log
12
12
13−pandoc -s -r markdown -w latex "$@" -o - >$THIS_TEMPDIR/$texname.tex \
13+pandoc -s -r markdown -w latex "$@" -o $THIS_TEMPDIR/$texname.tex 2>$logfile
14−2>$logfile
15
14
16if [ "$OUTPUT" = "-" ]; then
15if [ "$OUTPUT" = "-" ]; then
17 firstinfile="$(echo $ARGS | sed -ne '1p')"
16 firstinfile="$(echo $ARGS | sed -ne '1p')"
@@ -27,23 +26,23 @@ fi
27 TEXINPUTS=$origdir:$TEXINPUTS:
26 TEXINPUTS=$origdir:$TEXINPUTS:
28 export TEXINPUTS
27 export TEXINPUTS
29 pdflatex -interaction=batchmode $texname.tex >/dev/null || {
28 pdflatex -interaction=batchmode $texname.tex >/dev/null || {
30− errcode=$?
29+ errcode=$?
31− err "${THIS}: pdfLaTeX failed with error code $errcode"
30+ err "${THIS}: pdfLaTeX failed with error code $errcode"
32− [ -f $texname.log ] && {
31+ [ -f $texname.log ] && {
33− err "${THIS}: error context:"
32+ err "${THIS}: error context:"
34− sed -ne '/^!/,/^[[:space:]]*$/p' \
33+ sed -ne '/^!/,/^[[:space:]]*$/p' \
35− -ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
34+ -ne '/^[Ll]a[Tt]e[Xx] [Ww]arning/,/^[[:space:]]*$/p' \
36− -ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
35+ -ne '/^[Ee]rror/,/^[[:space:]]*$/p' $texname.log >&2
37− if grep -q "File \`ucs.sty' not found" $texname.log; then
36+ if grep -q "File \`ucs.sty' not found" $texname.log; then
38− err "${THIS}: Please install the 'unicode' package from CTAN:"
37+ err "${THIS}: Please install the 'unicode' package from CTAN:"
39− err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
38+ err " http://www.ctan.org/tex-archive/macros/latex/contrib/unicode/"
40− fi
39+ fi
41− if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
40+ if grep -q "File \`fancyvrb.sty' not found" $texname.log; then
42− err "${THIS}: Please install the 'fancyvrb' package from CTAN:"
41+ err "${THIS}: Please install the 'fancyvrb' package from CTAN:"
43− err " http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
42+ err " http://www.ctan.org/tex-archive/macros/latex/contrib/fancyvrb/"
44− fi
43+ fi
45− }
44+ }
46− exit $errcode
45+ exit $errcode
47 }
46 }
48) || exit $?
47) || exit $?
49
48