texlive[56573] Master/texmf-dist: pxjahyper (6oct20)

commits+karl at tug.org commits+karl at tug.org
Tue Oct 6 23:58:35 CEST 2020


Revision: 56573
          http://tug.org/svn/texlive?view=revision&revision=56573
Author:   karl
Date:     2020-10-06 23:58:35 +0200 (Tue, 06 Oct 2020)
Log Message:
-----------
pxjahyper (6oct20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md
    trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md
    trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.pdf
    trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex
    trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def
    trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md	2020-10-06 21:35:11 UTC (rev 56572)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/README-ja.md	2020-10-06 21:58:35 UTC (rev 56573)
@@ -38,9 +38,46 @@
 詳細についてはマニュアル `pxjahyper.pdf` を参照されたい。
 
 
+pxjahyper-enc パッケージ ー 文字コード設定
+------------------------------------------
+
+他のパッケージの内部で読み込むために pxjahyper から機能を抜粋して作った
+パッケージであり、DVI ファイル中の PDF 文字列の漢字コードを指定するため
+の「tounicode special」を出力する機能のみをもつ。
+
+※文書作成者は pxjahyper を読み込むことが推奨される。
+
+### パッケージオプション
+
+※オプション無しでの読込が望ましい。一応グローバルのドライバオプション
+に反応するが、これについても「ドライバ指定が dvipdfmx である場合にのみ
+読み込む」のが望ましい。
+
+  * ドライバオプション:`dvipdfmx`/`dvips`/`nodvidriver` があり、`dvips`
+    はエラーになり、`nodvidriver` はパッケージの機能を無効化する。
+
+### 機能
+
+パッケージを読み込むと、既定動作として、エンジンの内部漢字コードに基づき
+適切な「tounicode special」を出力する。
+
+  * `\suppressbigcode`:内部漢字コードが Unicode のときに、`UTF8-UTF16`
+    ではなく `UTF8-UCS2` の CMap を指定する。
+  * `\suppressdefaulttounicode`:既定動作を無効にする。
+  * `\pxjahyperToUnicodeSpecial{<名前>}`:引数の CMap 名を指定して
+    「tounicode special」を出力する。
+
+
 更新履歴
 --------
 
+  * Version 0.6  〈2020/10/05〉
+      - pxjahyper-enc パッケージを追加した。
+      - `otfmacros` オプションを既定で有効にする。
+
+  * Version 0.5b 〈2020/10/04〉
+      - バグ修正。
+
   * Version 0.5a 〈2020/09/27〉
       - LaTeX カーネル 2020/10/01 版への対応。
 

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md	2020-10-06 21:35:11 UTC (rev 56572)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/README.md	2020-10-06 21:58:35 UTC (rev 56573)
@@ -39,9 +39,21 @@
 Please refer to the manual `pxjahyper.pdf` (in Japanese) for detail.
 
 
+The pxjahyper-enc Package ー Encoding setting
+---------------------------------------------
+
+This is a single-feature package excerpted from the pxjahyper package,
+and is provided for internal use from other packages.
+
+It only issues a  "tounicode special” for specifying the encoding of
+the PDF strings in the output DVI file.
+
+
 Revision History
 ----------------
 
+  * Version 0.6  〈2020/10/05〉
+  * Version 0.5b 〈2020/10/04〉
   * Version 0.5a 〈2020/09/27〉
   * Version 0.5  〈2020/06/13〉
   * Version 0.4b 〈2020/04/24〉

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex
===================================================================
--- trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex	2020-10-06 21:35:11 UTC (rev 56572)
+++ trunk/Master/texmf-dist/doc/platex/pxjahyper/pxjahyper.tex	2020-10-06 21:58:35 UTC (rev 56573)
@@ -6,8 +6,8 @@
 \MakeShortVerb{\|}
 \usepackage{bxtexlogo}
 \bxtexlogoimport{*}
-\newcommand{\PkgVersion}{0.5a}
-\newcommand{\PkgDate}{2020/09/27}
+\newcommand{\PkgVersion}{0.6}
+\newcommand{\PkgDate}{2020/10/05}
 \newcommand{\Pkg}[1]{\textsf{#1}}
 \newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$}
 \newcommand{\Note}{\par\noindent ※}
@@ -77,7 +77,7 @@
   \Note 詳細は\ref{ssec:disablecmds}節を参照。
 \item |nodisablecmds|\Means
   |disablecmds| の否定。
-\item |otfmacros|\Means
+\item |otfmacros|(既定)\Means
   \Pkg{japanese-otf}付属の\Pkg{ajmacros}パッケージが提供する
   文字入力命令(|\ajMaru|、|\ajLig| 等)をPDF文字列中で
   “可能な限り”使えるようにする。
@@ -89,8 +89,9 @@
   使いたい場合は、命令の前に |\protect| 付ける必要がある。
   \footnote{ちなみに、引数がPDF文字列として解釈される場合には、
     |\protect| は全く結果に影響しない。}
-\item |nootfmacros|(既定)\Means
+\item |nootfmacros|\Means
   |otfmacros| の否定。
+  \Note 0.6版より既定を |otfmacros| に変更した。
 \item |bigcode|(既定)\Means
   {\upTeX}でのToUnicode CMapとして既定のUTF8-UCSの代わりに\ 
   UTF8-UTF16を用いる。

Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def	2020-10-06 21:35:11 UTC (rev 56572)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-ajm.def	2020-10-06 21:58:35 UTC (rev 56573)
@@ -11,7 +11,7 @@
 
 %% package declaration
 \NeedsTeXFormat{pLaTeX2e}
-\ProvidesFile{pxjahyper-ajm.def}[2020/09/27 v0.5a]
+\ProvidesFile{pxjahyper-ajm.def}[2020/10/04 v0.5b]
 
 %% avoid multiple loading
 \csname pxjahyperajmLoaded\endcsname

Added: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty	2020-10-06 21:58:35 UTC (rev 56573)
@@ -0,0 +1,147 @@
+%%
+%% This is file 'pxjahyper-enc.sty'.
+%%
+%% Copyright (c) 2012-2020 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}
+\ProvidesPackage{pxjahyper-enc}[2020/10/05 v0.6-pre]
+\def\pxhe at pkgname{pxjahyper-enc}
+\providecommand{\bxDebug}[1]{}
+
+%--------------------------------------- package options
+
+%% variables
+\let\pxhe at driver=d
+
+% driver options
+\DeclareOption{dvipdfmx}{%
+  \let\pxhe at driver=d\relax
+}
+\DeclareOption{dvips}{%
+  \let\pxhe at driver=s\relax
+}
+\DeclareOption{nodvidriver}{%
+  \let\pxhe at driver=0\relax
+}
+% dispatch
+\ProcessOptions*
+
+%--------------------------------------- user interface
+
+%% variables
+\let\pxhe at bigcode=t
+\let\pxhe at default@tounicode=t
+
+%%<*> \suppressbigcode
+\@onlypreamble\suppressbigcode
+\newcommand*\suppressbigcode{%
+  \global\let\pxhe at bigcode=f\relax
+}
+
+%%<*> \suppressdefaulttounicode
+\@onlypreamble\suppressdefaulttounicode
+\newcommand*\suppressdefaulttounicode{%
+  \global\let\pxhe at default@tounicode=f\relax
+}
+
+%%<+> \pxjahyperToUnicodeSpecial{<name>}
+\newcommand*\pxjahyperToUnicodeSpecial[1]{%
+  \edef\pxhe at tmpa{%
+    \noexpand\pxhe at begin@dvi at hook{\special{pdf:tounicode #1}}%
+  }\pxhe at tmpa
+}
+
+%--------------------------------------- environment
+
+%% check
+\ifx d\pxhe at driver\else
+  \ifx 0\pxhe at driver\else
+    \PackageError\pxhe at pkgname
+     {Bad driver option}
+     {Package loading is aborted right now.}
+  \fi
+  \let\pxhe at begin@dvi at hook\@gobble
+\expandafter\endinput\fi\relax
+
+%% switch 'pxhe at new@hook at system'
+\newif\ifpxhe at new@hook at system
+\@ifl at t@r\fmtversion{2020/10/01}{\pxhe at new@hook at systemtrue}{}
+
+%% \pxhe at jcode
+\ifnum     \jis"2121="8140
+  \let\pxhe at jcode=s\relax
+\else\ifnum\jis"2121="A1A1
+  \let\pxhe at jcode=e\relax
+\else\ifnum\jis"2121="3000
+  \let\pxhe at jcode=u\relax
+\fi\fi\fi
+\ifx\pxhe at jcode\@undefined
+  \PackageError\pxhe at pkgname
+   {Unknown internal kanji code}
+   {Package loading is aborted right now.}
+  \expandafter\endinput
+\fi
+
+%--------------------------------------- begin-dvi hook (new)
+\ifpxhe at new@hook at system
+
+%% \pxhe at hook@label
+\def\pxhe at hook@label{pxjahyper/enc}
+
+%% \pxhe at begin@dvi at hook{<text>}
+\def\pxhe at begin@dvi at hook#1{%
+  \AddToHook{shipout/firstpage}[\pxhe at hook@label]{#1}%
+}
+
+%% declare necessary rules
+\DeclareHookRule{shipout/firstpage}{\pxhe at hook@label}{<}{hyperref}
+
+\fi
+%--------------------------------------- begin-dvi hook (old)
+\ifpxhe at new@hook at system\else
+
+%% packages
+\RequirePackage{atbegshi}[2011/10/05]% v1.16
+
+%% \pxhe at begin@dvi at hook{<text>}
+\def\pxhe at begin@dvi at hook#1{%
+  \begingroup
+    \toks\z@{#1}%
+    \toks\tw@\expandafter{\AtBegShi at HookFirst}%
+    \xdef\AtBegShi at HookFirst{\the\toks@\the\toks\tw@}%
+  \endgroup
+}
+
+\fi
+%--------------------------------------- default tounicode special
+
+%% \pxhe at cmap@name
+\def\pxhe at cmap@name{%
+  \if e\pxhe at jcode % euc
+    EUC-UCS2%
+  \else\if s\pxhe at jcode % sjis
+    90ms-RKSJ-UCS2%
+  \else\if t\pxhe at bigcode % ucs, bigcode
+    UTF8-UTF16%
+  \else % ucs, no bigcode
+    UTF8-UCS2%
+  \fi\fi\fi
+}
+
+%% \pxhe at do@default at tounicode
+\def\pxhe at do@default at tounicode{%
+  \if t\pxhe at default@tounicode
+    \special{pdf:tounicode \pxhe at cmap@name}%
+  \fi
+}
+\pxhe at begin@dvi at hook{\pxhe at do@default at tounicode}
+
+%--------------------------------------- done
+\endinput
+%% EOF


Property changes on: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper-enc.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty
===================================================================
--- trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty	2020-10-06 21:35:11 UTC (rev 56572)
+++ trunk/Master/texmf-dist/tex/platex/pxjahyper/pxjahyper.sty	2020-10-06 21:58:35 UTC (rev 56573)
@@ -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 at 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 at uptex
 \newif\ifpxhy at etex
 \newif\ifpxhy at etoolbox
+\newif\ifpxhy at new@hook at system
 \let\pxhy at jcode\@undefined
 \newif\ifpxhy at tounicode
 \newif\ifpxhy at zerox
@@ -102,8 +102,10 @@
 \DeclareOption{nootfcid}{%
   \pxhy at otfcidfalse
 }
+\pxhy at otfmacrostrue
 \DeclareOption{otfmacros}{%
   \pxhy at otfmacrostrue
+  \let\pxhy at otfcid@given=t
 }
 \DeclareOption{nootfmacros}{%
   \pxhy at otfmacrosfalse
@@ -168,6 +170,9 @@
   \expandafter\endinput
 \fi
 
+%% Check for the new hook system.
+\@ifl at t@r\fmtversion{2020/10/01}{\pxhy at new@hook at systemtrue}{}
+
 %% Check the internal jcode.
 \ifnum     \jis"2121="8140
   \let\pxhy at jcode=s\relax
@@ -215,7 +220,6 @@
 \fi
 % otfmacros forces use of otfcid.
 \ifpxhy at otfmacros
-  \let\pxhy at otfcid@given=t
   \pxhy at otfcidtrue
 \fi
 % otfcid requires upTeX or out2uni.
@@ -228,16 +232,17 @@
   \fi
 \fi\fi
 
-\iffalse
-\typeout{%
+\bxDebug{****pxjahyper env^^J%
 pxhy at ptex = \ifpxhy at ptex true\else false\fi^^J%
 pxhy at uptex = \ifpxhy at uptex true\else false\fi^^J%
+pxhy at etex = \ifpxhy at etex true\else false\fi^^J%
+pxhy at etoolbox = \ifpxhy at etoolbox true\else false\fi^^J%
+pxhy at new@hook at system = \ifpxhy at new@hook at system true\else false\fi^^J%
 pxhy at jcode = \meaning\pxhy at jcode^^J%
 pxhy at tounicode = \ifpxhy at tounicode true\else false\fi^^J%
 pxhy at zerox = \ifpxhy at zerox true\else false\fi^^J%
 pxhy at driver = \the\pxhy at driver^^J%
 }
-\fi
 
 %--------------------------------------- Helpers
 
@@ -246,20 +251,35 @@
 \let\pxhy at mk\indent % unexpandable
 
 %% \pxhy at out@special{<text>}
-\ifx\AddToHook\@undefined %------- without hook system
 \def\pxhy at out@special#1{%
+  \edef\pxhy at tmpa{%
+    \noexpand\pxhy at begin@dvi at enc@hook{\special{#1}}%
+  }\pxhy at tmpa
+}
+
+%% \pxhy at begin@dvi at hook{<text>}
+%% \pxhy at begin@dvi at enc@hook{<text>}
+\ifpxhy at new@hook at system
+  \def\pxhy at begin@dvi at hook#1{%
+    \AddToHook{shipout/firstpage}{#1}%
+  }
+  \DeclareHookRule{shipout/firstpage}{.}{>}{hyperref}
+  \def\pxhy at begin@dvi at 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 at begin@dvi at enc@hook#1{%
   \begingroup
-    \toks\z@{\special{#1}}%
+    \toks\z@{#1}%
     \toks\tw@\expandafter{\AtBegShi at HookFirst}%
     \xdef\AtBegShi at HookFirst{\the\toks@\the\toks\tw@}%
   \endgroup
 }
-\else                     %------- with hook system
-\def\pxhy at out@special#1{%
-  \AddToHook{shipout/firstpage}[./urgent]{\special{#1}}%
-}
-\DeclareHookRule{shipout/firstpage}{./urgent}{<}{hyperref}
-\DeclareHookRule{shipout/firstpage}{.}{>}{hyperref}
+  \def\pxhy at begin@dvi at hook#1{%
+    \AtBeginShipoutFirst{#1}%
+  }
 \fi
 
 %% \pxhy at get@jchar{<num>}
@@ -311,6 +331,10 @@
 
   \ifnum\pxhy at driver=\pxhy at driver@dvipdfmx %<*dvipdfmx>
     %% dvipdfmx
+    \IfFileExists{pxjahyper-enc.sty}{% FIXME: TRANSIENT CODE
+    \RequirePackage{pxjahyper-enc}[]%
+    \ifpxhy at bigcode\else \suppressbigcode \fi
+    }{%else
     \if e\pxhy at jcode % euc
       \pxhy at out@special{pdf:tounicode EUC-UCS2}
     \else\if s\pxhy at jcode % sjis
@@ -320,6 +344,7 @@
     \else
       \pxhy at out@special{pdf:tounicode UTF8-UCS2}
     \fi\fi\fi
+    }%
   \fi                           %</dvipdfmx>
 
 \fi
@@ -345,12 +370,10 @@
         \expandafter\pxhy at next\the\@tempcnta\relax
         \paperwidth=\pxhy at tmpa\paperwidth
         \paperheight=\pxhy at tmpa\paperheight
-        \xdef\pxhy at spec@papersize{%
-          papersize=\the\paperwidth,\the\paperheight
-        }%
-        \AtBeginShipoutFirst{%
-          \special{\pxhy at spec@papersize}%
-        }
+        \edef\pxhy at tmpa{%
+          \noexpand\pxhy at begin@dvi at hook{%
+            \special{papersize=\the\paperwidth,\the\paperheight}}%
+        }\pxhy at tmpa
       \endgroup
     \fi\fi
   \fi



More information about the tex-live-commits mailing list.