diff options
author | Norbert Preining <norbert@preining.info> | 2022-04-30 03:02:24 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-04-30 03:02:24 +0000 |
commit | 9f2f967e007f0ea011b3875148304d46c921dd90 (patch) | |
tree | 25c3a1741135535e14cc4556f73606db25f47be0 /macros/latex/contrib/bxpapersize | |
parent | 871577883bd14da9df6a3b85bae42337e392f583 (diff) |
CTAN sync 202204300302
Diffstat (limited to 'macros/latex/contrib/bxpapersize')
-rw-r--r-- | macros/latex/contrib/bxpapersize/LICENSE | 2 | ||||
-rw-r--r-- | macros/latex/contrib/bxpapersize/README.md | 13 | ||||
-rw-r--r-- | macros/latex/contrib/bxpapersize/bxpapersize.sty | 50 |
3 files changed, 46 insertions, 19 deletions
diff --git a/macros/latex/contrib/bxpapersize/LICENSE b/macros/latex/contrib/bxpapersize/LICENSE index ac1eff3149..b9164b46b1 100644 --- a/macros/latex/contrib/bxpapersize/LICENSE +++ b/macros/latex/contrib/bxpapersize/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2016-2020 Takayuki YATO (aka. "ZR") +Copyright (c) 2016-2022 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/macros/latex/contrib/bxpapersize/README.md b/macros/latex/contrib/bxpapersize/README.md index ebd10daa7b..07687d2ee0 100644 --- a/macros/latex/contrib/bxpapersize/README.md +++ b/macros/latex/contrib/bxpapersize/README.md @@ -24,7 +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) + - pxatbegshi: on (u)pLaTeX ### Installation @@ -34,6 +34,7 @@ should have higher or lower priority over the settings made by others. This package is distributed under the MIT License. + The bxpapersize Package ----------------------- @@ -50,6 +51,8 @@ The available options are described hereafter. the bxpapersize package. Note that once `disabled` is used there is no way to enable the functionality. * `nodvidriver`: A synonym for `disabled`. + * `autodvidriver`: Negation of `disabled`/`nodvidriver`. + Note: Options `dvips` and `dvipdfmx` also negate `disabled`. #### Priority @@ -92,7 +95,7 @@ output papersize will be made identical to the layout paper size. You can change the settings of this package using `\papersizesetup` command, invoked as follows: - \bxpapersizesetup[<key>=<value>,...] + \papersizesetup[<key>=<value>,...] The available keys are listed below: @@ -112,7 +115,7 @@ The available keys are listed below: It is provided because option strings including braces are not permitted in the package option list. - `<papersize-name>`: The output should be equal to the given - size. The set pf available paper-size names is the same as the + size. The set of available paper-size names is the same as in the [geometry package] and is listed below: a0paper--a6paper, b0paper--b6paper, c0paper--c6paper, b0j--b6j, ansiapaper--ansiepaper, letterpaper, legalpaper, executivepaper, @@ -135,9 +138,13 @@ so as to cope with command name conflict. Namely, `\papersizesetup` will be not (re)defined if the command of that name is already defined, but `\bxpapersizesetup` will be always provided. + Revision History ---------------- + * Version 0.6 ‹2022/04/28› + - Add `autodvidriver` option. + - Rearrange spec on driver options. * Version 0.5 ‹2020/10/01› - Support LaTeX kernel 2020/10/01. (But priority setting is not yet supported.) diff --git a/macros/latex/contrib/bxpapersize/bxpapersize.sty b/macros/latex/contrib/bxpapersize/bxpapersize.sty index b91e56384c..6cd35f59c9 100644 --- a/macros/latex/contrib/bxpapersize/bxpapersize.sty +++ b/macros/latex/contrib/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 |