From 51a537961f8cc72485841891fd8527a5e9c5f6c5 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 13 Jun 2020 20:58:31 +0000 Subject: pxjahyper (13jun20) git-svn-id: svn://tug.org/texlive/trunk@55538 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/platex/pxjahyper/pxjahyper-ajm.def | 13 +- .../texmf-dist/tex/platex/pxjahyper/pxjahyper.sty | 137 ++++++++++++++++++--- 2 files changed, 125 insertions(+), 25 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def index 81ce1868dfe..288f3209975 100644 --- a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def +++ b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def @@ -11,7 +11,7 @@ %% package declaration \NeedsTeXFormat{pLaTeX2e} -\ProvidesFile{pxjahyper-ajm.def}[2020/04/24 v0.4b] +\ProvidesFile{pxjahyper-ajm.def}[2020/06/13 v0.5] %% avoid multiple loading \csname pxjahyperajmLoaded\endcsname @@ -43,16 +43,9 @@ %% \pxhy@cond@both\ifXXX...\fi\ifYYY...\fi{}{} % Checks whether \ifXXX and \ifYYY both hold. \@gobbletwo\if\if\@gobbletwo\if\if \def\pxhy@cond@both#1\fi#2\fi{% - \bxju@cond{\if #1#2T\else F\fi\else F\fi T}\fi + \pxhy@cond{\if #1#2T\else F\fi\else F\fi T}\fi } -%% \pxhy@if@star{}{} -% Expands to if followed by *, otherwise to . -\def\pxhy@if@star#1#2#3{% #3=next-arg - \expandafter\pxhy@if@star@a\detokenize{#3}@{#1}*@{#2{#3}}\pxhy@mk -} -\def\pxhy@if@star@a#1*@#2#3\pxhy@mk{#2} - %% \pxhy@if@plus{}{} % Expands to if followed by +, otherwise to . \def\pxhy@if@plus#1#2#3{% #3=next-arg @@ -131,7 +124,7 @@ %--------------------------------------- helpers %% prepare -\csuse{forcecjktoken} +\pxhy@forcecjktoken %% shorthands \catcode`\`=\active \let`\noexpand diff --git a/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty b/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty index 66b070c7136..4d83b2a3517 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/04/24 v0.4b] +\ProvidesPackage{pxjahyper}[2020/06/13 v0.5] %% error messages \def\pxhy@pkgname{pxjahyper} @@ -26,11 +26,13 @@ %% packages \RequirePackage{atbegshi} +\RequirePackage{ltxcmds}[2011/08/22]% v1.21 %% globals \newif\ifpxhy@ptex \newif\ifpxhy@uptex \newif\ifpxhy@etex +\newif\ifpxhy@etoolbox \let\pxhy@jcode\@undefined \newif\ifpxhy@tounicode \newif\ifpxhy@zerox @@ -41,6 +43,7 @@ \let\pxhy@driver\@undefined \newif\ifpxhy@hy@unicode \newif\ifpxhy@jacommentline +\newif\ifpxhy@disablecmds \newif\ifpxhy@otfcid \newif\ifpxhy@otfmacros @@ -85,6 +88,12 @@ \DeclareOption{nojacommentline}{% \pxhy@jacommentlinefalse } +\DeclareOption{disablecmds}{% + \pxhy@disablecmdstrue +} +\DeclareOption{nodisablecmds}{% + \pxhy@disablecmdsfalse +} \pxhy@otfcidtrue \DeclareOption{otfcid}{% \pxhy@otfcidtrue @@ -95,13 +104,12 @@ } \DeclareOption{otfmacros}{% \pxhy@otfmacrostrue - \let\pxhy@otfcid@given=t } \DeclareOption{nootfmacros}{% \pxhy@otfmacrosfalse } \ExecuteOptions{% - auto,tounicode,noout2uni,jacommentline% + auto,tounicode,noout2uni,jacommentline,disablecmds% } \ProcessOptions* @@ -150,7 +158,9 @@ \ifx\pxhy@tmpa\pxhy@tmpb #2\fi } \pxhy@check\eTeXversion{% - \IfFileExists{etoolbox.sty}{\pxhy@etextrue}{}} + \pxhy@etextrue + \IfFileExists{etoolbox.sty}{\pxhy@etoolboxtrue}{}% +} \pxhy@check\kanjiskip{\pxhy@ptextrue} \pxhy@check\forcecjktoken{\pxhy@uptextrue} \ifpxhy@ptex\else @@ -203,13 +213,18 @@ \pxhy@fatal{hyperref 'unicode' mode is not supported}{}% \expandafter\endinput \fi +% otfmacros forces use of otfcid. +\ifpxhy@otfmacros + \let\pxhy@otfcid@given=t + \pxhy@otfcidtrue +\fi % otfcid requires upTeX or out2uni. \ifpxhy@uptex\else\ifpxhy@zerox\else \pxhy@otfcidfalse \ifx t\pxhy@otfcid@given \PackageWarningNoLine\pxhy@pkgname - {Option 'otfcid' is invalid unless upTeX is used\MessageBreak - or 'out2uni' is specified} + {Option 'otfcid'/'otfmacros' is invalid\MessageBreak + unless upTeX is used or 'out2uni' is specified} \fi \fi\fi @@ -226,11 +241,6 @@ pxhy@driver = \the\pxhy@driver^^J% %--------------------------------------- Helpers -%% packages -\ifpxhy@etex - \RequirePackage{etoolbox}[2011/01/03]%v2.1 -\fi - %% unique tokens \def\pxhy@end{\pxhy@end@} \let\pxhy@mk\indent % unexpandable @@ -262,6 +272,32 @@ pxhy@driver = \the\pxhy@driver^^J% \let\pxhy@forcecjktoken\relax \fi +%--------------------------------------- Helpers (e-TeX) +\ifpxhy@etex + +%% packages +\ifpxhy@etoolbox + \RequirePackage{etoolbox}[2011/01/03]%v2.1 +\fi + +%% \pxhy@if@star{}{} +% Expands to if followed by *, otherwise to . +\def\pxhy@if@star#1#2#3{% #3=next-arg + \expandafter\pxhy@if@star@a\expandafter @\detokenize{#3}@% + {#1}@*@{#2{#3}}\pxhy@mk +} +\def\pxhy@if@star@a#1@*@#2#3\pxhy@mk{#2} + +%% \pxhy@if@opt{}{} +% Expands to {} if followed by [], otherwise to . +\def\pxhy@if@opt#1#2#3{% #3=next-arg + \expandafter\pxhy@if@opt@a\expandafter @\detokenize{#3}@% + {\pxhy@if@opt@b{#1}}@[@{#2{#3}}\pxhy@mk%] +} +\def\pxhy@if@opt@a#1@[@#2#3\pxhy@mk{#2} +\def\pxhy@if@opt@b#1#2]{#1{#2}} + +\fi %--------------------------------------- Output 'tounicode' special \ifpxhy@tounicode @@ -445,7 +481,7 @@ pxhy@driver = \the\pxhy@driver^^J% \let\pxhy@otfcid@disabled\relax %% preparation -\ifpxhy@etex +\ifpxhy@etoolbox % check if bxjatoucs is available \IfFileExists{bxjatoucs.sty}{% \let\bxjatoucsCheckAvail=t @@ -457,11 +493,15 @@ pxhy@driver = \the\pxhy@driver^^J% package 'bxjatoucs' is unavailable% }% }{} +\else\ifpxhy@etex + \def\pxhy@otfcid@disabled{% + package 'etoolbox' is unavailable% + } \else \def\pxhy@otfcid@disabled{% - e-TeX extension (or 'etoolbox') is unavailable% + e-TeX extension is unavailable% } -\fi +\fi\fi %% annihilate the ajmacros's own pdfstring process \ifpxhy@otfmacros\ifx\pxhy@otfcid@disabled\relax \let\ajRedefine@ajCommands\relax @@ -514,7 +554,7 @@ pxhy@driver = \the\pxhy@driver^^J% \pxhy@dispatch@otfcid \else \PackageWarningNoLine\pxhy@pkgname - {Option 'otfcid' is disabled, because\MessageBreak + {Option 'otfcid'/'otfmacros' is disabled, because\MessageBreak \pxhy@otfcid@disabled}% \pxhy@otfcidfalse \fi @@ -1111,6 +1151,73 @@ pxhy@driver = \the\pxhy@driver^^J% } \fi +\fi +%--------------------------------------- 'disablecmds' +\ifpxhy@disablecmds + +%% \pxhy@rensuji +\ifpxhy@etex + \def\pxhy@rensuji{% + \pxhy@if@star\pxhy@rensuji@a\pxhy@rensuji@a + } + \def\pxhy@rensuji@a{% + \pxhy@if@opt\@secondoftwo\@firstofone + } +\else + \let\pxhy@rensuji\relax % freeze +\fi + +%% \pxhy@ifdef@let\CSa\CSb +\def\pxhy@ifdef@let#1#2{% + \ifx#1\@undefined\else + \let#1#2% + \fi +} + +%% \pxhy@disable@commands +\def\pxhy@disable@commands{% + % pTeX primitives + \let\autospacing\@empty + \let\autoxspacing\@empty + \let\inhibitglue\@empty + \let\noautospacing\@empty + \let\noautoxspacing\@empty + % pLaTeX core + \let\romanencoding\@gobble + \let\kanjiencoding\@gobble + \let\romanfamily\@gobble + \let\kanjifamily\@gobble + \let\romanseries\@gobble + \let\kanjiseries\@gobble + \let\romanshape\@gobble + \let\kanjishape\@gobble + \let\useroman\@gobblefour + \let\usekanji\@gobblefour + \let\textmc\@firstofone + \let\textgt\@firstofone + \let\mcfamily\@empty + \let\gtfamily\@empty + \let\userelfont\@empty + \let\<\@empty + % plext + \pxhy@ifdef@let\bou\@firstofone + \pxhy@ifdef@let\kasen\@firstofone + \pxhy@ifdef@let\rensuji\pxhy@rensuji + \pxhy@ifdef@let\prensuji\pxhy@rensuji + \pxhy@ifdef@let\Rensuji\pxhy@rensuji + % japanese-otf + \pxhy@ifdef@let\textmg\@firstofone + \pxhy@ifdef@let\mgfamily\@empty + \pxhy@ifdef@let\ltseries\@empty + \pxhy@ifdef@let\ebseries\@empty + \pxhy@ifdef@let\propshape\@empty +} + +%% register to 'disable' list +% This registration should be of lower priority than others, +% and thus is prepended to pdfstringdefPreHook. +\ltx@GlobalPrependToMacro\pdfstringdefPreHook{\pxhy@disable@commands} + \fi %--------------------------------------- All done \endinput -- cgit v1.2.3