diff options
author | Norbert Preining <norbert@preining.info> | 2022-08-01 03:04:31 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-08-01 03:04:31 +0000 |
commit | c7ecdfe2e07e2e010de5e2a8d94c001c5dc9fc27 (patch) | |
tree | 80bdca45c628ce054648b8b6adc4c97d21bd48bb /macros/jptex/latex/pxjahyper/pxjahyper-uni.def | |
parent | 0d7064c66024537b237407f8b36413b055cf9a9a (diff) |
CTAN sync 202208010304
Diffstat (limited to 'macros/jptex/latex/pxjahyper/pxjahyper-uni.def')
-rw-r--r-- | macros/jptex/latex/pxjahyper/pxjahyper-uni.def | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/macros/jptex/latex/pxjahyper/pxjahyper-uni.def b/macros/jptex/latex/pxjahyper/pxjahyper-uni.def new file mode 100644 index 0000000000..53e30988d9 --- /dev/null +++ b/macros/jptex/latex/pxjahyper/pxjahyper-uni.def @@ -0,0 +1,104 @@ +%% +%% This is file 'pxjahyper-uni.def'. +%% +%% Copyright (c) 2012-2022 Takayuki YATO (aka. "ZR") +%% GitHub: https://github.com/zr-tex8r +%% Twitter: @zr_tex8r +%% +%% This package is distributed under the MIT License. +%% + +%% package declaration +\NeedsTeXFormat{pLaTeX2e} +\ProvidesFile{pxjahyper-uni.def}[2022/05/27 v1.2] +\providecommand{\bxDebug}[1]{} + +%--------------------------------------- environment check + +\@ifpackageloaded{hyperref}{}{%else + \bxDebug{pxjahyper-uni: hyperref not yet loaded}% + \endinput} + +%% if already redefined, then okay +\def\pxhy@tmpa#1{\@backslashchar 000#1} +\ifx\HyPsd@Char\pxhy@tmpa\else + \bxDebug{pxjahyper-uni: already redefined} + \let\jsCheckHyperrefUnicode\@empty +\expandafter\endinput\fi\relax + +%% if this is pTeX and pxjatoucs is not loaded, then quit +\if \ifnum\jis"2121="3000 F% + \else\ifx\bxjaSjisToUcs\@undefined T\else F% + \fi\fi T% + \bxDebug{pxjahyper-uni: bxjatoucs not yet loaded} +\expandafter\endinput\fi\relax + +%--------------------------------------- the patch + +%% The following code is taken from hyperref.sty. +%%%%BEGIN + \def\HyPsd@Char#1{% + \ifnum`#1<128 % + \@backslashchar 000#1% + \else + \ifnum`#1<65536 % + \expandafter\HyPsd@CharTwoByte\number`#1!% + \else + \expandafter\expandafter\expandafter\HyPsd@CharSurrogate + \intcalcSub{`#1}{65536}!% + \fi + \fi + }% + \def\HyPsd@CharTwoByte#1!{% + \expandafter\expandafter\expandafter\HyPsd@CharOctByte + \IntCalcDiv#1!256!!% + \expandafter\expandafter\expandafter\HyPsd@CharOctByte + \IntCalcMod#1!256!!% + }% + \def\HyPsd@CharOctByte#1!{% + \@backslashchar + \IntCalcDiv#1!64!% + \intcalcDiv{\IntCalcMod#1!64!}{8}% + \IntCalcMod#1!8!% + }% + \def\HyPsd@CharSurrogate#1!{% + \@backslashchar 33% + \IntCalcDiv#1!262144!% + \expandafter\expandafter\expandafter\HyPsd@CharOctByte + \intcalcDiv{\IntCalcMod#1!262144!}{1024}!% + \@backslashchar 33% + \expandafter\expandafter\expandafter\IntCalcAdd + \intcalcDiv{\IntCalcMod#1!1024!}{256}!4!% + \expandafter\expandafter\expandafter\HyPsd@CharOctByte + \IntCalcMod#1!256!!% + }% +%%%%END + +\ifnum\jis"2121="3000 \else %<*pTeX> + \def\HyPsd@Char#1{% + \ifnum`#1<128 % + \@backslashchar 000#1% + \else\ifnum`#1<256 % + \expandafter\HyPsd@CharTwoByte\number`#1!% + \else + \expandafter\HyPsd@CharTwoByte\number\pxhy@to@ucs{`#1}!% + \fi\fi + }% + \def\pxhy@to@ucs#1{"FFFD} + \ifnum\jis"2121="8140 % sjis + \let\pxhy@to@ucs\bxjaSjisToUcs + \else\ifnum\jis"2121="A1A1 % euc + \let\pxhy@to@ucs\bxjaEucToUcs + \fi\fi +\fi %</pTeX> + +%% set flag +\let\pxHyperrefUnicodePatched=t +\bxDebug{pxjahyper-uni: patched} + +%% disable the verification of bxjscls +\let\jsCheckHyperrefUnicode\@empty + +%--------------------------------------- done +\endinput +%% EOF |