git.iko.soy/typeable/pandoc
on master help sign in
Modified markdown2pdf to run pdflatex a second time if --toc was
369a57efiddlosopher
src/wrappers/markdown2pdf.in+2−1
@@ -48,7 +48,8 @@ fi
48 exit $errcode
48 exit $errcode
49 }
49 }
50 if [ $runs -lt 3 ] &&
50 if [ $runs -lt 3 ] &&
51− grep -q "LaTeX Warning: There were undefined references." $texname.log; then
51+ ((grep -q "LaTeX Warning: There were undefined references." $texname.log) ||
52+ (echo "$@" | grep -q -- "--toc")); then
52 runs=$(($runs + 1))
53 runs=$(($runs + 1))
53 if grep -q "LaTeX Warning:.*[Cc]itation" $texname.log; then
54 if grep -q "LaTeX Warning:.*[Cc]itation" $texname.log; then
54 bibtex $texname 2>&1 >bibtex.err
55 bibtex $texname 2>&1 >bibtex.err