diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/bxpapersize/LICENSE | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/bxpapersize/README.md | 5 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty | 111 |
3 files changed, 24 insertions, 94 deletions
diff --git a/Master/texmf-dist/doc/latex/bxpapersize/LICENSE b/Master/texmf-dist/doc/latex/bxpapersize/LICENSE index 8ada757fbc8..534324b7566 100644 --- a/Master/texmf-dist/doc/latex/bxpapersize/LICENSE +++ b/Master/texmf-dist/doc/latex/bxpapersize/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2017 Takayuki YATO (aka. "ZR") +Copyright (c) 2019 Takayuki YATO (aka. "ZR") Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Master/texmf-dist/doc/latex/bxpapersize/README.md b/Master/texmf-dist/doc/latex/bxpapersize/README.md index 97c65e5d8a6..9575d883a70 100644 --- a/Master/texmf-dist/doc/latex/bxpapersize/README.md +++ b/Master/texmf-dist/doc/latex/bxpapersize/README.md @@ -24,6 +24,7 @@ should have higher or lower priority over the settings made by others. - ifpdf, ifxetex, ifluatex, ifvtex - xkeyval - atbegshi + - pxatbegshi (when priority setting is used on (u)pTeX) ### Installation @@ -59,6 +60,7 @@ The available options are described hereafter. - `low`: Priotizes specials by others. - `middle`/`default` (default): Does not care about priority. - `high`: Priotizes specials by this package. + Note: The priority setting will be ignored in PDF mode. * `olddvips`: Must be specified when you use dvips older than that included in TeX Live 2017, so as to make the `priority` option work correctly. @@ -133,6 +135,9 @@ but `\bxpapersizesetup` will be always provided. Revision History ---------------- + * Version 0.4 ‹2019/10/05› + - Load pxatbegshi to properly handle pTeX tate mode. + - Remove (experimental) `adjustmag` option. * Version 0.3b ‹2017/10/08› - Support pTeX-ng (ApTeX) engine properly. - (Experimental) Add `adjustmag` option. diff --git a/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty b/Master/texmf-dist/tex/latex/bxpapersize/bxpapersize.sty index 1370314a8a2..4fe8782cfc6 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) 2017 Takayuki YATO (aka. "ZR") +%% Copyright (c) 2019 Takayuki YATO (aka. "ZR") %% GitHub: https://github.com/zr-tex8r %% Twitter: @zr_tex8r %% @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{bxpapersize}[2017/10/08 v0.3b] +\ProvidesPackage{bxpapersize}[2019/10/05 v0.4] %% preparation \def\bxpr@pkgname{bxpapersize} @@ -48,12 +48,13 @@ %% load packages \RequirePackage{xkeyval}[2008/08/10]% v2.6 \RequirePackage{atbegshi} -\RequirePackage{ifpdf,ifxetex,ifluatex,ifvtex} +\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 @@ -62,11 +63,6 @@ %% unique tokens \def\bxpr@end{\bxpr@end@} -%% \bxpr@ptexng -\chardef\bxpr@ptexng=0 -\edef\bxpr@tmpa{\string\ngbanner}\edef\bxpr@tmpb{\meaning\ngbanner} -\ifx\bxpr@tmpa\bxpr@tmpb \chardef\bxpr@ptexng=1 \fi - %% \bxpr@pagewidth / \bxpr@pageheight %% \bxpr@horigin / \bxpr@vorigin \ifluatex % LuaTeX @@ -89,7 +85,7 @@ \else\ifvtex % VTeX \let\bxpr@pagewidth\mediawidth \let\bxpr@pageheight\mediaheight -\else\ifnum0\the\bxpr@ptexng\ifpdf1\fi>0 % pdfTeX in PDF mode +\else\ifnum0\ifptexng1\fi\ifpdf1\fi>0 % pdfTeX in PDF mode \let\bxpr@pagewidth\pdfpagewidth \let\bxpr@pageheight\pdfpageheight \let\bxpr@horigin\pdfhorigin @@ -170,11 +166,6 @@ \def\bxpr@set@priority#1{% invalidate \bxpr@err@nlprm{priority}}} -%% 'adjustmag' -\define@boolkey+[bxpr]{prm}{adjustmag}[true]% - {}% - {\bxpr@err@ivval{adjustmag}{#1}} - %% 'truedimen' \define@boolkey+[bxpr]{prm}{truedimen}[true]% {\bxpr@needs@reset@sizetrue}% @@ -287,6 +278,18 @@ \noexpand\bxpapersizesetup{\bxpr@kvopt}% }\bxpr@tmpa +% if priority is not middle... +\ifnum\bxpr@priority=\bxpr@priority@@default\else + \ifcase\bxpr@mode % dvi + \ifptex + \RequirePackage{pxatbegshi}[] + \fi + \or % pdf + \PackageWarningNoLine\bxpr@pkgname + {The priority setting will be ignored in PDF mdoe} + \fi +\fi + %--------------------------------------- page hook %% \bxpr@begindoc@first@hook @@ -399,12 +402,7 @@ \edef\bxpr@special@chunk{\special{papersize=\bxpr@tmpb}}}% \else %pdf \def\bxpr@set@page@size#1#2{% - \let\bxpr@tmpb\@empty - \ifbxpr@prm@adjustmag - \bxpr@let@real@mag@to\bxpr@tmpb - \fi - \bxpr@pagewidth=#1\relax \bxpr@pagewidth=\bxpr@tmpb\bxpr@pagewidth - \bxpr@pageheight=#2\relax \bxpr@pageheight=\bxpr@tmpb\bxpr@pageheight + \bxpr@pagewidth=#1\relax \bxpr@pageheight=#2\relax \bxDebug{papersize=\the\bxpr@pagewidth,\the\bxpr@pageheight}}% \fi @@ -469,79 +467,6 @@ \advance\bxpr@dima\dp\AtBeginShipoutBox \edef\bxpr@height{\the\bxpr@dima}} -%--------------------------------------- cope with tate-direction - -% In (u)pTeX engine, boxes and lists have the direction attribute, -% and yoko boxes cannot be unboxed in tate lists (and vice versa). -% This restriction can cause the atbegshi package to fail, and thus -% the 'priority=low' setting results in an error when used together -% with document classes of tate direction. - -% if '\tate' is invalid then quit now -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname tate\endcsname\relax -\expandafter\endinput\fi\relax - -% if priority is middle then quit -\ifnum\bxpr@priority=\bxpr@priority@@default -\expandafter\endinput\fi\relax - -% check in advance -\ifx\AtBegShi@Output\@undefined - \PackageWarningNoLine\bxpr@pkgname - {The patch to atbegshi failed, so\MessageBreak - the package might not work well} -\expandafter\endinput\fi\relax - -%% \ifbxpr@ddir -\begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname ifddir\endcsname\relax - \bxpr@csletcs{ifbxpr@ddir}{iffalse} -\else - \bxpr@csletcs{ifbxpr@ddir}{ifddir} -\fi - -%% \bxpr@patch -% Patches the internal macro \AtBegShi@Output of atbegshi package, -% so that the macro is prepended by a `\yoko` primitive and appended -% by a direction primitive to switch back to the original. -\@onlypreamble\bxpr@patch -\def\bxpr@patch{% - \expandafter\bxpr@patch@a\AtBegShi@Output\bxpr@end} -\@onlypreamble\bxpr@patch@a -\def\bxpr@patch@a{% - \futurelet\bxpr@tok\bxpr@patch@b} -\@onlypreamble\bxpr@patch@b -\def\bxpr@patch@b{% - \ifx\bxpr@tok\egroup \expandafter\@firstoftwo - \else \expandafter\@secondoftwo - \fi{\bxpr@patch@c}{\bxpr@patch@d{}}} -\@onlypreamble\bxpr@patch@c -\def\bxpr@patch@c#1#2{% - \bxpr@patch@d{#1#2}} -\@onlypreamble\bxpr@patch@d -\def\bxpr@patch@d#1#2\bxpr@end{% - \def\AtBegShi@Output{#1\bxpr@ABS@prehook#2\bxpr@ABS@posthook}} -% do patch -\bxpr@patch - -%% \bxpr@restore@dir -\let\bxpr@restore@dir\relax - -%% \bxpr@ABS@prehook -\def\bxpr@ABS@prehook{% - \iftdir \yoko \let\bxpr@restore@dir\tate - \else\ifbxpr@ddir \yoko \let\bxpr@restore@dir\dtou - \else \let\bxpr@restore@dir\relax - \fi\fi - \ifx\bxpr@restore@dir\relax\else - \bxDebug{Temporarily switching \meaning\bxpr@restore@dir - \space to \string\yoko}% - \fi} -%% \bxpr@ABS@posthook -\def\bxpr@ABS@posthook{% - \bxpr@restore@dir} - %--------------------------------------- all done \endinput %% EOF |