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.def20
1 files changed, 18 insertions, 2 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 6704cf09fb2..293443573e0 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{43241}
+%% \CheckSum{43266}
%% \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}[2014/07/19 v0.6 bidi adaptations for listings package for XeTeX engine]
+\ProvidesFile{listings-xetex-bidi.def}[2015/02/01 v0.7 bidi adaptations for listings package for XeTeX engine]
\lst@Key{captiondirection}{textdirection}{%
\lstKV@SwitchCases{#1}%
{textdirection&\\%
@@ -68,6 +68,22 @@
\vskip\belowcaptionskip}%
\def\lst@makecaption{\@bidi@lst@makecaption}
\def\lst@maketitle{\@bidi@lst@makecaption\lst@title@dropdelim}
+\bidi@patchcmd{\lst@MakeCaption}{%
+ \addcontentsline{lol}{lstlisting}%
+ {\protect\numberline{\thelstlisting}\lst@@caption}%
+}{%
+\begingroup%
+\ifnum\bidi@lst@caption@direction=\z@%
+ \@RTLfalse%
+\else%
+ \ifnum\bidi@lst@caption@direction=\@ne%
+ \@RTLtrue%
+ \fi%
+\fi%
+ \addcontentsline{lol}{lstlisting}%
+ {\protect\numberline{\thelstlisting}\lst@@caption}%
+\endgroup%
+}{}{}
\AtBeginDocument{%
\@ifundefined{captionlabelfalse}{}{%
\def\lst@maketitle{\captionlabelfalse\@bidi@lst@makecaption\@empty}}%