From 9a1f73e0409aa1309fb6ac9b999e8eac07dd2dd0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 11 Sep 2014 22:46:18 +0000 Subject: bidi-atbegshi (11sep14) git-svn-id: svn://tug.org/texlive/trunk@35154 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/xelatex/bidi-atbegshi/README | 30 +++++ .../xelatex/bidi-atbegshi/bidi-atbegshi-doc.pdf | Bin 0 -> 24475 bytes .../xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex | 59 +++++++++ .../doc/xelatex/bidi-atbegshi/test-LTR.pdf | Bin 0 -> 11292 bytes .../doc/xelatex/bidi-atbegshi/test-LTR.tex | 25 ++++ .../doc/xelatex/bidi-atbegshi/test-RTL.pdf | Bin 0 -> 11299 bytes .../doc/xelatex/bidi-atbegshi/test-RTL.tex | 25 ++++ .../xelatex/bidi-atbegshi/test-foreground-LTR.pdf | Bin 0 -> 11289 bytes .../xelatex/bidi-atbegshi/test-foreground-LTR.tex | 25 ++++ .../xelatex/bidi-atbegshi/test-foreground-RTL.pdf | Bin 0 -> 11314 bytes .../xelatex/bidi-atbegshi/test-foreground-RTL.tex | 25 ++++ .../tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty | 134 +++++++++++++++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/bidi-atbegshi.tlpsrc | 0 Master/tlpkg/tlpsrc/collection-xetex.tlpsrc | 1 + 15 files changed, 325 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/README create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.pdf create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.pdf create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.tex create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.pdf create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.tex create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.pdf create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.tex create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.pdf create mode 100644 Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.tex create mode 100644 Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty create mode 100644 Master/tlpkg/tlpsrc/bidi-atbegshi.tlpsrc diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/README b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/README new file mode 100644 index 00000000000..cda7c69bf7e --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/README @@ -0,0 +1,30 @@ +_____________________ +The bidi-atbegshi package +v0.1 + +Bidi-aware shipout macros + +The package adds few commands to `atbegshi' package +for proper placement of in the left +and right corners of the output page, in both LTR and RTL +modes. + +The package only works with `xelatex' format and should be +loaded before `bidi' package. + +For more information, please see the documentation. + + +Current version release date: 2014/09/11 + +___________________ +Vafa Khalighi +tex.ctan@gmail.com + +Copyright © 2014 +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. diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.pdf b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.pdf new file mode 100644 index 00000000000..5e68bec300d Binary files /dev/null and b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.pdf differ diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex new file mode 100644 index 00000000000..9d9276048c3 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex @@ -0,0 +1,59 @@ +\documentclass{ltxdoc} +\usepackage{holtxdoc} +\begin{document} +\title{The \xpackage{bidi-atbegshi} Package} +\author{Vafa Khalighi\\\xemail{tex.ctan@gmail.com}} +\maketitle +The \xpackage{bidi-atbegshi} adds bidi support to package \xpackage{atbegshi}; it modifies the \cs{AtBeginShipoutUpperLeft}, and \cs{AtBeginShipoutUpperLeftForeground} so that they properly both in LTR and RTL modes. In addition, it also defines the following commands: + +\begin{declcs}{AtBeginShipoutUpperRight} \M{background material} +\end{declcs} + This is a macro that puts material in the background of + box \cs{AtBeginShipoutBox}. + The \meta{background material} is set in an \cs{hbox}, the + reference point is the upper right corner of the output page. + + + The macro \cs{AtBeginShipoutUpperRight} is intended to be used + in one of the hook setting macros, such as + \cs{AtBeginShipout}, \cs{AtBeginShipoutFirst}, or + \cs{AtBeginShipoutNext}. + + The \meta{background material} is set + inside a \texttt{picture} environment: + \begin{quote} + |\begin{picture}(0,0)|\\ + \mbox{}\quad |\setlength{\unitlength}{1pt}%|\\ + \mbox{}\quad \meta{background material}\\ + |\end{picture}| + \end{quote} + +\begin{declcs}{AtBeginShipoutLowerLeft} \M{background material} +\end{declcs} +Similar to the \cs{AtBeginShipoutUpperRight} command but + the reference point is the lower left corner of the output page. + +\begin{declcs}{AtBeginShipoutLowerRight} \M{background material} +\end{declcs} +Similar to the \cs{AtBeginShipoutUpperRight} command but + the reference point is the lower right corner of the output page. + + \begin{declcs}{AtBeginShipoutUpperRightForeground} \M{foreground material} + \end{declcs} + See \cs{AtBeginShipoutUpperRight}. The difference is that the material + is put in the foreground. + + \begin{declcs}{AtBeginShipoutLowerLeftForeground} \M{foreground material} + \end{declcs} + See \cs{AtBeginShipoutLowerLeft}. The difference is that the material + is put in the foreground. + + \begin{declcs}{AtBeginShipoutLowerRightForeground} \M{foreground material} + \end{declcs} + See \cs{AtBeginShipoutLowerRight}. The difference is that the material + is put in the foreground. + + \begin{declcs}{LengthToUnit} \M{length with units} + \end{declcs} + For instance, \cs{LengthToUnit}\texttt{\{12pt\}} converts 12pt to 12 (stripping the unit). +\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.pdf b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.pdf new file mode 100644 index 00000000000..90db634619e Binary files /dev/null and b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.pdf differ diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.tex b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.tex new file mode 100644 index 00000000000..e64e6015871 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.tex @@ -0,0 +1,25 @@ +\documentclass{article} +\usepackage{lipsum} +\usepackage{bidi-atbegshi} +\usepackage{bidi} +\setbox0\hbox{\Huge\textbf{Upper Left}} +\setbox1\hbox{\Huge\textbf{Upper Right}} +\setbox2\hbox{\Huge\textbf{Lower Left}} +\setbox3\hbox{\Huge\textbf{Lower Right}} +\AtBeginShipout{% +\AtBeginShipoutUpperLeft{% +\put(0,\LengthToUnit{-\ht0}){\usebox0} +} +\AtBeginShipoutUpperRight{% +\put(\LengthToUnit{-\wd1},\LengthToUnit{-\ht1}){\usebox1} +} +\AtBeginShipoutLowerLeft{% +\put(0,\LengthToUnit{\dp2}){\usebox2} +} +\AtBeginShipoutLowerRight{% +\put(\LengthToUnit{-\wd3},\LengthToUnit{\dp3}){\usebox3} +} +} +\begin{document} +\lipsum +\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.pdf b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.pdf new file mode 100644 index 00000000000..90f2ac5d18e Binary files /dev/null and b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.pdf differ diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.tex b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.tex new file mode 100644 index 00000000000..a4d416176b1 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.tex @@ -0,0 +1,25 @@ +\documentclass{article} +\usepackage{lipsum} +\usepackage{bidi-atbegshi} +\usepackage[RTLdocument]{bidi} +\setbox0\hbox{\Huge\textbf{Upper Left}} +\setbox1\hbox{\Huge\textbf{Upper Right}} +\setbox2\hbox{\Huge\textbf{Lower Left}} +\setbox3\hbox{\Huge\textbf{Lower Right}} +\AtBeginShipout{% +\AtBeginShipoutUpperRight{% +\put(0,\LengthToUnit{-\ht1}){\usebox1} +}% +\AtBeginShipoutUpperLeft{% +\put(\LengthToUnit{-\wd0},\LengthToUnit{-\ht0}){\usebox0} +}% +\AtBeginShipoutLowerRight{% +\put(0,\LengthToUnit{\dp3}){\usebox3} +}% +\AtBeginShipoutLowerLeft{% +\put(\LengthToUnit{-\wd2},\LengthToUnit{\dp2}){\usebox2} +}% +} +\begin{document} +\lipsum +\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.pdf b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.pdf new file mode 100644 index 00000000000..6aa0cb81cd7 Binary files /dev/null and b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.pdf differ diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.tex b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.tex new file mode 100644 index 00000000000..5b4953b2f58 --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.tex @@ -0,0 +1,25 @@ +\documentclass{article} +\usepackage{lipsum} +\usepackage{bidi-atbegshi} +\usepackage{bidi} +\setbox0\hbox{\Huge\textbf{Upper Left}} +\setbox1\hbox{\Huge\textbf{Upper Right}} +\setbox2\hbox{\Huge\textbf{Lower Left}} +\setbox3\hbox{\Huge\textbf{Lower Right}} +\AtBeginShipout{% +\AtBeginShipoutUpperLeftForeground{% +\put(0,\LengthToUnit{-\ht0}){\usebox0} +} +\AtBeginShipoutUpperRightForeground{% +\put(\LengthToUnit{-\wd1},\LengthToUnit{-\ht1}){\usebox1} +} +\AtBeginShipoutLowerLeftForeground{% +\put(0,\LengthToUnit{\dp2}){\usebox2} +} +\AtBeginShipoutLowerRightForeground{% +\put(\LengthToUnit{-\wd3},\LengthToUnit{\dp3}){\usebox3} +} +} +\begin{document} +\lipsum +\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.pdf b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.pdf new file mode 100644 index 00000000000..59ac82e4207 Binary files /dev/null and b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.pdf differ diff --git a/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.tex b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.tex new file mode 100644 index 00000000000..4a8d9d3597d --- /dev/null +++ b/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.tex @@ -0,0 +1,25 @@ +\documentclass{article} +\usepackage{lipsum} +\usepackage{bidi-atbegshi} +\usepackage[RTLdocument]{bidi} +\setbox0\hbox{\Huge\textbf{Upper Left}} +\setbox1\hbox{\Huge\textbf{Upper Right}} +\setbox2\hbox{\Huge\textbf{Lower Left}} +\setbox3\hbox{\Huge\textbf{Lower Right}} +\AtBeginShipout{% +\AtBeginShipoutUpperRightForeground{% +\put(0,\LengthToUnit{-\ht1}){\usebox1} +}% +\AtBeginShipoutUpperLeftForeground{% +\put(\LengthToUnit{-\wd0},\LengthToUnit{-\ht0}){\usebox0} +}% +\AtBeginShipoutLowerRightForeground{% +\put(0,\LengthToUnit{\dp3}){\usebox3} +}% +\AtBeginShipoutLowerLeftForeground{% +\put(\LengthToUnit{-\wd2},\LengthToUnit{\dp2}){\usebox2} +}% +} +\begin{document} +\lipsum +\end{document} \ No newline at end of file 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 +%% +%% 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 diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index e22f409eb5c..7fae560d938 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -89,7 +89,7 @@ my @TLP_working = qw( bibleref-parse biblist bibtex bibtopic bibtopicprefix bibexport bibunits - bidi bidicontour bidipagegrid bidishadowtext + bidi bidi-atbegshi bidicontour bidipagegrid bidishadowtext bigfoot bigints binomexp biocon bitelist bizcard blacklettert1 blindtext blkarray block blockdraw_mp bloques blowup blox bodegraph bohr boisik bold-extra diff --git a/Master/tlpkg/tlpsrc/bidi-atbegshi.tlpsrc b/Master/tlpkg/tlpsrc/bidi-atbegshi.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc b/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc index d0931552357..90455eabe88 100644 --- a/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-xetex.tlpsrc @@ -6,6 +6,7 @@ longdesc http://tug.org/xetex. depend collection-basic # depend arabxetex +depend bidi-atbegshi depend bidicontour depend bidipagegrid depend bidishadowtext -- cgit v1.2.3