summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi-atbegshi
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-09-11 22:46:18 +0000
committerKarl Berry <karl@freefriends.org>2014-09-11 22:46:18 +0000
commit9a1f73e0409aa1309fb6ac9b999e8eac07dd2dd0 (patch)
tree82227bd6b83b0cb1b7794378c5d58b5be66765d8 /Master/texmf-dist/tex/xelatex/bidi-atbegshi
parent66f4e61f437217d16e5bc69d2437fc2e8b2fea43 (diff)
bidi-atbegshi (11sep14)
git-svn-id: svn://tug.org/texlive/trunk@35154 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi-atbegshi')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty134
1 files changed, 134 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty b/Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty
new file mode 100644
index 00000000000..77b4fdd6d69
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty
@@ -0,0 +1,134 @@
+%%
+%% This is file `bidi-atbegshi.sty'.
+%%
+%% ___________________________________________
+%% Copyright © 2014 Vafa Khalighi <vafak@me.com>
+%%
+%% It may be distributed and/or modified under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is “author-maintained” (as per LPPL maintenance status)
+%% by Vafa Khalighi.
+%%
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bidi-atbegshi}[2014/09/11 v0.1 bidi-aware shipout macros]
+\RequirePackage{atbegshi}
+\newcommand*\LengthToUnit[1]{#1\@gobble}
+\newcommand*{\AtBegShi@bidi@horigin@left}{%
+ \if@RTL%
+ \dimexpr-\textwidth-\AtBegShi@horigin\relax
+ \else%
+ -\AtBegShi@horigin%
+ \fi%
+}
+\newcommand*{\AtBegShi@bidi@horigin@right}{%
+ \if@RTL%
+ \dimexpr\paperwidth-\textwidth-\AtBegShi@horigin\relax
+ \else%
+ \dimexpr\paperwidth-\AtBegShi@horigin\relax
+ \fi%
+}
+\newcommand*{\AtBegShi@bidi@vorigin@bottom}[1]{%
+ \dimexpr\paperheight-\AtBegShi@vorigin\relax
+}
+\renewcommand*{\AtBeginShipoutUpperLeft}[1]{%
+ \AtBeginShipoutAddToBox{%
+ \kern\AtBegShi@bidi@horigin@left\relax
+ \vbox to 0pt{%
+ \kern-\AtBegShi@vorigin\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+\renewcommand*{\AtBeginShipoutUpperLeftForeground}[1]{%
+ \AtBeginShipoutAddToBoxForeground{%
+ \kern\AtBegShi@bidi@horigin@left\relax
+ \vbox to 0pt{%
+ \kern-\AtBegShi@vorigin\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+\newcommand*{\AtBeginShipoutUpperRight}[1]{%
+ \AtBeginShipoutAddToBox{%
+ \kern\AtBegShi@bidi@horigin@right\relax
+ \vbox to 0pt{%
+ \kern-\AtBegShi@vorigin\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+\newcommand*{\AtBeginShipoutUpperRightForeground}[1]{%
+ \AtBeginShipoutAddToBoxForeground{%
+ \kern\AtBegShi@bidi@horigin@right\relax
+ \vbox to 0pt{%
+ \kern-\AtBegShi@vorigin\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+\newcommand*{\AtBeginShipoutLowerLeft}[1]{%
+ \AtBeginShipoutAddToBox{%
+ \kern\AtBegShi@bidi@horigin@left\relax
+ \vbox to 0pt{%
+ \kern\AtBegShi@bidi@vorigin@bottom\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+\newcommand*{\AtBeginShipoutLowerLeftForeground}[1]{%
+ \AtBeginShipoutAddToBoxForeground{%
+ \kern\AtBegShi@bidi@horigin@left\relax
+ \vbox to 0pt{%
+ \kern\AtBegShi@bidi@vorigin@bottom\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+\newcommand*{\AtBeginShipoutLowerRight}[1]{%
+ \AtBeginShipoutAddToBox{%
+ \kern\AtBegShi@bidi@horigin@right\relax
+ \vbox to 0pt{%
+ \kern\AtBegShi@bidi@vorigin@bottom\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+\newcommand*{\AtBeginShipoutLowerRightForeground}[1]{%
+ \AtBeginShipoutAddToBoxForeground{%
+ \kern\AtBegShi@bidi@horigin@right\relax
+ \vbox to 0pt{%
+ \kern\AtBegShi@bidi@vorigin@bottom\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
+ }%
+ }%
+}
+\endinput
+%%
+%% End of file `bidi-atbegshi.sty'. \ No newline at end of file