diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-12-31 01:18:06 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-12-31 01:18:06 +0000 |
commit | ffed5c1cc310c4c377a73294514f5ac0cc682301 (patch) | |
tree | e3ad53e24b1cae0389bdee6a86101adc00bff823 /markdown2pdf | |
parent | b86710983045ada1fb1baaaeb0041679b555c4de (diff) | |
download | pandoc-ffed5c1cc310c4c377a73294514f5ac0cc682301.tar.gz |
Added --xetex option to pandoc and markdown2pdf.
If --xetex is specified, pandoc produces latex suitable for
processing by xelatex, and markdown2pdf uses xelatex to create
the PDF. Resolves Issue #185.
This seems better than using latex packages to detect xetex,
since not all latex installations will have these.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1737 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'markdown2pdf')
-rwxr-xr-x | markdown2pdf | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/markdown2pdf b/markdown2pdf index faeafc174..4e85a371d 100755 --- a/markdown2pdf +++ b/markdown2pdf @@ -1,6 +1,11 @@ #!/bin/sh -e -REQUIRED="pdflatex" +latexprogram=pdflatex +if (echo "$@" | grep -q xetex); then + latexprogram=xelatex +fi + +REQUIRED=$latexprogram SYNOPSIS="converts markdown-formatted text to PDF, using pdflatex." THIS=${0##*/} @@ -46,7 +51,6 @@ CONF=$(pandoc --dump-args "$@" 2>&1) || { OUTPUT=$(echo "$CONF" | sed -ne '1p') ARGS=$(echo "$CONF" | sed -e '1d') - # As a security measure refuse to proceed if mktemp is not available. pathfind mktemp || { err "Couldn't find 'mktemp'; aborting."; exit 1; } @@ -87,9 +91,9 @@ fi finished=no runs=0 while [ $finished = "no" ]; do - pdflatex -interaction=batchmode $texname.tex >/dev/null || { + $latexprogram -interaction=batchmode $texname.tex >/dev/null || { errcode=$? - err "${THIS}: pdfLaTeX failed with error code $errcode" + err "${THIS}: $latexprogram failed with error code $errcode" [ -f $texname.log ] && { err "${THIS}: error context:" sed -ne '/^!/,/^[[:space:]]*$/p' \ |