git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #120 from mb21/bidi

Support bidirectional text output with XeLaTeX, ConTeXt and HTML

commite5aacec7899231e8ac349281aa4d38f8055200b0 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 26 Sep 2015, 17:06 (11 years ago) parent04bdf5a0b80b70
3 files changed+22−1
default.context+4 default.html+1−1 default.latex+17
default.context+4
@@ -5,6 +5,10 @@
55$if(context-lang)$
66\mainlanguage[$context-lang$]
77$endif$
8+$if(context-dir)$
9+\setupalign[$context-dir$]
10+\setupdirections[bidi=on,method=two]
11+$endif$
812
913% Enable hyperlinks
1014\setupinteraction[state=start, color=middleblue]
default.html+1−1
@@ -1,5 +1,5 @@
11<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2−<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>
2+<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$$if(dir)$ dir="$dir$"$endif$>
33<head>
44 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55 <meta http-equiv="Content-Style-Type" content="text/css" />
default.latex+17
@@ -139,6 +139,23 @@ $endif$
139139$if(verbatim-in-note)$
140140\VerbatimFootnotes % allows verbatim text in footnotes
141141$endif$
142+$if(dir)$
143+\ifxetex
144+ % load bidi as late as possible as it modifies e.g. graphicx
145+ $if(latex-dir-rtl)$
146+ \usepackage[RTLdocument]{bidi}
147+ $else$
148+ \usepackage{bidi}
149+ $endif$
150+\fi
151+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
152+ \TeXXeTstate=1
153+ \newcommand{\RL}[1]{\beginR #1\endR}
154+ \newcommand{\LR}[1]{\beginL #1\endL}
155+ \newenvironment{RTL}{\beginR}{\endR}
156+ \newenvironment{LTR}{\beginL}{\endL}
157+\fi
158+$endif$
142159
143160$if(title)$
144161\title{$title$$if(subtitle)$\\\vspace{0.5em}{\large $subtitle$}$endif$}