Skip to content

Commit

Permalink
FIX #232: bidi is loaded too late
Browse files Browse the repository at this point in the history
* move caption and mdframed packages before bidi
* comment the second load of polyglossia
* test case for the bidi (right-to-left) bug
  • Loading branch information
daamien committed Mar 2, 2021
1 parent ad404d0 commit 52f8f21
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
36 changes: 29 additions & 7 deletions eisvogel.tex
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,28 @@
\ifluatex
\usepackage{selnolig} % disable illegal ligatures
\fi
%
% captions
% caption must be loaded before bidi
%
\definecolor{caption-color}{HTML}{777777}
$if(beamer)$
$else$
\usepackage[font={stretch=1.2}, textfont={color=caption-color}, position=top, skip=4mm, labelfont=bf, singlelinecheck=false, justification=$if(caption-justification)$$caption-justification$$else$raggedright$endif$]{caption}
\setcapindent{0em}
$endif$

%
% blockquote
% mdframed must be loaded before bidi
%
\definecolor{blockquote-border}{RGB}{221,221,221}
\definecolor{blockquote-text}{RGB}{119,119,119}
\usepackage{mdframed}
\newmdenv[rightline=false,bottomline=false,topline=false,linewidth=3pt,linecolor=blockquote-border,skipabove=\parskip]{customblockquote}
\renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}%
\item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}}

$if(dir)$
\ifxetex
% Load bidi as late as possible as it modifies e.g. graphicx
Expand Down Expand Up @@ -554,8 +576,8 @@
\renewcommand*\familydefault{\sfdefault}
$endif$
% load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
\usepackage{polyglossia}
\setmainlanguage[]{english}
%%%\usepackage{polyglossia}
%%%\setmainlanguage[]{english}
$for(polyglossia-otherlangs)$
\setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
$endfor$
Expand Down Expand Up @@ -598,7 +620,7 @@
\definecolor{caption-color}{HTML}{777777}
$if(beamer)$
$else$
\usepackage[font={stretch=1.2}, textfont={color=caption-color}, position=top, skip=4mm, labelfont=bf, singlelinecheck=false, justification=$if(caption-justification)$$caption-justification$$else$raggedright$endif$]{caption}
%%\usepackage[font={stretch=1.2}, textfont={color=caption-color}, position=top, skip=4mm, labelfont=bf, singlelinecheck=false, justification=$if(caption-justification)$$caption-justification$$else$raggedright$endif$]{caption}
\setcapindent{0em}
$endif$

Expand All @@ -607,10 +629,10 @@
%
\definecolor{blockquote-border}{RGB}{221,221,221}
\definecolor{blockquote-text}{RGB}{119,119,119}
\usepackage{mdframed}
\newmdenv[rightline=false,bottomline=false,topline=false,linewidth=3pt,linecolor=blockquote-border,skipabove=\parskip]{customblockquote}
\renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}%
\item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}}
%%\usepackage{mdframed}
%%\newmdenv[rightline=false,bottomline=false,topline=false,linewidth=3pt,linecolor=blockquote-border,skipabove=\parskip]{customblockquote}
%%\renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}%
%%\item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}}

%
% Source Sans Pro as the de­fault font fam­ily
Expand Down
1 change: 1 addition & 0 deletions examples/language-persian/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pandoc "document.md" -o "document.pdf" --from markdown --template "../../eisvogel.tex" --listings
8 changes: 8 additions & 0 deletions examples/language-persian/document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
mainfont: 'Nazli'
---
<div dir="rtl" markdown="1">

انقلاب‌های فناورانه می

</div>
Binary file added examples/language-persian/document.pdf
Binary file not shown.

0 comments on commit 52f8f21

Please sign in to comment.