summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty')
-rw-r--r--Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty81
1 files changed, 57 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty
index e36fcc12d95..b5d470951c4 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}[2021/02/26 v0.7b]
+\ProvidesPackage{pxjahyper}[2021/05/05 v0.8]
\def\pxhy@pkgname{pxjahyper}
\providecommand{\bxDebug}[1]{}
@@ -36,6 +36,7 @@
\newif\ifpxhy@zerox
\newif\ifpxhy@bigcode
\let\pxhy@bigcode@given\relax
+\newif\ifpxhy@papersize
\chardef\pxhy@driver@none=0
\chardef\pxhy@driver@dvipdfmx=1
\let\pxhy@driver\@undefined
@@ -74,6 +75,12 @@
\DeclareOption{noout2uni}{%
\pxhy@zeroxfalse
}
+\DeclareOption{papersize}{%
+ \pxhy@papersizetrue
+}
+\DeclareOption{nopapersize}{%
+ \pxhy@papersizefalse
+}
\pxhy@bigcodetrue
\DeclareOption{bigcode}{%
\pxhy@bigcodetrue
@@ -198,6 +205,10 @@
\ifpxhy@zerox
\pxhy@tounicodefalse
\fi
+%% pxhy@papersize switch
+\ifnum\pxhy@driver=\pxhy@driver@none
+ \pxhy@papersizefalse
+\fi
% hyperref 'unicode' is allowed only on upLaTeX.
\ifnum0\ifpxhy@hy@unicode\ifpxhy@uptex\else1\fi\fi>\z@
\PackageError\pxhy@pkgname
@@ -271,6 +282,20 @@ pxhy@driver = \the\pxhy@driver^^J%
\let\pxhy@forcecjktoken\relax
\fi
+%% \pxhy@hook@after@package{<package-name>}{<code>}
+\@onlypreamble\pxhy@hook@after@package
+\def\pxhy@hook@after@package#1#2{%
+ \ifpxhy@new@hook@system
+ \@ifpackageloaded{#1}{#2}{%
+ \AddToHook{package/after/#1}{#2}%
+ }%
+ \else
+ \AtBeginDocument{%
+ \@ifpackageloaded{#1}{#2}{}%
+ }%
+ \fi
+}
+
%--------------------------------------- Helpers (e-TeX)
\ifpxhy@etex
@@ -308,6 +333,7 @@ pxhy@driver = \the\pxhy@driver^^J%
\fi
%--------------------------------------- Papersize special adjustment
+\ifpxhy@papersize %<*papersize>
% When the magnification is in effect (i.e. \mag<>1000), hyperref
% emits a papersize special with wrong value. (dvipdfmx interprets
@@ -338,6 +364,7 @@ pxhy@driver = \the\pxhy@driver^^J%
\fi
\fi
+\fi %</papersize>
%--------------------------------------- Hooks to pdfstringdef
%% constants
@@ -482,11 +509,11 @@ pxhy@driver = \the\pxhy@driver^^J%
%--------------------------------------- Support for 'otfcid'
\ifpxhy@otfcid
-%% variables
+%% \pxhy@otfcid@disabled
+% Holds the message if otfcid/otfmacros is unavailable;
+% otherwise equals to \relax.
\@onlypreamble\pxhy@otfcid@disabled
\let\pxhy@otfcid@disabled\relax
-
-%% preparation
\ifpxhy@etoolbox
% check if bxjatoucs is available
\IfFileExists{bxjatoucs.sty}{%
@@ -508,10 +535,10 @@ pxhy@driver = \the\pxhy@driver^^J%
e-TeX extension is unavailable%
}
\fi\fi
+
%% annihilate the ajmacros's own pdfstring process
\ifpxhy@otfmacros\ifx\pxhy@otfcid@disabled\relax
\let\ajRedefine@ajCommands\relax
- \AtBeginDocument{\let\ajRedefine@ajCommands\relax}
\fi\fi
%% \pxhy@CID{<cid>}
@@ -535,11 +562,25 @@ pxhy@driver = \the\pxhy@driver^^J%
%% \pxhy@dispatch@otfcid
\@onlypreamble\pxhy@dispatch@otfcid
\def\pxhy@dispatch@otfcid{%
- \pdfstringdefDisableCommands{%
- \let\CID\pxhy@CID
- }%
- \ifpxhy@otfmacros
- \ifx\ajSnowman\@undefined\else % ajmacros is loaded
+ \global\let\pxhy@dispatch@otfcid\relax
+ \ifx\pxhy@otfcid@disabled\relax % available!
+ \pdfstringdefDisableCommands{%
+ \let\CID\pxhy@CID
+ }%
+ \else
+ \PackageWarningNoLine\pxhy@pkgname
+ {Option 'otfcid'/'otfmacros' is disabled, because\MessageBreak
+ \pxhy@otfcid@disabled}%
+ \pxhy@otfcidfalse
+ \fi
+}
+
+%% \pxhy@dispatch@otfmacros
+\@onlypreamble\pxhy@dispatch@otfmacros
+\def\pxhy@dispatch@otfmacros{%
+ \global\let\pxhy@dispatch@otfmacros\relax
+ \ifx\pxhy@otfcid@disabled\relax % available!
+ \let\ajRedefine@ajCommands\relax
\chardef\pxhy@tmp@orgcc=\catcode`\@
\makeatletter
\InputIfFileExists{pxjahyper-ajm.def}{%
@@ -550,23 +591,15 @@ pxhy@driver = \the\pxhy@driver^^J%
{File 'pxjahyper-ajm.def' not found\@gobble}%
}%
\catcode`\@=\pxhy@tmp@orgcc
- \fi
+ \else \pxhy@otfmacrosfalse
\fi
}
-%% begin-document hook
-\AtBeginDocument{%
- \@ifpackageloaded{otf}{%
- \ifx\pxhy@otfcid@disabled\relax % available!
- \pxhy@dispatch@otfcid
- \else
- \PackageWarningNoLine\pxhy@pkgname
- {Option 'otfcid'/'otfmacros' is disabled, because\MessageBreak
- \pxhy@otfcid@disabled}%
- \pxhy@otfcidfalse
- \fi
- }{}%
-}
+%% enable hooks
+\pxhy@hook@after@package{otf}{\pxhy@dispatch@otfcid}
+\ifpxhy@otfmacros
+ \pxhy@hook@after@package{ajmacros}{\pxhy@dispatch@otfmacros}
+\fi
\fi
%--------------------------------------- Redefine text commands for PD1