From 893b65e5d4c0b7cb8ebbfca9ee6b090b9a4a182c Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 14 Jun 2020 03:02:26 +0000 Subject: CTAN sync 202006140302 --- language/japanese/pxjahyper/README-ja.md | 15 ++- language/japanese/pxjahyper/README.md | 8 +- language/japanese/pxjahyper/pxjahyper-ajm.def | 13 +-- language/japanese/pxjahyper/pxjahyper.pdf | Bin 83272 -> 116816 bytes language/japanese/pxjahyper/pxjahyper.sty | 137 +++++++++++++++++++++++--- language/japanese/pxjahyper/pxjahyper.tex | 96 ++++++++++++++++-- 6 files changed, 232 insertions(+), 37 deletions(-) (limited to 'language/japanese/pxjahyper') diff --git a/language/japanese/pxjahyper/README-ja.md b/language/japanese/pxjahyper/README-ja.md index 1c607b41ca..1e61d70fc3 100644 --- a/language/japanese/pxjahyper/README-ja.md +++ b/language/japanese/pxjahyper/README-ja.md @@ -12,14 +12,20 @@ LaTeX: pLaTeX 上での hyperref のサポート ### 前提環境 * フォーマット: LaTeX - * エンジン: pTeX、upTeX、pTeX-ng + * エンジン: pTeX、upTeX、pTeX-ng + ※一部の機能では e-TeX 拡張が必要。 * DVIウェア: dvipdfmx * 依存パッケージ: + - atbegshi - hyperref + * 一部の機能で必要なパッケージ: + - japanese-otf + - etoolbox + - bxjatoucs ### インストール - - `*.sty` → $TEXMF/tex/platex/PXjahyper + - `*.sty`, `*.def` → $TEXMF/tex/platex/PXjahyper ### ライセンス @@ -35,6 +41,11 @@ pxjahyper パッケージ ー 本体 更新履歴 -------- + * Version 0.5 〈2020/06/13〉 + - `otfmacros` オプションを正式にサポート。 + - `disablecmds` オプションを追加。 + - `none`(`nodvidriver` の別名)を非推奨とする。 + * Version 0.4b 〈2020/04/24〉 - `\copyright` の再定義をやめる。 diff --git a/language/japanese/pxjahyper/README.md b/language/japanese/pxjahyper/README.md index 4c1e22dcbe..b1d28bca54 100644 --- a/language/japanese/pxjahyper/README.md +++ b/language/japanese/pxjahyper/README.md @@ -13,11 +13,16 @@ Japanese. ### System Requirements * TeX format: LaTeX. - * TeX engine: pTeX, upTeX, pTeX-ng. + * TeX engine: pTeX, upTeX, pTeX-ng. + Some features require the e-TeX extension. * DVI-ware: dvipdfmx. * Dependent packages: - atbegshi - hyperref + * Packages required by some features: + - japanese-otf + - etoolbox + - bxjatoucs ### Installation @@ -37,6 +42,7 @@ Please refer to the manual `pxjahyper.pdf` (in Japanese) for detail. Revision History ---------------- + * Version 0.5 〈2020/06/13〉 * Version 0.4b 〈2020/04/24〉 * Version 0.4a 〈2019/11/23〉 * Version 0.4 〈2019/10/25〉 diff --git a/language/japanese/pxjahyper/pxjahyper-ajm.def b/language/japanese/pxjahyper/pxjahyper-ajm.def index 81ce1868df..288f320997 100644 --- a/language/japanese/pxjahyper/pxjahyper-ajm.def +++ b/language/japanese/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/language/japanese/pxjahyper/pxjahyper.pdf b/language/japanese/pxjahyper/pxjahyper.pdf index 4f72b39a18..9d164d0fda 100644 Binary files a/language/japanese/pxjahyper/pxjahyper.pdf and b/language/japanese/pxjahyper/pxjahyper.pdf differ diff --git a/language/japanese/pxjahyper/pxjahyper.sty b/language/japanese/pxjahyper/pxjahyper.sty index 66b070c713..4d83b2a351 100644 --- a/language/japanese/pxjahyper/pxjahyper.sty +++ b/language/japanese/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 diff --git a/language/japanese/pxjahyper/pxjahyper.tex b/language/japanese/pxjahyper/pxjahyper.tex index f8049f8d57..e7387f2386 100644 --- a/language/japanese/pxjahyper/pxjahyper.tex +++ b/language/japanese/pxjahyper/pxjahyper.tex @@ -1,16 +1,17 @@ % 文字コードは UTF-8 % uplatex で組版する \documentclass[uplatex,a4paper]{jsarticle} +\renewcommand{\headfont}{\gtfamily\romanseries{sbc}\sffamily} \usepackage{shortvrb} \MakeShortVerb{\|} \usepackage{bxtexlogo} \bxtexlogoimport{*} -\newcommand{\PkgVersion}{0.4b} -\newcommand{\PkgDate}{2020/04/24} +\newcommand{\PkgVersion}{0.5} +\newcommand{\PkgDate}{2020/06/13} \newcommand{\Pkg}[1]{\textsf{#1}} \newcommand{\Meta}[1]{$\langle$\mbox{}#1\mbox{}$\rangle$} \newcommand{\Note}{\par\noindent ※} -\newcommand{\Means}{~:\quad} +\newcommand{\Means}{:\quad} %----------------------------------------------------------- \begin{document} \title{\Pkg{pxjahyper} パッケージ} @@ -67,8 +68,29 @@ 使えるようにする。 具体的には、当該のAJ1のグリフに“対応”するUnicode文字が あればそれを出力し、なければ(警告を出した上で)削除する。 -\item |nootfcid| \Means +\item |nootfcid|\Means |otfcid| の否定。 + \Note |otfcid| の利用には、エンジンの{\eTeX}拡張および + \Pkg{etoolbox}と\Pkg{bxjatoucs}パッケージインストールが必要。 +\item |disablecmds|(既定)\Means + 「PDF文字列中のテキスト装飾命令の無効化」を有効にする。 + \Note 詳細は\ref{ssec:disablecmds}節を参照。 +\item |nodisablecmds|\Means + |disablecmds| の否定。 +\item |otfmacros|\Means + \Pkg{japanese-otf}付属の\Pkg{ajmacros}パッケージが提供する + 文字入力命令(|\ajMaru|、|\ajLig| 等)をPDF文字列中で + “可能な限り”使えるようにする。 + \Note Unicode文字で表現可能であればそれを出力し、 + なければ代替表現を出力する。 + \Note |otfmacros| を指定する場合は |otfcid| も有効にする必要がある。 + \Note \Pkg{ajmacros}パッケージの多くの命令は“脆弱(fragile)”である。 + そのため、節見出し(|\section| 等の引数)で |\ajMaru| 等の命令を + 使いたい場合は、命令の前に |\protect| 付ける必要がある。 + \footnote{ちなみに、引数がPDF文字列として解釈される場合には、 + |\protect| は全く結果に影響しない。} +\item |nootfmacros|(既定)\Means + |otfmacros| の否定。 \item |bigcode|(既定)\Means {\upTeX}でのToUnicode CMapとして既定のUTF8-UCSの代わりに\ UTF8-UTF16を用いる。 @@ -78,12 +100,13 @@ \Note 0.3a版より既定を |bigcode| に変更した。 \item |dvipdfmx|\Means dvipdfmxを前提とした動作を行う。 -\item |nodriver|/|none|\Means +\item |nodvidriver|\Means dvipdfmxを前提とした動作を抑止する。 - 現状では、この場合には本パッケージは実質的に何の動作も行わない。 + \Note 現状では、この場合には本パッケージは実質的に何の動作も行わない。 + \Note 0.5版より、|nodvidriver| の別名の |none| は非推奨の扱いとする。 \item |auto|(既定)\Means \Pkg{hyperref}のドライバがdvipdfmx用ならば |dvipdfmx|、 - それ以外は |none| の動作。 + それ以外は |nodvidriver| の動作。 \end{itemize} %=========================================================== @@ -92,9 +115,20 @@ 「概要」で述べた機能は(オプション設定に応じて) 自動的に実施される。 -\paragraph{Unicode符号値による入力} +%------------------- +\subsection{Unicode符号値による入力} + PDF文字列入力中で、|\Ux| が以下の意味になる。 PDF文字列以外では |\Ux| は以前の定義(または未定義)に戻る。 +\footnote{|\Ux| という命令名は\Pkg{bxbase}パッケージの +Unicode符号値入力用の命令が使っているものである。 +従って、\Pkg{bxbase}パッケージを読み込んでいれば、 +「PDF文字列と版面出力の両方に使われる」ようなテキストにおいて、 +|\Ux| でUnicode符号値入力が可能になる。 +ただし、Unicode符号値入力用の命令としては +「\Pkg{japanese-otf}パッケージの |\UTF| 命令」 +の方が有名であり、\Pkg{pxjahyper}は |\UTF| も正しく扱えるので、 +こちらを使う方が無難かもしれない。} \begin{itemize} \item |\Ux{|Unicode符号値|}|\Means @@ -109,7 +143,9 @@ out2uni用の出力を行うように設計されているが、 |\UTF| も(PDF文字列中では)|\Ux| と同じ動作 (つまりtounicode用の出力)になるように変更される。 -\paragraph{PDF文字列用の文字命令の定義} +%------------------- +\subsection{PDF文字列用の文字命令の定義} + 以下の命令が提供される。(プリアンブルでのみ使用可能。) \begin{itemize} @@ -138,4 +174,46 @@ PDF文字列中で |\textschwa|(schwa記号)や |\d{t}|(\d{t})が \pxDeclarePdfTextComposite{\d}{t}{}{1E6D} \end{verbatim}\end{quote} +%------------------- +\subsection{PDF文字列用中のテキスト装飾命令の無効化} +\label{ssec:disablecmds} + +PDF文字列は単なるUnicode文字列として扱われるものなので、 +|\textit| や |\large| 等のテキスト装飾用の命令は意味をなさず、 +またそれらの命令の実装はPDF文字列の解釈中は正常に処理できない。 +PDF文字列と版面出力の両方に使われるテキスト(節見出し等) +についてテキスト装飾命令が支障なく使えるように、 +\Pkg{hyperref}では基本的なテキスト装飾命令 +(多くは{\LaTeX}カーネルが提供するもの) +について、「PDF文字列として扱う場合は自動的に無力化 +\footnote{例えば、“|\textit{text}|”や“|{\large text}|”は + 単に“|text|”と書いたものと見なされる。} +する」機構を実装している。 +これにより、例えば節見出しのテキストに“|\textit{text}|”が +含まれていたとすると、 +版面に出力する場合には“\textit{text}”のように装飾が施され、 +一方で、PDF文字列としては“|text|”と解釈されることになる。 + +0.5版以降の\Pkg{pxjahyper}では、この無効化の対象に +「和文用のテキスト装飾命令(およびそれに準じるもの)」 +を追加するようになった。 +以下の命令が対象になる。 + +\begin{itemize} +\item 和文のフォント選択命令\Means + |\textmc| |\gtfamily| |\kanjifamily| |\useroman| |\userelfont| + など +\item 次の{\pLaTeX}カーネル命令\Means + |\<| +\item 次の{\pTeX}プリミティブ\Means + |\inhibitglue| |\|(|no|)|autospacing| |\|(|no|)|autoxspacing| +\item 次の\Pkg{plext}の命令\Means + |\bou| |\kasen| |\rensuji| +\item 次の\Pkg{japanese-otf}の命令\Means + |\textmg| |\mgfamily| |\ltseries| |\ebseries| |\propshape| +\end{itemize} + + + + \end{document} -- cgit v1.2.3