diff options
author | Karl Berry <karl@freefriends.org> | 2010-01-11 18:46:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-01-11 18:46:44 +0000 |
commit | b2653703ac55bf05f550a80ffa1fe05c5fe8bd47 (patch) | |
tree | f1134c0157d1fefadb188b15f095c13674484ea9 /Master/texmf-dist/tex/xelatex/bidi/bidicode.sty | |
parent | 47bbbc330ace9242ab5ee3af16c08d19a1496ac6 (diff) |
bidi update (6jan10)
git-svn-id: svn://tug.org/texlive/trunk@16674 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/bidicode.sty')
-rw-r--r-- | Master/texmf-dist/tex/xelatex/bidi/bidicode.sty | 116 |
1 files changed, 76 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/bidicode.sty b/Master/texmf-dist/tex/xelatex/bidi/bidicode.sty index 9a328e1bb99..7a8dd0b3768 100644 --- a/Master/texmf-dist/tex/xelatex/bidi/bidicode.sty +++ b/Master/texmf-dist/tex/xelatex/bidi/bidicode.sty @@ -1,21 +1,16 @@ %% %% This is file `bidicode.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% bidi.dtx (with options: `bidicode.sty') + %% %% __________________________________ -%% Copyright © 2009 Vafa Khalighi +%% Copyright © 2009-2010 Vafa Khalighi %% %% License information appended. %% %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{bidicode} -\RequirePackage{pstricks} -\RequirePackage{fvrb-ex} +\RequirePackage{xcolor} \RequirePackage{showexpl} \definecolor{Orange}{rgb}{1,.4,.2} \definecolor{myblue}{rgb}{0.02,0.04,0.48} @@ -31,36 +26,78 @@ \lstset{% language=[LaTeX]TEX,% float=hbp,% - basicstyle=\ttfamily\small, % + basicstyle=\ttfamily, % identifierstyle=\color{black}, % - keywordstyle=\color{myred}, % + keywordstyle=\color{mygreen}, % stringstyle=\color{blue}, % commentstyle=\color{blue}, % columns=flexible, % - tabsize=4, % - frame=single, % extendedchars=true, % showspaces=false, % showstringspaces=false, % - numbers=left, - numbersep=12pt, - numberstyle=\tiny, % breaklines=true, % breakautoindent=true, - captionpos=b, - xleftmargin=1em, - breaklines=true, - backgroundcolor=\color{mybackground}, - breakautoindent=true, - rframe={}, - explpreset={numbers=left,numberstyle=\tiny,numbersep=12pt, - xleftmargin=1em,columns=flexible,language=[LaTeX]TEX}, + captionpos=t, + explpreset={columns=flexible,language=[LaTeX]TEX}, morekeywords={setLTR,setLR,setRTL,setRL,LRE,LR,RLE,RL,lr} } -\lstdefinestyle{syntax}{backgroundcolor=\color{blue!20},numbers=none,xleftmargin=0pt,xrightmargin=0pt, - frame=single} -\lstdefinestyle{code}{backgroundcolor=\color{red!20},numbers=left,xleftmargin=0pt,xrightmargin=0pt, - frame=single} +\lstdefinestyle{syntax}{backgroundcolor=\color{blue!20}} +\lstdefinestyle{code}{backgroundcolor=\color{red!20}} +\lst@UserCommand\lstlistlistingname{List of Examples} % \lstlistoflistings +\lst@UserCommand\lstlistingname{Example} + +\def\lst@Init#1{% + \begingroup\if@RTL\@RTLfalse\fi + \ifx\lst@float\relax\else + \edef\@tempa{\noexpand\lst@beginfloat{lstlisting}[\lst@float]}% + \expandafter\@tempa + \fi + \ifx\lst@multicols\@empty\else + \edef\lst@next{\noexpand\multicols{\lst@multicols}} + \expandafter\lst@next + \fi + \ifhmode\ifinner \lst@boxtrue \fi\fi + \lst@ifbox + \lsthk@BoxUnsafe + \hbox to\z@\bgroup + $\if t\lst@boxpos \vtop + \else \if b\lst@boxpos \vbox + \else \vcenter \fi\fi + \bgroup \par\noindent + \else + \lst@ifdisplaystyle + \lst@EveryDisplay + \par\penalty-50\relax + \vspace\lst@aboveskip + \fi + \fi + \normalbaselines + \abovecaptionskip\lst@abovecaption\relax + \belowcaptionskip\lst@belowcaption\relax + \lst@MakeCaption t% + \lsthk@PreInit \lsthk@Init + \lst@ifdisplaystyle + \global\let\lst@ltxlabel\@empty + \if@inlabel + \lst@ifresetmargins + \leavevmode + \else + \xdef\lst@ltxlabel{\the\everypar}% + \lst@AddTo\lst@ltxlabel{% + \global\let\lst@ltxlabel\@empty + \everypar{\lsthk@EveryLine\lsthk@EveryPar}}% + \fi + \fi + \everypar\expandafter{\lst@ltxlabel + \lsthk@EveryLine\lsthk@EveryPar}% + \else + \everypar{}\let\lst@NewLine\@empty + \fi + \lsthk@InitVars \lsthk@InitVarsBOL + \lst@Let{13}\lst@MProcessListing + \let\lst@Backslash#1% + \lst@EnterMode{\lst@Pmode}{\lst@SelectCharTable}% + \lst@InitFinalize} \newcommand\Larg [1]{{\normalfont\itshape#1\/}} \newcommand\Larga[1]{$\langle$\Larg{#1}$\rangle$} @@ -70,9 +107,9 @@ \newcommand\LBEG[1]{{\normalfont\ttfamily\bs{}begin\lcb#1\rcb}} \newcommand\LEND[1]{{\normalfont\ttfamily\bs{}end\lcb#1\rcb}} -\DeclareRobustCommand\bs{{\normalfont\ttfamily\textbackslash}} -\DeclareRobustCommand\lcb{{\normalfont\ttfamily\textbraceleft}} -\DeclareRobustCommand\rcb{{\normalfont\ttfamily\textbraceright}} +\DeclareRobustCommand\bs{{\normalfont\ttfamily\symbol{92}}} +\DeclareRobustCommand\lcb{{\normalfont\ttfamily\char`\{}} +\DeclareRobustCommand\rcb{{\normalfont\ttfamily\char`\}}} \DeclareRobustCommand\lsb{{\normalfont\ttfamily[}} \DeclareRobustCommand\rsb{{\normalfont\ttfamily]}} \DeclareRobustCommand\lrb{{\normalfont\ttfamily(}} @@ -80,7 +117,7 @@ \def\Lcs#1{\nxLcs{#1}} \def\LcsStar#1{\nxLcs{#1}\OptArg*{*}} -\def\nxLcs#1{\texttt{\textbackslash#1}} +\def\nxLcs#1{\texttt{\symbol{92}#1}} \def\Coordx#1{$x_{#1}$} \def\Coordy#1{$y_{#1}$} @@ -102,7 +139,7 @@ \newsavebox{\boxdef} \newenvironment{BDef} {\begin{lrbox}\boxdef - \def\arraystretch{1.0} + \def\arraystretch{1.0}\if@RTL\@RTLfalse\fi \begin{tabular}{@{}l@{}l@{}l@{}} } {\end{tabular}\end{lrbox} @@ -113,7 +150,7 @@ \newenvironment{BDef*} {\begin{lrbox}\boxdef - \def\arraystretch{1.0} + \def\arraystretch{1.0}\if@RTL\@RTLfalse\fi \begin{tabular}{@{}l@{}l@{}l@{}} } {\end{tabular}\end{lrbox} @@ -124,7 +161,7 @@ \@beginparpenalty-\@lowpenalty \topsep\BDefaboveskip \fboxsep3pt - \flushleft} + \flushleft\if@RTL\@RTLfalse\fi} {\@endparpenalty\@M \@topsepadd\BDefbelowskip \endflushleft} @@ -133,7 +170,7 @@ \@beginparpenalty\@M \topsep\BDefinlineskip \fboxsep3pt - \flushleft} + \flushleft\if@RTL\@RTLfalse\fi} {\@endparpenalty5000 \endflushleft} @@ -144,13 +181,12 @@ \setlength\BDefbelowskip{6pt} \setlength\BDefinlineskip{6pt} -\def\OptArgs{\psframebox[framesep=2pt,fillstyle=solid,fillcolor=black!20,linecolor=black!20]{\texttt{[Options]}}\kern1pt} +\def\OptArgs{\colorbox{black!20}{\texttt{[Options]}}\kern1pt} \def\OptArg{\@ifnextchar*\OptArg@i{\OptArg@ii*}} -\def\OptArg@i*#1{\psframebox[framesep=2pt,fillstyle=solid,fillcolor=black!20,linecolor=black!20]{\texttt{#1}}\kern1pt} -\def\OptArg@ii*#1{\psframebox[framesep=2pt,fillstyle=solid,fillcolor=black!20,linecolor=black!20]{\texttt{[#1]}}\kern1pt} - +\def\OptArg@i*#1{\colorbox{black!20}{\texttt{#1}}\kern1pt} +\def\OptArg@ii*#1{\colorbox{black!20}{\texttt{[#1]}}\kern1pt} %% -%% Copyright © 2009 by Vafa Khalighi <vafa@users.berlios.de> +%% Copyright © 2009-2010 by Vafa Khalighi <vafa@users.berlios.de> %% %% Distributable under the LaTeX Project Public License, %% version 1.3c or higher (your choice). The latest version of |