khajavi / pandoc

Automatically exported from code.google.com/p/pandoc
GNU General Public License v2.0
0 stars 0 forks source link

Option to use xetex in markdown2pdf #185

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Patch due to Jonas Smedegaard:

--- a/markdown2pdf
+++ b/markdown2pdf
@@ -1,7 +1,8 @@
 #!/bin/sh -e

-REQUIRED="pdflatex"
-SYNOPSIS="converts markdown-formatted text to PDF, using pdflatex."
+PDFTEX="pdflatex"
+REQUIRED="$PDFTEX"
+SYNOPSIS="converts markdown-formatted text to PDF, using $PDFTEX."

 THIS=${0##*/}

@@ -87,9 +88,9 @@
     finished=no
     runs=0
     while [ $finished = "no" ]; do
-      pdflatex -interaction=batchmode $texname.tex >/dev/null || {
+      $PDFTEX -interaction=batchmode $texname.tex >/dev/null || {
         errcode=$?
-        err "${THIS}: pdfLaTeX failed with error code $errcode"
+        err "${THIS}: $PDFTEX failed with error code $errcode"
         [ -f $texname.log ] && {
           err "${THIS}: error context:"
           sed -ne '/^!/,/^[[:space:]]*$/p' \

New LaTeX.header (will work with both xetex and pdflatex):

\documentclass{article}
\usepackage{ifpdf,ifxetex}
\ifxetex
        \usepackage{fontspec,xltxtra,xunicode}
\else
        \usepackage[utf8x]{inputenc}
\fi
\usepackage{amsmath}
\usepackage[mathletters]{ucs}
\usepackage{listings}
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{
}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}

Original issue reported on code.google.com by fiddloso...@gmail.com on 12 Dec 2009 at 4:49

GoogleCodeExporter commented 9 years ago
We'd also need changes in markdown2pdf.hs.
And we might want to think about using a command-line option instead of an
environment variable (though the latter has certain advantages).

Original comment by fiddloso...@gmail.com on 12 Dec 2009 at 4:52

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1737.

Original comment by fiddloso...@gmail.com on 31 Dec 2009 at 1:18