summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def11
1 files changed, 7 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def b/Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def
index d17729ca751..89a6c900316 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def
+++ b/Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def
@@ -17,7 +17,7 @@
%% by Vafa Khalighi.
%%
%%
-%% \CheckSum{47521}
+%% \CheckSum{47525}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -34,7 +34,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
-\ProvidesFile{listings-xetex-bidi.def}[2016/10/09 v1.1 bidi adaptations for listings package for XeTeX engine]
+\ProvidesFile{listings-xetex-bidi.def}[2016/10/11 v1.2 bidi adaptations for listings package for XeTeX engine]
\lst@Key{captiondirection}{textdirection}{%
\lstKV@SwitchCases{#1}%
{textdirection&\\%
@@ -83,6 +83,7 @@
\vskip\belowcaptionskip}%
\def\lst@makecaption{\@bidi@lst@makecaption}
\def\lst@maketitle{\@bidi@lst@makecaption\lst@title@dropdelim}
+\bidi@AtEndPreamble{%
\bidi@patchcmd{\lst@MakeCaption}{%
\ifx #1t%
\ifx\lst@@caption\@empty\expandafter\lst@HRefStepCounter \else
@@ -95,7 +96,7 @@
\expandafter\refstepcounter
\fi {lstlisting}%
\bidi@lst@ensure@caption@direction{\@RTLfalse}{\@RTLfalse}%
-}{}{}
+}{}{}%
\bidi@patchcmd{\lst@MakeCaption}{%
\addcontentsline{lol}{lstlisting}%
{\protect\numberline{\thelstlisting}\lst@@caption}%
@@ -105,8 +106,10 @@
\addcontentsline{lol}{lstlisting}%
{\protect\numberline{\thelstlisting}\lst@@caption}%
\endgroup%
-}{}{}
+}{}{}%
+}
\@ifpackageloaded{caption}{%
+ \let\@bidi@lst@makecaption\caption@makecaption%
\def\lst@makecaption{\caption@starfalse\@bidi@lst@makecaption}%
\def\lst@maketitle{\caption@startrue\@bidi@lst@makecaption\@empty}%
}{%