diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-09-26 17:06:42 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-09-26 17:06:42 -0700 |
commit | e5aacec7899231e8ac349281aa4d38f8055200b0 (patch) | |
tree | d3546c00a8ed07048af828f8e13abd27a28abc4d | |
parent | 04bdf5a9b789ed4998527a57d52714ccadfedc21 (diff) | |
parent | 0b80b7006f110509d82879707f633b945b3b8ae1 (diff) | |
download | pandoc-e5aacec7899231e8ac349281aa4d38f8055200b0.tar.gz |
Merge pull request #120 from mb21/bidi
Support bidirectional text output with XeLaTeX, ConTeXt and HTML
-rw-r--r-- | default.context | 4 | ||||
-rw-r--r-- | default.html | 2 | ||||
-rw-r--r-- | default.latex | 17 |
3 files changed, 22 insertions, 1 deletions
diff --git a/default.context b/default.context index c9b4936fb..1bfc6bc14 100644 --- a/default.context +++ b/default.context @@ -5,6 +5,10 @@ $if(context-lang)$ \mainlanguage[$context-lang$] $endif$ +$if(context-dir)$ +\setupalign[$context-dir$] +\setupdirections[bidi=on,method=two] +$endif$ % Enable hyperlinks \setupinteraction[state=start, color=middleblue] diff --git a/default.html b/default.html index 1bbeda47a..aad3ffaea 100644 --- a/default.html +++ b/default.html @@ -1,5 +1,5 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$> +<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> diff --git a/default.latex b/default.latex index bfb2e3094..c67dbfecb 100644 --- a/default.latex +++ b/default.latex @@ -139,6 +139,23 @@ $endif$ $if(verbatim-in-note)$ \VerbatimFootnotes % allows verbatim text in footnotes $endif$ +$if(dir)$ +\ifxetex + % load bidi as late as possible as it modifies e.g. graphicx + $if(latex-dir-rtl)$ + \usepackage[RTLdocument]{bidi} + $else$ + \usepackage{bidi} + $endif$ +\fi +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \TeXXeTstate=1 + \newcommand{\RL}[1]{\beginR #1\endR} + \newcommand{\LR}[1]{\beginL #1\endL} + \newenvironment{RTL}{\beginR}{\endR} + \newenvironment{LTR}{\beginL}{\endL} +\fi +$endif$ $if(title)$ \title{$title$$if(subtitle)$\\\vspace{0.5em}{\large $subtitle$}$endif$} |