From d827b0bed5d4482d0f3184ce42a8c047d23f4f9c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 13 Dec 2020 22:04:20 +0000 Subject: ptex-manual (13dec20) git-svn-id: svn://tug.org/texlive/trunk@57128 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/ptex/ptex-manual/README.md | 2 +- .../texmf-dist/doc/ptex/ptex-manual/eptexdoc.pdf | Bin 347556 -> 348138 bytes .../texmf-dist/doc/ptex/ptex-manual/eptexdoc.tex | 9 +- .../doc/ptex/ptex-manual/ptex-guide-en.pdf | Bin 98937 -> 104080 bytes .../doc/ptex/ptex-manual/ptex-guide-en.tex | 162 +++++++++++++-------- .../doc/ptex/ptex-manual/ptex-manual.pdf | Bin 329490 -> 284296 bytes .../doc/ptex/ptex-manual/ptex-manual.tex | 46 +++++- 7 files changed, 151 insertions(+), 68 deletions(-) diff --git a/Master/texmf-dist/doc/ptex/ptex-manual/README.md b/Master/texmf-dist/doc/ptex/ptex-manual/README.md index 37291ae17aa..f3c3c872cb0 100644 --- a/Master/texmf-dist/doc/ptex/ptex-manual/README.md +++ b/Master/texmf-dist/doc/ptex/ptex-manual/README.md @@ -36,6 +36,6 @@ the 3-clause BSD license (see [LICENSE](./LICENSE)). ## Release Date -2020-03-21 +2020-12-13 Japanese TeX Development Community diff --git a/Master/texmf-dist/doc/ptex/ptex-manual/eptexdoc.pdf b/Master/texmf-dist/doc/ptex/ptex-manual/eptexdoc.pdf index 34de3a3c6dd..5ad5ede5901 100644 Binary files a/Master/texmf-dist/doc/ptex/ptex-manual/eptexdoc.pdf and b/Master/texmf-dist/doc/ptex/ptex-manual/eptexdoc.pdf differ diff --git a/Master/texmf-dist/doc/ptex/ptex-manual/eptexdoc.tex b/Master/texmf-dist/doc/ptex/ptex-manual/eptexdoc.tex index 9c22097875f..df22ab97f8f 100644 --- a/Master/texmf-dist/doc/ptex/ptex-manual/eptexdoc.tex +++ b/Master/texmf-dist/doc/ptex/ptex-manual/eptexdoc.tex @@ -1,5 +1,5 @@ %#!make eptexdoc.pdf -\documentclass[a4paper,11pt,nomag]{jsarticle} +\documentclass[a4paper,11pt,nomag,dvipdfmx]{jsarticle} \usepackage[bold,deluxe]{otf} \input fam256p.tex @@ -12,7 +12,7 @@ \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{booktabs,enumitem,multicol} -\usepackage[dvipdfmx,hyperfootnotes=false]{hyperref} +\usepackage[hyperfootnotes=false]{hyperref} \usepackage{pxjahyper} \usepackage{hologo} \usepackage{makeidx}\makeindex @@ -902,7 +902,10 @@ abcfi\the\lastnodechar, abc\char"1C \the\lastnodechar \begin{verbatim} \epTeXinputencoding sjis \end{verbatim} - のように,は|{}|で囲まないこと. + のように,は|{}|で囲まないこと\footnote{\TeX\ Live 2020以降, + \.{input}プリミティブでブレースで囲まれたファイル名指定が可能に + なった(r53729)ことに付随して,\.{epTeXinputencoding}でもブレースで + 囲んだの指定が可能となった.}. の末尾は,空白トークンや展開不能トークンによって区切られる. % scan_file_name で を取得しているので, % \epTeXinputencoding "euc" \epTeXinputencoding ""e""u""c"" も OK. diff --git a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-guide-en.pdf b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-guide-en.pdf index eec4e67a3a7..a0976ef4522 100644 Binary files a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-guide-en.pdf and b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-guide-en.pdf differ diff --git a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-guide-en.tex b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-guide-en.tex index 66c651cc761..08bc2ecf30d 100644 --- a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-guide-en.tex +++ b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-guide-en.tex @@ -1,19 +1,19 @@ %#!make ptex-guide-en.pdf -\documentclass[a4paper,11pt]{article} +\documentclass[a4paper,11pt,dvipdfmx]{article} \usepackage[textwidth=42zw,lines=40,truedimen,centering]{geometry} %%%%%%%%%%%%%%%% % additional packages \usepackage{amsmath} -\usepackage{array}\usepackage[all]{xy} +\usepackage{array} +\usepackage[all]{xy} \SelectTips{cm}{} -%\usepackage[dvipdfmx]{graphicx} \usepackage[T1]{fontenc} \usepackage{booktabs,enumitem,multicol} \usepackage[defaultsups]{newpxtext} \usepackage[zerostyle=c,straightquotes]{newtxtt} \usepackage{newpxmath} -\usepackage[dvipdfmx,hyperfootnotes=false]{hyperref} +\usepackage[hyperfootnotes=false]{hyperref} \usepackage{pxjahyper} \usepackage{hologo} \usepackage{xspace} @@ -32,6 +32,7 @@ } \makeatother +\def\file#1{\textsf{#1}} \def\code#1{\texttt{#1}} %%%%%%%%%%%%%%%% @@ -49,10 +50,15 @@ \MakeShortVerb*{|} %%%%%%%%%%%%%%%% +% foreign text -> italic +\def\Foreign#1{\textit{#1}} + % logos -\def\epTeX{$\varepsilon$-\pTeX}\def\eTeX{$\varepsilon$-\TeX} -\def\eupTeX{$\varepsilon$-\upTeX}\def\upTeX{u\pTeX} -\def\pTeX{p\kern-.10em\TeX} +\def\eTeXpre{$\varepsilon$-} +\def\eTeX{\leavevmode\hbox{\eTeXpre\TeX}} +\def\epTeX{\leavevmode\hbox{\eTeXpre\pTeX}} +\def\eupTeX{\leavevmode\hbox{\eTeXpre\upTeX}} +\def\pTeX{p\kern-.10em\TeX}\def\upTeX{u\pTeX} \def\pLaTeX{p\LaTeX}\def\upLaTeX{u\pLaTeX} \def\pdfTeX{pdf\TeX} \def\OMEGA{$\Omega$} @@ -94,17 +100,16 @@ We hope that this document helps authors of packages or classes to proceed with supporting \pTeX\ family smoothly. \begin{quotation} -Note: This English edition (\jobname.pdf) is \emph{not} meant -to be a complete translation of Japanese edition (ptex-manual.pdf). -For example, this document does not cover the following aspects of \pTeX: -\begin{itemize} - \item Typesetting conventions of Japanese characters - \item Details of vertical writing -\end{itemize} -For beginners of writing Japanese texts, -please refer to the Japanese edition. +Note: This English guide (\file{\jobname.pdf}) is \emph{not} meant +to be a complete translation of Japanese manual (\file{ptex-manual.pdf}). +For example, this document does not cover issues regarding Japanese typesettings. +If you are interested in typesetting conventions of Japanese text, please also +refer to \file{japanese.pdf} distributed with \Pkg{babel-japanese}. \end{quotation} +This document is maintained at: +\url{https://github.com/texjporg/ptex-manual/} + \tableofcontents @@ -117,25 +122,54 @@ please refer to the Japanese edition. %%% pTeX とその仲間 \section{\pTeX\ and its variants} -% [TODO] \pTeX, \upTeX, \epTeX, \eupTeX を簡単に紹介 +The figure below shows the relationship between engines. +\[ +\xymatrix@ur{ + \text{\TeX} \ar[r]\ar[d] & \text{\eTeX} \ar[r]\ar[d] + & \text{\fbox{\pdfTeX}} \\ + \text{\pTeX} \ar[r]\ar[d] & \text{\fbox{\epTeX}} \ar[d] &\\ + \text{\upTeX} \ar[r] & \text{\fbox{\eupTeX}} & +} +\] -%%% e-(u)pTeX の話がメイン -There is no advantage to choose \pTeX/\upTeX\ over \epTeX/\eupTeX, -so we focus mainly on \epTeX/\eupTeX. +\pTeX\ is an old Japanese-specific extension of \TeX82, +which aims to support proper typesetting of Japanese text +but only supports a limited character set, JIS~X~0208 (6879 characters). + +\upTeX\ is developed as an extension of \pTeX\ to support full Unicode +characters. It also includes extensions to overcome the difficulties of +\pTeX\ in processing 8-bit Latin characters due to conflicts with +legacy multibyte Japanese encodings. -% [TODO] pLaTeX/upLaTeX も e- で走っていて,これで十分であると付け加える -% [TODO] 既に pTeX/upTeX が暗に e-pTeX/e-upTeX を指す文献もあることに言及 +\epTeX\ and \eupTeX\ are \eTeX\ extensions of \pTeX\ and \upTeX\ respectively. +In the current release, some extensions derived from \pdfTeX\ and \OMEGA\ are +also available. + +%%% 際立った pTeX 系列の特徴 +\section{Eminent characteristics of \pTeX\ family} + +The most important characteristics of \pTeX\ family can be +summarized as follows: +%%% 欧文と和文が別個に存在する・縦組がある +\begin{itemize} + \item Japanese characters are interpreted and handled completely apart from + Western characters. If a pair of two or more 8-bit codes in the input + matches the pattern of Japanese character codes, it is regarded as one + Japanese character and given a different \.{catcode} (\.{kcatcode}) value. + \item There are two text directions; horizontal (\Foreign{yoko-gumi}; 横組) + and vertical (\Foreign{tate-gumi}; 縦組). + Two directions can be mixed even within a single document. +\end{itemize} %%% 欧文 TeX との互換性 -\section{Compatibility with Western \TeX} +\section{Compatibility with Western \TeX}\label{compat} %%% pTeX/upTeX は Knuthian TeX に対してほぼ上位互換 \pTeX/\upTeX\ are almost upward compatible with Knuthian \TeX, however, they do not pass the TRIP test. %%% 入力の8bitの扱いが異なる。フォントの8bitはそのまま -In \pTeX/\upTeX, input handling is different from Knuthian \TeX; -if a pair of two or more 8-bit codes matches Japanese character code, -it is regarded as one Japanese character. +The most important difference lies in the handling of 8-bit code inputs; +some 8-bit Latin characters may be subject to the encoding conversion. There is no difference in handling 8-bit TFM font. %%% e-pTeX/e-upTeX は e-TeX に対してほぼ上位互換 @@ -144,12 +178,17 @@ however, input handling is similar to \pTeX/\upTeX. It does not pass the e-TRIP test. %%% だけど e-TeX はもうなく,pdfTeX の DVI モードがあるだけ That said, please note that ``raw \eTeX'' is unavailable anymore -in \TeX\ Live and derived distributions; +in \TL and derived distributions; they provide a command |etex| only as ``DVI mode of \pdfTeX.'' %%% e-pTeX/e-upTeX は pdfTeX の DVI モードに対して上位互換ではない -We should note that +You should note that \epTeX/\eupTeX\ are \emph{not} upward compatible with DVI mode of \pdfTeX, -which will be discussed later in section \ref{dvi-pdftex}. +which will be discussed later in Section \ref{dvi-pdftex}. + +%%% e-(u)pTeX の話がメイン +There is no advantage to choose \pTeX/\upTeX\ over \epTeX/\eupTeX, +so we focus mainly on \epTeX/\eupTeX. +% [TODO] 既に pTeX/upTeX が暗に e-pTeX/e-upTeX を指す場合もある %%% LaTeX ムニャムニャ \section{\LaTeX\ on \pTeX/\upTeX\ --- \pLaTeX/\upLaTeX} @@ -157,7 +196,7 @@ which will be discussed later in section \ref{dvi-pdftex}. %%% pLaTeX と upLaTeX ムニャムニャ Formats based on \LaTeX\ is called \pLaTeX\ when running on \pTeX/\epTeX, and called \upLaTeX\ when running on \upTeX/\eupTeX. -In recent versions (around 2011) of \TeX\ Live and its derivatives, +In recent versions (around 2011) of \TL and its derivatives, the default engines of \pLaTeX\ and \upLaTeX\ are \epTeX\ and \eupTeX. That is, the command |platex| starts \epTeX\ (not \pTeX) with preloaded format |platex.fmt|. @@ -167,9 +206,9 @@ In the kernel level (|platex.ltx| and |uplatex.ltx|), \pLaTeX\ and \upLaTeX\ adds some additional commands related to the followings: \begin{itemize} - \item Selection of Japanese fonts - \item Crop marks (called ``tombow'') for printings - \item Adjustment for mixing horizontal and vertical texts + \item Selection of Japanese fonts, + \item Crop marks (called \Foreign{tombow}; トンボ) for printings, + \item Adjustment for mixing horizontal and vertical texts. \end{itemize} %%% author レベルでは LaTeX とほぼ互換,ただし例外あり For authors, \pLaTeX/\upLaTeX\ are almost upward compatible with @@ -184,22 +223,7 @@ original \LaTeX, except for the followings: \end{itemize} %%% developer レベルでは pdfTeX 拡張や pLaTeX カーネルでムニャムニャ For developers, additional care may be needed, -for changes in the kernel macros and/or absence of \pdfTeX\ features. - -%%% 際立った pTeX 系列の特徴 -\section{Eminent characteristics of \pTeX/\upTeX} - -The most important characteristics of \pTeX/\upTeX\ can be -summarized as follows: -%%% 欧文と和文が別個に存在する・縦組がある -\begin{itemize} - \item Japanese characters are interpreted and handled completely apart from - Western characters. - \item Texts can be aligned vertically, called ``tate-gumi'' (縦組). - The horizontal alignment of texts is called ``yoko-gumi'' (横組), - and both ``tate-gumi'' and ``yoko-gumi'' can be mixed - even within a single document. -\end{itemize} +for changes in the kernel macros and/or the absence of \pdfTeX\ features. \newpage @@ -293,12 +317,12 @@ Knuthian \TeX, as long as the following conditions are met: However, some additional DVI commands, which are defined in the standard \cite{dvistd0} but never used in \TeX82, can come out. \begin{itemize} - \item |set2| (129), |put2| (134): - Appears in both \pTeX\ and \upTeX\ DVI. - Used to typeset a Japanese character with 2-byte code. - \item |set3| (130), |put3| (135): - Appears in only \upTeX\ DVI. - Used to typeset a Japanese character with 3-byte code. + \item |set2| (129): % |put2| (134) seems to be unused + Used to typeset a Japanese character with 2-byte code + (both \pTeX\ and \upTeX). + \item |set3| (130): % |put3| (135) seems to be unused + Used to typeset a Japanese character with 3-byte code + (\upTeX\ only). \end{itemize} When \pTeX\ is going to typeset a Japanese character into DVI, it is encoded in JIS, which is always a 2-byte code. @@ -790,7 +814,7 @@ since \pTeX\ family does not support \.{lccode} outside 0--255. \.{kansuji} is an expandable primitive like \.{number} or \.{romannumeral}, and it converts an integer into its corresponding kanji notation -called ``kansuji'' (漢数字). The important point here is that +called \Foreign{kansuji} (漢数字). The important point here is that the number-kanji mapping can be altered by \.{kansujichar}. Example 1: equivalent to |\def\X{あ}| (JIS code \code{0x2422} is ``あ''): @@ -870,10 +894,28 @@ These primitives in \epTeX\ and \eupTeX\ take a valid character code %%% pdfTeX と違うところ \subsection{Difference from \pdfTeX\ in DVI mode}\label{dvi-pdftex} -As stated above, -\epTeX/\eupTeX\ are \emph{not} upward compatible with DVI mode of \pdfTeX. +As stated in Section \ref{compat}, \epTeX/\eupTeX\ are +\emph{not} upward compatible with DVI mode of \pdfTeX, +which is available as the |etex| command in \TL. +Here we list some important differences: %%% pdfTeX の DVI モードにあって e-(u)pTeX にないプリミティブ +First, some \pdfTeX-specific primitives are absent. Examples: +\begin{itemize} + \item All primitives specific to PDF output: + \.{pdfoutput}, \.{pdfinfo}, \.{pdfobj} etc.\footnote{% + \epTeX/\eupTeX\ has primitives \.{pdfpagewidth} and \.{pdfpageheight}; + this is just because they were convenient for implementing \.{pdfsavepos}, + and their behavior is somewhat different from that of \pdfTeX. + Also note that \epTeX/\eupTeX\ does not have \.{pdfhorigin} + and \.{pdfvorigin}.} + \item All primitives related to micro-typography: + \.{pdffontexpand}, \.{pdfprotrudechars}, etc. + \item Some primitives related to handling of strings: + \.{pdfescapestring}, \.{pdfescapehex} etc. +\end{itemize} + + %%% その他ムニャムニャ %%% ファイルの文字コードはどうするか @@ -915,8 +957,8 @@ between characters. %%% 欧文とは別個 \pTeX\ family can have 3 different ``current'' fonts at the same time; -a Latin font, a Japanese font for horizontal writing (``yoko-gumi''), -and a Japanese font for vertical writing (``tate-gumi''). +a Latin font, a Japanese font for horizontal writing (\Foreign{yoko-gumi}), +and a Japanese font for vertical writing (\Foreign{tate-gumi}). The first one is the same as in the Knuthian \TeX, which is defined in a standard TFM format. The latter two are specific to \pTeX\ family, which are defined diff --git a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.pdf b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.pdf index 681ba5f40a8..04c641cdc76 100644 Binary files a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.pdf and b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.pdf differ diff --git a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.tex b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.tex index 1c69ab24a03..d76fbf3f6f3 100644 --- a/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.tex +++ b/Master/texmf-dist/doc/ptex/ptex-manual/ptex-manual.tex @@ -1,5 +1,5 @@ %#!make ptex-manual.pdf -\documentclass[a4paper,11pt,nomag]{jsarticle} +\documentclass[a4paper,11pt,nomag,dvipdfmx]{jsarticle} \usepackage[textwidth=42zw,lines=40,truedimen,centering]{geometry} %%%%%%%%%%%%%%%% @@ -13,7 +13,7 @@ \usepackage[defaultsups]{newpxtext} \usepackage[zerostyle=c,straightquotes]{newtxtt} \usepackage{newpxmath} -\usepackage[dvipdfmx,hyperfootnotes=false]{hyperref} +\usepackage[hyperfootnotes=false]{hyperref} \usepackage{pxjahyper} \usepackage{hologo} \usepackage{makeidx}\makeindex @@ -1045,9 +1045,12 @@ JFMファイルもTFMファイルと同様の情報を持つが, \end{cslist} \begin{dangerous} - 細かい話をすれば,\pTeX のフォーマット作成時に和文フォントを + 細かい話をすれば,\pTeX のini modeでのフォーマット作成時に和文フォントを 何も選択しなければ,|\fontname\jfont|が|\nullfont|となり, - また和文文字を入力してもノードは作られないので, + また和文文字を入力してもノードは作られない\footnote{ただし, + $\.{tracinglostchars}>0$でも + \code{Missing character: There is no あ in font nullfont!}のような + 警告は出ない.}ので, 「和文版|\nullfont|が選択されている」と言えなくもない. ただ,いったん実際の和文フォントを選択した後に 「和文版|\nullfont|を選択する」という制御綴は作れないと思われる. @@ -1419,6 +1422,38 @@ has been |\let| equal to a non-active character token. 「原理的に文字コードが取り得ない値」に変更した(\cite{build68}). \end{dangerous} +\newpage + +%%%%% +\part{\pTeX の出力するDVIフォーマット} + +\pTeX が出力するDVIファイルは,欧文の横組のみを行っていれば +オリジナルの\TeX が出力するDVIファイルと全く同様に解釈できる. +一方,\pTeX で和文文字を出力する場合,および組方向変更を行う場合は +以下のDVI命令が使用される. +|set2|,|set3|は\cite{dvistd0}で定義されているが, +オリジナルの\TeX では使われていない. +|dir|は\cite{dvistd0}で定義されておらず,\pTeX の独自拡張である. +\begin{itemize} + \item |set2| (129)\quad $\mathit{c}[2]$\\ + コード番号が$c$ ($\mathtt{0x100} \le c < \mathtt{0x10000}$)の + 文字を印字し,参照点を移動する. + \pTeX ではJISコード,\upTeX ではUCS-2が用いられる. + \item |set3| (130)\quad $\mathit{c}[3]$\\ + コード番号が$c$ ($\mathtt{0x10000} \le c < \mathtt{0x1000000}$)の + 文字を印字し,参照点を移動する. + \upTeX ではUCS-4の下位3バイトが用いられる(\pTeX では現れない). + \item |dir| (255)\quad $\mathit{d}[1]$\\ + 組方向を変更する.$\mathit{d}[1]=0$が横組, + $\mathit{d}[1]=1$が縦組,$\mathit{d}[1]=3$がDtoU組を示す. +\end{itemize} + +\pTeX が出力するDVIファイルのプリアンブル部のフォーマットIDは, +オリジナルの\TeX と同じく常に2である. +一方,ポストアンブル部の|post_post|命令に続くフォーマットIDは +\pTeX でも通常2であるが,\pTeX の拡張DVI命令である|dir|が +使用されている場合のみ3にセットされる. + \begin{thebibliography}{99} \bibitem{topic} Victor Eijkhout, \textit{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.\\ @@ -1458,6 +1493,9 @@ has been |\let| equal to a non-active character token. \bibitem{build68} aminophen, 「upTeX の |\if| と |\ifcat|」, 2019/01/17,\\ \url{https://github.com/texjporg/tex-jp-build/issues/68} + \bibitem{dvistd0} TUG DVI Standards Working Group, + \textit{The DVI Driver Standard, Level 0}.\\ + \url{https://ctan.org/pkg/dvistd} \end{thebibliography} \newpage -- cgit v1.2.3