diff options
author | Karl Berry <karl@freefriends.org> | 2017-01-16 23:10:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-01-16 23:10:04 +0000 |
commit | bbdcfbc2b8f537da6c148a5e3cfc669664657baa (patch) | |
tree | b04062a030a6ed4ad8455a0aab8e5d3e68b8d074 /Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def | |
parent | f937c24995524ae21094db586f6469ea1b034c93 (diff) |
bidi (16jan17)
git-svn-id: svn://tug.org/texlive/trunk@42967 c570f23f-e606-0410-a88d-b1316a301751
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.def | 30 |
1 files changed, 15 insertions, 15 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 88afdd9e7e5..59c2a60db8b 100644 --- a/Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def +++ b/Master/texmf-dist/tex/xelatex/bidi/listings-xetex-bidi.def @@ -7,7 +7,7 @@ %% bidi.dtx (with options: `table,listings-xetex-bidi.def') %% %% __________________________________________________ -%% Copyright (c) 2009--2016 Vafa Khalighi <persian-tex@tug.org> +%% Copyright (c) 2009--2017 Vafa Khalighi <persian-tex@tug.org> %% %% It may be distributed and/or modified under the LaTeX Project Public License, %% version 1.3c or higher (your choice). The latest version of @@ -17,7 +17,7 @@ %% by Vafa Khalighi. %% %% -%% \CheckSum{47593} +%% \CheckSum{47651} %% \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/11/08 v1.3 bidi adaptations for listings package for XeTeX engine] +\ProvidesFile{listings-xetex-bidi.def}[2017/01/14 v1.4 bidi adaptations for listings package for XeTeX engine] \lst@Key{captiondirection}{textdirection}{% \lstKV@SwitchCases{#1}% {textdirection&\\% @@ -42,9 +42,9 @@ LTR&\chardef\bidi@lst@caption@direction\z@% }{\PackageError{Listings}{direction #1 unknown}\@ehc}} -\lst@Key{captionscript}{latin}{% +\lst@Key{captionscript}{textscript}{% \lstKV@SwitchCases{#1}% - {% + {textscript&\\% latin&\chardef\bidi@lst@caption@script\@ne\\% nonlatin&\chardef\bidi@lst@caption@script\z@% }{\PackageError{Listings}{direction #1 unknown}\@ehc}} @@ -59,14 +59,20 @@ \fi% \fi% }} -\long\def\@bidi@lst@makecaption#1#2{% + +\newcommand*{\bidi@lst@ensure@caption@script}[2]{% + \@ifundefined{bidi@lst@caption@script}{}{% \ifnum\bidi@lst@caption@script=\z@% - \@nonlatintrue% + #1% \else% \ifnum\bidi@lst@caption@script=\@ne% - \@nonlatinfalse% + #2% \fi% \fi% +}} + +\long\def\@bidi@lst@makecaption#1#2{% + \bidi@lst@ensure@caption@script{\@nonlatintrue}{\@nonlatinfalse}% \vskip\abovecaptionskip \bidi@lst@ensure@caption@direction{\@RTLfalse}{\@RTLtrue}% \sbox\@tempboxa{% @@ -110,13 +116,7 @@ } \@ifpackageloaded{caption}{% \AtBeginCaption{% - \ifnum\bidi@lst@caption@script=\z@% - \@nonlatintrue% - \else% - \ifnum\bidi@lst@caption@script=\@ne% - \@nonlatinfalse% - \fi% - \fi% + \bidi@lst@ensure@caption@script{\@nonlatintrue}{\@nonlatinfalse}% \bidi@lst@ensure@caption@direction{\@RTLfalse}{\@RTLtrue}% } \let\@bidi@lst@makecaption\caption@makecaption% |