<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%%
%% This is file `bidi-atbegshi.sty'.
%% 
%%   ___________________________________________
%%   Copyright Â© 2014--2022  Vafa Khalighi &lt;tex-persian@vafa.ac&gt;
%% 
%%   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}[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
    }
}
\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
    }
}
\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
    }
}
\cs_new:Npn \__shipout_add_background_picture_lower_left:n #1 {
   \__shipout_add_background_box:n { \__shipout_picture_overlay_lower_left:n {#1} }
}
\cs_new:Npn \__shipout_add_foreground_picture_lower_left:n #1 {
   \__shipout_add_foreground_box:n { \__shipout_picture_overlay_lower_left:n {#1} }
}
\cs_new:Npn \__shipout_add_background_picture_upper_right:n #1 {
   \__shipout_add_background_box:n { \__shipout_picture_overlay_upper_right:n {#1} }
}
\cs_new:Npn \__shipout_add_foreground_picture_upper_right:n #1 {
   \__shipout_add_foreground_box:n { \__shipout_picture_overlay_upper_right:n {#1} }
}
\cs_new:Npn \__shipout_add_background_picture_lower_right:n #1 {
   \__shipout_add_background_box:n { \__shipout_picture_overlay_lower_right:n {#1} }
}
\cs_new:Npn \__shipout_add_foreground_picture_lower_right:n #1 {
   \__shipout_add_foreground_box:n { \__shipout_picture_overlay_lower_right:n {#1} }
}
\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'.</pre></body></html>