diff options
author | Karl Berry <karl@freefriends.org> | 2022-04-30 20:01:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-04-30 20:01:16 +0000 |
commit | 8e5f1d9ecf99b9eef6609ff53dc7eefa4fc37006 (patch) | |
tree | ffdba4b67c22e2777420b096cdcb2088f2dfa3a8 /Master/texmf-dist/tex | |
parent | ef40700b15c1f320025fa1b75ab19ed54ca86bee (diff) |
bxpdfver (30apr22)
git-svn-id: svn://tug.org/texlive/trunk@63185 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty | 84 |
1 files changed, 69 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty b/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty index 826eef3efdd..ccc9825f6fb 100644 --- a/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty +++ b/Master/texmf-dist/tex/latex/bxpdfver/bxpdfver.sty @@ -1,7 +1,7 @@ %% %% This is file 'bxpdfver.sty'. %% -%% Copyright (c) 2014-2021 Takayuki YATO (aka. "ZR") +%% Copyright (c) 2014-2022 Takayuki YATO (aka. "ZR") %% GitHub: https://github.com/zr-tex8r %% Twitter: @zr_tex8r %% @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{bxpdfver}[2021/02/14 v0.5a] +\ProvidesPackage{bxpdfver}[2022/04/28 v0.6] \def\bxpv@pkgname{bxpdfver} %% preparations @@ -27,8 +27,9 @@ \let\bxpv@version\relax % version value (eg. 1.4) \let\bxpv@compress=t % use compression? \let\bxpv@obj@compress=t % use object stream? -\chardef\bxpv@infolevel=2 % info-log level +\let\bxpv@infolevel\relax % info-log level \let\bxpv@new@dvipdfmx=f % assume new dvipdfmx? +\let\bxpv@ignore@pdfmanagement=f %% \bxpv@valid@versions \def\bxpv@valid@versions{1.4,1.5,1.6,1.7,2.0} @@ -82,6 +83,10 @@ \let\bxpv@drv@type=0% \def\bxpv@drv@name{nodvidriver}% } +\DeclareOption{resetdvidriver}{% + \let\bxpv@drv@type\relax + \let\bxpv@drv@name\relax +} \DeclareOption{new-dvipdfmx}{% \let\bxpv@drv@type=d% \let\bxpv@new@dvipdfmx=t% @@ -91,10 +96,34 @@ \DeclareOption{lenient}{% \chardef\bxpv@infolevel=1 } +\DeclareOption{nolenient}{% + \chardef\bxpv@infolevel=2 +} +\DeclareOption{lenient+}{% + \chardef\bxpv@infolevel=0 +} +\DeclareOption{nolenient+}{% + \chardef\bxpv@infolevel=2 +} +\DeclareOption{ignorepdfmanagement}{% + \let\bxpv@ignore@pdfmanagement=t +} +\DeclareOption{noignorepdfmanagement}{% + \let\bxpv@ignore@pdfmanagement=f +} %% process \ProcessOptions* +%% default infolevel value +\ifx\bxpv@infolevel\relax + \if 0\bxpv@drv@type + \chardef\bxpv@infolevel=0 %'lenient+' + \else + \chardef\bxpv@infolevel=2 %'nolenient' + \fi +\fi + %--------------------------------------- helpers %% unique tokens @@ -115,6 +144,17 @@ \def#3{#2}% } +%% \bxpv@warn{<message>} +% Issues a warning. +\@onlypreamble\bxpv@warn +\def\bxpv@warn#1{% + \ifcase\bxpv@infolevel % info when lenient+ + \PackageInfo\bxpv@pkgname{#1\@gobble}% + \else % warn otherwise + \PackageWarningNoLine\bxpv@pkgname{#1}% + \fi +} + %% \bxpv@fail{<message>} % Issues an error or a warning. \@onlypreamble\bxpv@fail @@ -193,9 +233,13 @@ \bxpv@check@hyperref % must come first } -%% 'disabled' driver -\if 0\bxpv@drv@type - \chardef\bxpv@infolevel=0 +%% check for new PDF management +\if t\bxpv@ignore@pdfmanagement\else + \ifx\IfPDFManagementActiveTF\@undefined\else + \IfPDFManagementActiveTF{% + \global\let\bxpv@drv@type=m% + }{} + \fi \fi %% adjust internal dispatchers @@ -218,8 +262,13 @@ \bxpv@check@prim\outputmode{\chardef\bxpv@pdfoutput\outputmode} \bxpv@check@prim\ngbanner{\chardef\bxpv@pdfoutput\@ne} -%% when in PDF mode -\ifnum\bxpv@pdfoutput>\z@ +%% switch +\if m\bxpv@drv@type + %% when in new PDF management + \bxpv@warn + {New PDF management is active}% +\else\ifnum\bxpv@pdfoutput>\z@ + %% when in PDF mode \global\let\bxpv@drv@type=p \global\let\bxpv@@compresslevel\pdfcompresslevel \global\let\bxpv@@objcompresslevel\pdfobjcompresslevel @@ -320,17 +369,22 @@ \global\let\bxpv@preserve@destinations\relax \fi \else + %% when in DVI mode % XeTeX should do just as dvipdfmx. \bxpv@check@prim\XeTeXversion{% \global\let\bxpv@drv@type=d% } -\fi - -%% when in DVI mode + % strange engines + \bxpv@check@prim\HINTversion{% + \global\let\bxpv@drv@type=X% + } +\fi\fi \if x\bxpv@drv@type % 'bad' driver - \bxpv@fail{Unsupported driver '\bxpv@drv@name'}% - % no further errors - \global\chardef\bxpv@infolevel=0 + \bxpv@warn + {Unsupported driver '\bxpv@drv@name'}% +\else\if X\bxpv@drv@type % strange engine + \bxpv@warn + {Unsupported engine}% \else\if d\bxpv@drv@type % 'dvipdfmx' \global\let\bxpv@suppress@compress\relax \global\let\bxpv@suppress@obj@compress\relax @@ -349,7 +403,7 @@ \bxpv@fail {No driver option is given}% \global\chardef\bxpv@infolevel=0 -\fi\fi\fi +\fi\fi\fi\fi \endgroup \fi %-------- |