summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bxpapersize
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-04-29 21:13:14 +0000
committerKarl Berry <karl@freefriends.org>2022-04-29 21:13:14 +0000
commit95a33128ae428008bdd173917305b78bfd845346 (patch)
tree04beee85277f6ee6a103b1dfb20647815593090a /Master/texmf-dist/tex/latex/bxpapersize
parentaf4ad1c389367c6a6a264ee9402ac094ee28fc28 (diff)
bxpapersize (29apr22)
git-svn-id: svn://tug.org/texlive/trunk@63174 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bxpapersize')
-rw-r--r--Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty50
1 files changed, 35 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty b/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty
index b91e56384c7..6cd35f59c9b 100644
--- a/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty
+++ b/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty
@@ -1,7 +1,7 @@
%%
%% This is file 'bxpapersize.sty'.
%%
-%% Copyright (c) 2016-2020 Takayuki YATO (aka. "ZR")
+%% Copyright (c) 2016-2022 Takayuki YATO (aka. "ZR")
%% GitHub: https://github.com/zr-tex8r
%% Twitter: @zr_tex8r
%%
@@ -10,7 +10,7 @@
%% package declaration
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bxpapersize}[2020/10/01 v0.5]
+\ProvidesPackage{bxpapersize}[2022/04/28 v0.6]
%% preparation
\def\bxpr@pkgname{bxpapersize}
@@ -20,15 +20,22 @@
% Note: Only non-key-value global options should be picked.
-%% 'disabled' / 'nodvidriver'
+%% driver options (or 'disabled')
\chardef\bxpr@disabled=0
\DeclareOption{disabled}{%
\chardef\bxpr@disabled=1 }
\DeclareOption{nodvidriver}{%
\chardef\bxpr@disabled=1 }
+\DeclareOption{autodvidriver}{%
+ \chardef\bxpr@disabled=0 }
+\DeclareOption{dvips}{%
+ \chardef\bxpr@disabled=0 }
+\DeclareOption{dvipdfmx}{%
+ \chardef\bxpr@disabled=0 }
%% 'olddvips'
\chardef\bxpr@olddvips=0
\DeclareOption{olddvips}{%
+ \chardef\bxpr@disabled=0
\chardef\bxpr@olddvips=1 }
%% keyval
\@onlypreamble\bxpr@kvopt
@@ -47,22 +54,25 @@
%% load packages
\RequirePackage{xkeyval}[2008/08/10]% v2.6
-\RequirePackage{atbegshi}
\RequirePackage{ifpdf,ifxetex,ifluatex,ifvtex,ifptex}
%% variables
\newdimen\bxpr@dima
\let\bxpr@width\relax
\let\bxpr@height\relax
-\newif\ifbxpr@pxatbegshi
%% constants
-\chardef\bxpr@mode@@dvimode=0
-\chardef\bxpr@mode@@pdfmode=1
+\chardef\bxpr@mode@@papersize=0 % papersize special
+\chardef\bxpr@mode@@pdfmode=1 % PDF-mode primitive
+\chardef\bxpr@mode@@void=2 % no operation
%% unique tokens
\def\bxpr@end{\bxpr@end@}
+%% switch 'bxpr@nosize'
+\newif\ifbxpr@nosize
+\ifx\ifhint\iftrue \bxpr@nosizetrue \fi
+
%% switch 'bxpr@new@hook@system'
% Whether the new hook management system is present.
\newif\ifbxpr@new@hook@system
@@ -106,16 +116,23 @@
\fi
%% \bxpr@mode
-\ifx\bxpr@pagewidth\@undefined
- \let\bxpr@mode\bxpr@mode@@dvimode
+\ifbxpr@nosize
+ \let\bxpr@mode\bxpr@mode@@void
+\else\ifx\bxpr@pagewidth\@undefined
+ \let\bxpr@mode\bxpr@mode@@papersize
\else
\let\bxpr@mode\bxpr@mode@@pdfmode
-\fi
+\fi\fi
%% \bxpr@csletcs{<CSa>}{<CSb>}
\def\bxpr@csletcs#1#2{%
\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname}
+%% load 'atbegshi' package
+\ifnum\bxpr@mode=\bxpr@mode@@void\else
+ \RequirePackage{atbegshi}\relax
+\fi
+
%--------------------------------------- parameters
%% constants
@@ -298,7 +315,7 @@
will be ignored}
\let\bxpr@priority\bxpr@priority@@default
\else %----
- \ifcase\bxpr@mode % dvi
+ \ifcase\bxpr@mode % papersize
\ifptex
\RequirePackage{pxatbegshi}[]
\fi
@@ -345,7 +362,7 @@
size=\the\bxpr@size(\bxpr@cs@width,\bxpr@cs@height)%
\ifnum\bxpr@tombow>\z@ [tombow]\fi}%
\bxpr@geometry@hack
- \ifcase\bxpr@mode % dvi
+ \ifcase\bxpr@mode % papersize
\ifcase\bxpr@priority % low
\AtBeginShipoutInit
\def\bxpr@every@page@hook{%
@@ -369,7 +386,7 @@
\AtBeginShipoutNext{\bxpr@every@page@hook}}%
\AtBeginShipoutNext{\bxpr@every@page@hook}%
\fi
- \else % pdf
+ \or % pdf
\def\bxpr@every@page@hook{%
\bxpr@page@process
\bxpr@modify@output@box\relax\bxpr@special@chunk}%
@@ -416,7 +433,7 @@
\let\bxpr@special@chunk\@empty
%% \bxpr@set@page@size{<width>}{<height>}
-\ifcase\bxpr@mode %dvi
+\ifcase\bxpr@mode % dvi
\def\bxpr@set@page@size#1#2{%
\begingroup
\bxpr@let@real@mag@to\bxpr@tmpa
@@ -427,10 +444,13 @@
\endgroup \bxpr@g@next
\bxDebug{papersize=\bxpr@tmpb}%
\edef\bxpr@special@chunk{\special{papersize=\bxpr@tmpb}}}%
-\else %pdf
+\or % pdf
\def\bxpr@set@page@size#1#2{%
\bxpr@pagewidth=#1\relax \bxpr@pageheight=#2\relax
\bxDebug{papersize=\the\bxpr@pagewidth,\the\bxpr@pageheight}}%
+\else % void
+ \def\bxpr@set@page@size#1#2{%
+ \bxDebug{papersize ignored}}
\fi
%% \bxpr@let@real@mag@to\CS