texlive[62009] Master/texmf-dist: bidi-atbegshi (13feb22)
commits+karl at tug.org
commits+karl at tug.org
Sun Feb 13 22:27:34 CET 2022
Revision: 62009
http://tug.org/svn/texlive?view=revision&revision=62009
Author: karl
Date: 2022-02-13 22:27:34 +0100 (Sun, 13 Feb 2022)
Log Message:
-----------
bidi-atbegshi (13feb22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/README
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.pdf
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.pdf
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.tex
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.pdf
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.tex
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.pdf
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.tex
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.pdf
trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.tex
trunk/Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/README
===================================================================
--- trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/README 2022-02-13 21:27:21 UTC (rev 62008)
+++ trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/README 2022-02-13 21:27:34 UTC (rev 62009)
@@ -1,27 +1,24 @@
_____________________
The bidi-atbegshi package
-v0.1
+v0.2
Bidi-aware shipout macros
-The package adds few commands to `atbegshi' package
+The package adds few commands to `atbegshi-ltx' package
for proper placement of <background material> 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
+Current version release date: 2022/02/14
___________________
Vafa Khalighi
-tex.ctan at gmail.com
+tex-persian at vafa.ac
-Copyright © 2014
+Copyright © 2014--2022
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
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex 2022-02-13 21:27:21 UTC (rev 62008)
+++ trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/bidi-atbegshi-doc.tex 2022-02-13 21:27:34 UTC (rev 62009)
@@ -2,9 +2,9 @@
\usepackage{holtxdoc}
\begin{document}
\title{The \xpackage{bidi-atbegshi} Package}
-\author{Vafa Khalighi\\\xemail{tex.ctan at gmail.com}}
+\author{Vafa Khalighi\\\xemail{tex-persian at vafa.ac}}
\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:
+The \xpackage{bidi-atbegshi} adds bidi support to package \xpackage{atbegshi-ltx}; it defines the following commands:
\begin{declcs}{AtBeginShipoutUpperRight} \M{background material}
\end{declcs}
@@ -52,8 +52,4 @@
\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
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.tex
===================================================================
--- trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.tex 2022-02-13 21:27:21 UTC (rev 62008)
+++ trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-LTR.tex 2022-02-13 21:27:34 UTC (rev 62009)
@@ -8,16 +8,16 @@
\setbox3\hbox{\Huge\textbf{Lower Right}}
\AtBeginShipout{%
\AtBeginShipoutUpperLeft{%
-\put(0,\LengthToUnit{-\ht0}){\usebox0}
+\put(0,-\ht0){\usebox0}
}
\AtBeginShipoutUpperRight{%
-\put(\LengthToUnit{-\wd1},\LengthToUnit{-\ht1}){\usebox1}
+\put(-\wd1,-\ht1){\usebox1}
}
\AtBeginShipoutLowerLeft{%
-\put(0,\LengthToUnit{\dp2}){\usebox2}
+\put(0,\dp2){\usebox2}
}
\AtBeginShipoutLowerRight{%
-\put(\LengthToUnit{-\wd3},\LengthToUnit{\dp3}){\usebox3}
+\put(-\wd3,\dp3){\usebox3}
}
}
\begin{document}
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.tex
===================================================================
--- trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.tex 2022-02-13 21:27:21 UTC (rev 62008)
+++ trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-RTL.tex 2022-02-13 21:27:34 UTC (rev 62009)
@@ -1,25 +1,26 @@
\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}}
+\usepackage{ptext}
+\usepackage{xepersian}
+\settextfont{IRXLotus}
+\setbox0\hboxR{\Huge\textbf{چپ بالا}}
+\setbox1\hboxR{\Huge\textbf{راست بالا}}
+\setbox2\hboxR{\Huge\textbf{چپ پایین}}
+\setbox3\hboxR{\Huge\textbf{راست پایین}}
\AtBeginShipout{%
\AtBeginShipoutUpperRight{%
-\put(0,\LengthToUnit{-\ht1}){\usebox1}
+\put(-\wd1,-\ht1){\usebox1}
}%
\AtBeginShipoutUpperLeft{%
-\put(\LengthToUnit{-\wd0},\LengthToUnit{-\ht0}){\usebox0}
+\put(0,-\ht0){\usebox0}
}%
\AtBeginShipoutLowerRight{%
-\put(0,\LengthToUnit{\dp3}){\usebox3}
+\put(-\wd3,\dp3){\usebox3}
}%
\AtBeginShipoutLowerLeft{%
-\put(\LengthToUnit{-\wd2},\LengthToUnit{\dp2}){\usebox2}
+\put(0,\dp2){\usebox2}
}%
}
\begin{document}
-\lipsum
+\ptext
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.tex
===================================================================
--- trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.tex 2022-02-13 21:27:21 UTC (rev 62008)
+++ trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-LTR.tex 2022-02-13 21:27:34 UTC (rev 62009)
@@ -8,16 +8,16 @@
\setbox3\hbox{\Huge\textbf{Lower Right}}
\AtBeginShipout{%
\AtBeginShipoutUpperLeftForeground{%
-\put(0,\LengthToUnit{-\ht0}){\usebox0}
+\put(0,-\ht0){\usebox0}
}
\AtBeginShipoutUpperRightForeground{%
-\put(\LengthToUnit{-\wd1},\LengthToUnit{-\ht1}){\usebox1}
+\put(-\wd1,-\ht1){\usebox1}
}
\AtBeginShipoutLowerLeftForeground{%
-\put(0,\LengthToUnit{\dp2}){\usebox2}
+\put(0,\dp2){\usebox2}
}
\AtBeginShipoutLowerRightForeground{%
-\put(\LengthToUnit{-\wd3},\LengthToUnit{\dp3}){\usebox3}
+\put(-\wd3,\dp3){\usebox3}
}
}
\begin{document}
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.tex
===================================================================
--- trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.tex 2022-02-13 21:27:21 UTC (rev 62008)
+++ trunk/Master/texmf-dist/doc/xelatex/bidi-atbegshi/test-foreground-RTL.tex 2022-02-13 21:27:34 UTC (rev 62009)
@@ -1,25 +1,26 @@
\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}}
+\usepackage{ptext}
+\usepackage{xepersian}
+\settextfont{IRXLotus}
+\setbox0\hboxR{\Huge\textbf{چپ بالا}}
+\setbox1\hboxR{\Huge\textbf{راست بالا}}
+\setbox2\hboxR{\Huge\textbf{چپ پایین}}
+\setbox3\hboxR{\Huge\textbf{راست پایین}}
\AtBeginShipout{%
\AtBeginShipoutUpperRightForeground{%
-\put(0,\LengthToUnit{-\ht1}){\usebox1}
+\put(-\wd1,-\ht1){\box1}
}%
\AtBeginShipoutUpperLeftForeground{%
-\put(\LengthToUnit{-\wd0},\LengthToUnit{-\ht0}){\usebox0}
+\put(0,-\ht0){\usebox0}
}%
\AtBeginShipoutLowerRightForeground{%
-\put(0,\LengthToUnit{\dp3}){\usebox3}
+\put(-\wd3,\dp3){\usebox3}
}%
\AtBeginShipoutLowerLeftForeground{%
-\put(\LengthToUnit{-\wd2},\LengthToUnit{\dp2}){\usebox2}
+\put(0,\dp2){\usebox2}
}%
}
\begin{document}
-\lipsum
+\ptext
\end{document}
\ No newline at end of file
Modified: trunk/Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty
===================================================================
--- trunk/Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty 2022-02-13 21:27:21 UTC (rev 62008)
+++ trunk/Master/texmf-dist/tex/xelatex/bidi-atbegshi/bidi-atbegshi.sty 2022-02-13 21:27:34 UTC (rev 62009)
@@ -2,7 +2,7 @@
%% This is file `bidi-atbegshi.sty'.
%%
%% ___________________________________________
-%% Copyright © 2014 Vafa Khalighi <vafak at me.com>
+%% Copyright © 2014--2022 Vafa Khalighi <tex-persian at vafa.ac>
%%
%% It may be distributed and/or modified under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
@@ -13,122 +13,82 @@
%%
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bidi-atbegshi}[2014/09/11 v0.1 bidi-aware shipout macros]
-\RequirePackage{atbegshi}
-\newcommand*\LengthToUnit[1]{#1\@gobble}
-\newcommand*{\AtBegShi at bidi@horigin at left}{%
- \if at RTL%
- \dimexpr-\textwidth-\AtBegShi at horigin\relax
- \else%
- -\AtBegShi at horigin%
- \fi%
+\ProvidesPackage{bidi-atbegshi}[2022/02/14 v0.2 bidi-aware shipout macros]
+\RequirePackage{atbegshi-ltx}
+\ExplSyntaxOn
+\cs_new:Npn \__shipout_picture_overlay_lower_left:n #1 {
+ \__shipout_init_page_origins:
+ \kern -\c__shipout_horigin_tl \scan_stop:
+ \vbox_to_zero:n {
+ \kern \__dim_eval:w \paperheight - \c__shipout_vorigin_tl \scan_stop:
+ \unitlength 1pt \scan_stop:
+ \hbox_set_to_wd:Nnn \l__shipout_tmp_box \c_zero_dim
+ { \ignorespaces #1 \hss }
+ \box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim
+ \box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim
+ \box_use:N \l__shipout_tmp_box
+ \tex_vss:D
+ }
}
-\newcommand*{\AtBegShi at bidi@horigin at right}{%
- \if at RTL%
- \dimexpr\paperwidth-\textwidth-\AtBegShi at horigin\relax
- \else%
- \dimexpr\paperwidth-\AtBegShi at horigin\relax
- \fi%
+\cs_new:Npn \__shipout_picture_overlay_upper_right:n #1 {
+ \__shipout_init_page_origins:
+ \kern \__dim_eval:w \c__shipout_horigin_tl + \oddsidemargin + \evensidemargin + \textwidth \scan_stop:
+ \vbox_to_zero:n {
+ \kern -\c__shipout_vorigin_tl \scan_stop:
+ \unitlength 1pt \scan_stop:
+ \hbox_set_to_wd:Nnn \l__shipout_tmp_box \c_zero_dim
+ { \ignorespaces #1 \hss }
+ \box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim
+ \box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim
+ \box_use:N \l__shipout_tmp_box
+ \tex_vss:D
+ }
}
-\newcommand*{\AtBegShi at bidi@vorigin at bottom}[1]{%
- \dimexpr\paperheight-\AtBegShi at vorigin\relax
+\cs_new:Npn \__shipout_picture_overlay_lower_right:n #1 {
+ \__shipout_init_page_origins:
+ \kern \__dim_eval:w \c__shipout_horigin_tl + \oddsidemargin + \evensidemargin + \textwidth \scan_stop:
+ \vbox_to_zero:n {
+ \kern \__dim_eval:w \paperheight - \c__shipout_vorigin_tl \scan_stop:
+ \unitlength 1pt \scan_stop:
+ \hbox_set_to_wd:Nnn \l__shipout_tmp_box \c_zero_dim
+ { \ignorespaces #1 \hss }
+ \box_set_ht:Nn \l__shipout_tmp_box \c_zero_dim
+ \box_set_dp:Nn \l__shipout_tmp_box \c_zero_dim
+ \box_use:N \l__shipout_tmp_box
+ \tex_vss:D
+ }
}
-\renewcommand*{\AtBeginShipoutUpperLeft}[1]{%
- \AtBeginShipoutAddToBox{%
- \kern\AtBegShi at bidi@horigin at left\relax
- \vbox to 0pt{%
- \kern-\AtBegShi at vorigin\relax
- \AtBegShi at BeginPicture
- #1%
- \AtBegShi at EndPicture
- \vss
- }%
- }%
+\cs_new:Npn \__shipout_add_background_picture_lower_left:n #1 {
+ \__shipout_add_background_box:n { \__shipout_picture_overlay_lower_left:n {#1} }
}
-\renewcommand*{\AtBeginShipoutUpperLeftForeground}[1]{%
- \AtBeginShipoutAddToBoxForeground{%
- \kern\AtBegShi at bidi@horigin at left\relax
- \vbox to 0pt{%
- \kern-\AtBegShi at vorigin\relax
- \AtBegShi at BeginPicture
- #1%
- \AtBegShi at EndPicture
- \vss
- }%
- }%
+\cs_new:Npn \__shipout_add_foreground_picture_lower_left:n #1 {
+ \__shipout_add_foreground_box:n { \__shipout_picture_overlay_lower_left:n {#1} }
}
-\newcommand*{\AtBeginShipoutUpperRight}[1]{%
- \AtBeginShipoutAddToBox{%
- \kern\AtBegShi at bidi@horigin at right\relax
- \vbox to 0pt{%
- \kern-\AtBegShi at vorigin\relax
- \AtBegShi at BeginPicture
- #1%
- \AtBegShi at EndPicture
- \vss
- }%
- }%
+\cs_new:Npn \__shipout_add_background_picture_upper_right:n #1 {
+ \__shipout_add_background_box:n { \__shipout_picture_overlay_upper_right:n {#1} }
}
-\newcommand*{\AtBeginShipoutUpperRightForeground}[1]{%
- \AtBeginShipoutAddToBoxForeground{%
- \kern\AtBegShi at bidi@horigin at right\relax
- \vbox to 0pt{%
- \kern-\AtBegShi at vorigin\relax
- \AtBegShi at BeginPicture
- #1%
- \AtBegShi at EndPicture
- \vss
- }%
- }%
+\cs_new:Npn \__shipout_add_foreground_picture_upper_right:n #1 {
+ \__shipout_add_foreground_box:n { \__shipout_picture_overlay_upper_right:n {#1} }
}
-\newcommand*{\AtBeginShipoutLowerLeft}[1]{%
- \AtBeginShipoutAddToBox{%
- \kern\AtBegShi at bidi@horigin at left\relax
- \vbox to 0pt{%
- \kern\AtBegShi at bidi@vorigin at bottom\relax
- \AtBegShi at BeginPicture
- #1%
- \AtBegShi at EndPicture
- \vss
- }%
- }%
+\cs_new:Npn \__shipout_add_background_picture_lower_right:n #1 {
+ \__shipout_add_background_box:n { \__shipout_picture_overlay_lower_right:n {#1} }
}
-\newcommand*{\AtBeginShipoutLowerLeftForeground}[1]{%
- \AtBeginShipoutAddToBoxForeground{%
- \kern\AtBegShi at bidi@horigin at left\relax
- \vbox to 0pt{%
- \kern\AtBegShi at bidi@vorigin at bottom\relax
- \AtBegShi at BeginPicture
- #1%
- \AtBegShi at EndPicture
- \vss
- }%
- }%
+\cs_new:Npn \__shipout_add_foreground_picture_lower_right:n #1 {
+ \__shipout_add_foreground_box:n { \__shipout_picture_overlay_lower_right:n {#1} }
}
-\newcommand*{\AtBeginShipoutLowerRight}[1]{%
- \AtBeginShipoutAddToBox{%
- \kern\AtBegShi at bidi@horigin at right\relax
- \vbox to 0pt{%
- \kern\AtBegShi at bidi@vorigin at bottom\relax
- \AtBegShi at BeginPicture
- #1%
- \AtBegShi at EndPicture
- \vss
- }%
- }%
-}
-\newcommand*{\AtBeginShipoutLowerRightForeground}[1]{%
- \AtBeginShipoutAddToBoxForeground{%
- \kern\AtBegShi at bidi@horigin at right\relax
- \vbox to 0pt{%
- \kern\AtBegShi at bidi@vorigin at bottom\relax
- \AtBegShi at BeginPicture
- #1%
- \AtBegShi at EndPicture
- \vss
- }%
- }%
-}
+\cs_set_eq:NN \AtBeginShipoutLowerLeft
+ \__shipout_add_background_picture_lower_left:n
+\cs_set_eq:NN \AtBeginShipoutLowerLeftForeground
+ \__shipout_add_foreground_picture_lower_left:n
+\cs_set_eq:NN \AtBeginShipoutUpperRight
+ \__shipout_add_background_picture_upper_right:n
+\cs_set_eq:NN \AtBeginShipoutUpperRightForeground
+ \__shipout_add_foreground_picture_upper_right:n
+\cs_set_eq:NN \AtBeginShipoutLowerRight
+ \__shipout_add_background_picture_lower_right:n
+\cs_set_eq:NN \AtBeginShipoutLowerRightForeground
+ \__shipout_add_foreground_picture_lower_right:n
+\ExplSyntaxOff
\endinput
%%
%% End of file `bidi-atbegshi.sty'.
\ No newline at end of file
More information about the tex-live-commits
mailing list.