diff options
author | Karl Berry <karl@freefriends.org> | 2020-10-06 21:58:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-10-06 21:58:35 +0000 |
commit | 959bfd3e34f66df3f1392701684e2b04133ed6f9 (patch) | |
tree | 0c4cb092f0826163c8ada7d9fac6092798a56e13 /Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty | |
parent | df126ccc8641e95237a1c783800218d01b4cd6a1 (diff) |
pxjahyper (6oct20)
git-svn-id: svn://tug.org/texlive/trunk@56573 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty')
-rw-r--r-- | Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty | 63 |
1 files changed, 43 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty index 120cc9697e1..0a79f7fe03e 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty @@ -10,7 +10,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesPackage{pxjahyper}[2020/09/27 v0.5a] +\ProvidesPackage{pxjahyper}[2020/10/05 v0.6-pre] %% error messages \def\pxhy@pkgname{pxjahyper} @@ -25,7 +25,6 @@ \providecommand{\bxDebug}[1]{} %% packages -\RequirePackage{atbegshi} \RequirePackage{ltxcmds}[2011/08/22]% v1.21 %% globals @@ -33,6 +32,7 @@ \newif\ifpxhy@uptex \newif\ifpxhy@etex \newif\ifpxhy@etoolbox +\newif\ifpxhy@new@hook@system \let\pxhy@jcode\@undefined \newif\ifpxhy@tounicode \newif\ifpxhy@zerox @@ -102,8 +102,10 @@ \DeclareOption{nootfcid}{% \pxhy@otfcidfalse } +\pxhy@otfmacrostrue \DeclareOption{otfmacros}{% \pxhy@otfmacrostrue + \let\pxhy@otfcid@given=t } \DeclareOption{nootfmacros}{% \pxhy@otfmacrosfalse @@ -168,6 +170,9 @@ \expandafter\endinput \fi +%% Check for the new hook system. +\@ifl@t@r\fmtversion{2020/10/01}{\pxhy@new@hook@systemtrue}{} + %% Check the internal jcode. \ifnum \jis"2121="8140 \let\pxhy@jcode=s\relax @@ -215,7 +220,6 @@ \fi % otfmacros forces use of otfcid. \ifpxhy@otfmacros - \let\pxhy@otfcid@given=t \pxhy@otfcidtrue \fi % otfcid requires upTeX or out2uni. @@ -228,16 +232,17 @@ \fi \fi\fi -\iffalse -\typeout{% +\bxDebug{****pxjahyper env^^J% pxhy@ptex = \ifpxhy@ptex true\else false\fi^^J% pxhy@uptex = \ifpxhy@uptex true\else false\fi^^J% +pxhy@etex = \ifpxhy@etex true\else false\fi^^J% +pxhy@etoolbox = \ifpxhy@etoolbox true\else false\fi^^J% +pxhy@new@hook@system = \ifpxhy@new@hook@system true\else false\fi^^J% pxhy@jcode = \meaning\pxhy@jcode^^J% pxhy@tounicode = \ifpxhy@tounicode true\else false\fi^^J% pxhy@zerox = \ifpxhy@zerox true\else false\fi^^J% pxhy@driver = \the\pxhy@driver^^J% } -\fi %--------------------------------------- Helpers @@ -246,20 +251,35 @@ pxhy@driver = \the\pxhy@driver^^J% \let\pxhy@mk\indent % unexpandable %% \pxhy@out@special{<text>} -\ifx\AddToHook\@undefined %------- without hook system \def\pxhy@out@special#1{% + \edef\pxhy@tmpa{% + \noexpand\pxhy@begin@dvi@enc@hook{\special{#1}}% + }\pxhy@tmpa +} + +%% \pxhy@begin@dvi@hook{<text>} +%% \pxhy@begin@dvi@enc@hook{<text>} +\ifpxhy@new@hook@system + \def\pxhy@begin@dvi@hook#1{% + \AddToHook{shipout/firstpage}{#1}% + } + \DeclareHookRule{shipout/firstpage}{.}{>}{hyperref} + \def\pxhy@begin@dvi@enc@hook#1{% only once + \AddToHook{shipout/firstpage}[./enc]{#1}% + \DeclareHookRule{shipout/firstpage}{./enc}{<}{hyperref}% + } +\else + \RequirePackage{atbegshi}[2011/10/05]% v1.16 +\def\pxhy@begin@dvi@enc@hook#1{% \begingroup - \toks\z@{\special{#1}}% + \toks\z@{#1}% \toks\tw@\expandafter{\AtBegShi@HookFirst}% \xdef\AtBegShi@HookFirst{\the\toks@\the\toks\tw@}% \endgroup } -\else %------- with hook system -\def\pxhy@out@special#1{% - \AddToHook{shipout/firstpage}[./urgent]{\special{#1}}% -} -\DeclareHookRule{shipout/firstpage}{./urgent}{<}{hyperref} -\DeclareHookRule{shipout/firstpage}{.}{>}{hyperref} + \def\pxhy@begin@dvi@hook#1{% + \AtBeginShipoutFirst{#1}% + } \fi %% \pxhy@get@jchar{<num>} @@ -311,6 +331,10 @@ pxhy@driver = \the\pxhy@driver^^J% \ifnum\pxhy@driver=\pxhy@driver@dvipdfmx %<*dvipdfmx> %% dvipdfmx + \IfFileExists{pxjahyper-enc.sty}{% FIXME: TRANSIENT CODE + \RequirePackage{pxjahyper-enc}[]% + \ifpxhy@bigcode\else \suppressbigcode \fi + }{%else \if e\pxhy@jcode % euc \pxhy@out@special{pdf:tounicode EUC-UCS2} \else\if s\pxhy@jcode % sjis @@ -320,6 +344,7 @@ pxhy@driver = \the\pxhy@driver^^J% \else \pxhy@out@special{pdf:tounicode UTF8-UCS2} \fi\fi\fi + }% \fi %</dvipdfmx> \fi @@ -345,12 +370,10 @@ pxhy@driver = \the\pxhy@driver^^J% \expandafter\pxhy@next\the\@tempcnta\relax \paperwidth=\pxhy@tmpa\paperwidth \paperheight=\pxhy@tmpa\paperheight - \xdef\pxhy@spec@papersize{% - papersize=\the\paperwidth,\the\paperheight - }% - \AtBeginShipoutFirst{% - \special{\pxhy@spec@papersize}% - } + \edef\pxhy@tmpa{% + \noexpand\pxhy@begin@dvi@hook{% + \special{papersize=\the\paperwidth,\the\paperheight}}% + }\pxhy@tmpa \endgroup \fi\fi \fi |