diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /language/japanese/platex-tools |
Initial commit
Diffstat (limited to 'language/japanese/platex-tools')
27 files changed, 1577 insertions, 0 deletions
diff --git a/language/japanese/platex-tools/LICENSE b/language/japanese/platex-tools/LICENSE new file mode 100644 index 0000000000..99a0c323d1 --- /dev/null +++ b/language/japanese/platex-tools/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016-2018 Hironobu Yamashita +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/language/japanese/platex-tools/Makefile b/language/japanese/platex-tools/Makefile new file mode 100644 index 0000000000..a1bc26e10a --- /dev/null +++ b/language/japanese/platex-tools/Makefile @@ -0,0 +1,28 @@ +KANJI = -kanji=utf8 +FONTMAP = -f ipaex.map -f ptex-ipaex.map +TEXMF = $(shell kpsewhich -var-value=TEXMFHOME) + +all: plarray.pdf plextarray.pdf plextdelarray.pdf \ + pxatbegshi.pdf pxftnright.pdf pxmulticol.pdf \ + pxeverysel.pdf pxeveryshi.pdf + +.SUFFIXES: .tex .dvi .pdf +%.dvi: %.tex %.sty + platex $(KANJI) $< + platex $(KANJI) $< + rm *.aux *.log +.dvi.pdf: + dvipdfmx $(FONTMAP) $< + +.PHONY: install clean +install: + mkdir -p ${TEXMF}/doc/platex/platex-tools + cp ./Makefile ${TEXMF}/doc/platex/platex-tools/ + cp ./LICENSE ${TEXMF}/doc/platex/platex-tools/ + cp ./README.md ${TEXMF}/doc/platex/platex-tools/ + cp ./*.pdf ${TEXMF}/doc/platex/platex-tools/ + cp ./*.tex ${TEXMF}/doc/platex/platex-tools/ + mkdir -p ${TEXMF}/tex/platex/platex-tools + cp ./*.sty ${TEXMF}/tex/platex/platex-tools/ +clean: + rm -f *.dvi *.pdf diff --git a/language/japanese/platex-tools/README.md b/language/japanese/platex-tools/README.md new file mode 100644 index 0000000000..51d952a3b8 --- /dev/null +++ b/language/japanese/platex-tools/README.md @@ -0,0 +1,83 @@ +# platex-tools + +This bundle is an extended version of latex-tools bundle developed +by LaTeX team, mainly intended to support pLaTeX2e and upLaTeX2e. +Patches for latex-tools bundle and ms bundle (by Martin Schröder) +and some additional packages are included. + +## Bundle contents + +- plarray.sty: + Patch for array.sty (latex-tools) to improve + compatibility with pLaTeX/upLaTeX kernels. + Can be used on pLaTeX/upLaTeX. +- plextarray.sty: + Patch for array.sty (latex-tools) to improve + compatibility with plext.sty in pLaTeX. + Can be used on pLaTeX/upLaTeX. +- plextdelarray.sty: + Patch for delarray.sty (latex-tools) to improve + compatibility with plext.sty in pLaTeX. + Can be used on pLaTeX/upLaTeX. +- pxftnright.sty: + Patch for ftnright.sty (latex-tools) to support + Japanese classes for vertical writing. + Can be used on pLaTeX/upLaTeX. +- pxmulticol.sty: + Patch for multicol.sty (latex-tools) to support + `\footnote` in vertical writing. + Can be used on pLaTeX/upLaTeX. +- pxeverysel.sty: + Patch for everysel.sty (ms) to improve + compatibility with Japanese font selection in pLaTeX. + Can be used on pLaTeX/upLaTeX. + Previous version of this package (v0.1) was written by + Takayuki YATO in 2015 + (https://gist.github.com/zr-tex8r/48c6910bbbe2f41d72de), + and incorporated into this bundle by his courtesy. +- pxeveryshi.sty: + Patch for everyshi.sty (ms) to support + Japanese classes for vertical writing. + Can be used on pLaTeX/upLaTeX. + Previous version of this package (v0.1) was written by + Takayuki YATO in 2012 + (https://gist.github.com/zr-tex8r/2702969), + and incorporated into this bundle by his courtesy. +- pxatbegshi.sty: + Patch for atbegshi.sty (oberdiek) to support + Japanese classes for vertical writing. + Can be used on pLaTeX/upLaTeX. + The essential part of this package was proposed by + Hironori Kitagawa in 2017. + +The packages "pxgentombow", "gentombow" and "bounddvi" are now distributed +as part of [gentombow](https://github.com/aminophen/gentombow) bundle. + +## Character encoding + +All the package files (.sty) contain ASCII characters only. +All the document files (.tex) are encoded in UTF-8. + +## Installation + +- *.sty -> $TEXMF/tex/platex/platex-tools +- *.tex, *.pdf -> $TEXMF/doc/platex/platex-tools + +## Repository + +The bundle is maintained on GitHub: + https://github.com/aminophen/platex-tools + +You can also obtain this bundle from CTAN: + https://www.ctan.org/pkg/platex-tools + +## License + +The bundle may be distributed and/or modified under the terms of +the 3-clause BSD license (see [LICENSE](./LICENSE)). + +## Release Date + +2018-11-25 + +Hironobu Yamashita diff --git a/language/japanese/platex-tools/plarray.pdf b/language/japanese/platex-tools/plarray.pdf Binary files differnew file mode 100644 index 0000000000..dfa0afcbf7 --- /dev/null +++ b/language/japanese/platex-tools/plarray.pdf diff --git a/language/japanese/platex-tools/plarray.sty b/language/japanese/platex-tools/plarray.sty new file mode 100644 index 0000000000..111592705e --- /dev/null +++ b/language/japanese/platex-tools/plarray.sty @@ -0,0 +1,60 @@ +% +% plarray.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the platex-tools bundle. +% https://github.com/aminophen/platex-tools +% +% This package is expected to be compatible with +% * array.sty in latex-tools +% (2016/10/06 v2.4d -- 2018/09/13 v2.4i) +% * plcore.ltx in platex +% (2001/09/26 v1.2a -- 2018/09/02 v1.3) +% + +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{plarray} + [2018/10/27 v0.1h Tabular extension package for pLaTeX/upLaTeX] +\RequirePackage{array} + +%% patching internal code for array.sty +% +%% remove extra \xkanjiskip (pLaTeX2e 2016/04/17) +\@ifl@t@r{\pfmtversion}{2016/04/17}{\@firstofone}{\@gobble} +{% = for pLaTeX2e 2016/04/17 or newer +\def\@tabular{% + \leavevmode \null + \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup + \let\d@llarend\endgroup + \@tabarray} +\def\endtabular{\endarray $\egroup\null} +\expandafter \let \csname endtabular*\endcsname = \endtabular +}% = +% +%% inhibit JFM glue around tabular cell components (pLaTeX2e 2018/03/09) +\@ifl@t@r{\pfmtversion}{2017/07/29}{\@firstofone}{\@gobble} +{% = for pLaTeX2e 2017/07/29 or newer +% first, provide old definition; there are some known incompatibility +% compared to LaTeX, pLaTeX or array +\def\insert@column{% + \the@toks \the \@tempcnta + \mbox{}\inhibitglue \ignorespaces \@sharp \unskip \unskip + \the@toks \the \count@ \relax} +% if both macros are available, override with new definition +% (= pLaTeX2e 2018/03/09 or later, built on e-(u)pTeX 180226) +\ifx\pltx@next@inhibitglue\@undefined\else + \ifx\removejfmglue\@undefined\else + \def\insert@column{% + \the@toks \the \@tempcnta + \relax \pltx@next@inhibitglue + \ignorespaces \@sharp \unskip \removejfmglue + \the@toks \the \count@ \relax} + \fi +\fi +}% = +% +%% done + +%% all done + +\endinput diff --git a/language/japanese/platex-tools/plarray.tex b/language/japanese/platex-tools/plarray.tex new file mode 100644 index 0000000000..fdb95faf3e --- /dev/null +++ b/language/japanese/platex-tools/plarray.tex @@ -0,0 +1,82 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle}% supports \verb in \footnote +\usepackage{doc} +\usepackage{plarray} +\GetFileInfo{plarray.sty} +\makeatletter +\makeatother +\title{Package \textsf{plarray} \fileversion} +\author{Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +This package \textsf{plarray} provides small patches to \textsf{array} +package (\textsf{latex-tools} bundle) for use with Japanese +p\LaTeX/up\LaTeX. +By loading \textsf{plarray} in addition to/instead of \textsf{array}, +you can avoid conflicts between (u)p\LaTeX\ kernel and \textsf{array}% +\footnote{Below is recent changes introduced to +p\LaTeX/up\LaTeX\ kernels by Japanese \TeX\ Development Community, +which cannot cope with \textsf{array} package: +\begin{itemize} +\item Remove extra \verb+\xkanjiskip+ around tabular environment +\item Inhibit JFM (Japanese \TeX\ font metric) glue + around tabular cell components +\end{itemize} +The package \textsf{plarray} re-adds these changes to \textsf{array}.}. + +If you are going to use both \textsf{plext} and \textsf{array} packages +on p\LaTeX/up\LaTeX, the easiest way is to use \textsf{plextarray}; +please refer to its document. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +\bigskip + +この\textsf{plarray}パッケージは、\textsf{latex-tools}バンドルの +\textsf{array}パッケージをp\LaTeX/up\LaTeX で使うときのwrapperとして +機能します。さらに、\textsf{array}パッケージによって上書きされて +無効化されてしまうp\LaTeX/up\LaTeX カーネルの修正点を再有効化する +働きもします(具体的には、「tabular環境前後に\verb+\xkanjiskip+由来の +余分なアキが入る現象」と、「表のセル内の要素が始め括弧類で始まる場合や +終わり括弧類で終わる場合にJFMグルーが不自然に入る現象」に対処します)。 + +\bigskip +\begin{minipage}{0.45\linewidth} +\begin{verbatim} + \documentclass{jarticle} % if you are using pLaTeX, + \usepackage{plarray} % load this! + \begin{document} + これは表の例です + \begin{tabular}{|>{$}c<{$}|c|}\hline + \exp(x) & 指数関数 \\ \hline + \log(x) & 対数関数 \\ \hline + \end{tabular}% + 終わり + \end{document} +\end{verbatim} +\end{minipage} +\begin{minipage}{0.5\linewidth} + これは表の例です + \begin{tabular}{|>{$}c<{$}|c|}\hline + \exp(x) & 指数関数 \\ \hline + \log(x) & 対数関数 \\ \hline + \end{tabular}% + 終わり +\end{minipage} +\bigskip + +p\LaTeX/up\LaTeX で、\textsf{array}パッケージに加えてさらに +\textsf{plext}パッケージも使いたい場合は、 +\textsf{plextarray}パッケージを読み込むのが簡単です。 + +\end{document} diff --git a/language/japanese/platex-tools/plextarray.pdf b/language/japanese/platex-tools/plextarray.pdf Binary files differnew file mode 100644 index 0000000000..6ebd30fcee --- /dev/null +++ b/language/japanese/platex-tools/plextarray.pdf diff --git a/language/japanese/platex-tools/plextarray.sty b/language/japanese/platex-tools/plextarray.sty new file mode 100644 index 0000000000..ee08eb0bbd --- /dev/null +++ b/language/japanese/platex-tools/plextarray.sty @@ -0,0 +1,121 @@ +% +% plextarray.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the platex-tools bundle. +% https://github.com/aminophen/platex-tools +% +% This package is expected to be compatible with +% * array.sty in latex-tools +% (2016/10/06 v2.4d -- 2018/09/13 v2.4i) +% * plext.sty in platex +% (2001/09/26 v1.2 -- 2018/09/20 v1.2j) +% Largely based on lltjext.sty from LuaTeX-ja project. +% + +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{plextarray} + [2018/10/27 v1.1d Tabular extension package for plext and array] +\RequirePackage{plext} +\RequirePackage{plarray} + +%% save definitions from array.sty +% the <dir> option will be handled later in \@tabarray +\def\array{\col@sep\arraycolsep + \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\def\@halignto{}% + \@tabarray} +\def\tabular{\def\@halignto{}\@tabular} +%% merged definitions from array.sty and plext.sty +% take <dir> option first as in plext.sty, +% which will be passed to \@tabarray +\@namedef{tabular*}{\@ifnextchar<%> + {\p@stabular}{\p@stabular<Z>}} +\def\p@stabular<#1>#2{% + \setlength\dimen@{#2}% + \edef\@halignto{to\the\dimen@}\@tabular<#1>} + +%% patching internal code for array.sty and plext.sty +% +\@ifpackagelater{array}{2018/09/13}{\@firstoftwo}{\@secondoftwo} +{% = for 2018/09/13 v2.4i or newer +\def\@startpbox#1{\bgroup + \color@begingroup + \box@dir\adjustbaseline %% added + \setlength\hsize{#1}\@arrayparboxrestore + \everypar{% + \vrule \@height \ht\@arstrutbox \@width \z@ + \everypar{}}% + }% +}% = +{% = for 2018/04/30 v2.4h or older +\def\@startpbox#1{\bgroup + \box@dir\adjustbaseline %% added + \setlength\hsize{#1}\@arrayparboxrestore + \everypar{% + \vrule \@height \ht\@arstrutbox \@width \z@ + \everypar{}}% + }% +}% = +% +\def\@tabarray{\@ifnextchar<\p@tabarray{\p@tabarray<Z>}} +% +%% merged \@array (from array.sty) and \p@array (from plext.sty) +\def\p@array<#1>[#2]#3{% + %%%%% new code for box direction + \let\box@dir\relax + \iftdir + \if #1y\relax + \let\box@dir\yoko + \@tempcnta=\z@ % \(y)strutbox + \else\if #1z\relax + \@rotswtrue + \let\box@dir\tate + \@tempcnta=\tw@ % \zstrutbox + \else + \let\box@dir\tate + \@tempcnta=\@ne % \tstrutbox + \fi\fi + \else + \if #1t\relax + \let\box@dir\tate + \@tempcnta=\@ne % \tstrutbox + \else + \let\box@dir\yoko + \@tempcnta=\z@ % \(y)strutbox + \fi + \fi + %%%%% new code end + \setbox \@arstrutbox \hbox{\box@dir %% add \box@dir + % the behavior of \strutbox has been changed + % (box resister -> conditional macro) in pLaTeX2e 2017/04/08; + % so, \strutbox should appear after \box@dir is applied. + \@tempcntb=\ifcase\@tempcnta\strutbox + \or\tstrutbox\or\zstrutbox\or\@ctrerr\fi + \@tempdima \ht \@tempcntb + \advance \@tempdima by\extrarowheight + \vrule \@height \arraystretch \@tempdima + \@depth \arraystretch \dp \@tempcntb + \@width \z@}% + \fork@array@option<#1>[#2]% %% merged from plext + \begingroup + \@mkpream{#3}% + % following definition of \@preamble is from plext (\edef -> \xdef), + % but it's not the same as the one in array; why? + \xdef\@preamble{\ialign \noexpand \@halignto + \bgroup \tabskip \z@skip \@arstrut \@preamble + \tabskip \z@skip \cr}% + \endgroup + \@arrayleft + \@begin@alignbox %% defined inside \fork@array@option + \bgroup + \box@dir\adjustbaseline + \let\par\@empty + \let\@sharp##\let\protect\relax + \let\\\@arraycr\let\tabularnewline\\ + \lineskip\z@skip\baselineskip\z@skip\@preamble} +% +\def\endarray{\crcr \egroup \egroup \@end@alignbox \@arrayright \gdef\@preamble{}} +% +%% done + +\endinput diff --git a/language/japanese/platex-tools/plextarray.tex b/language/japanese/platex-tools/plextarray.tex new file mode 100644 index 0000000000..47e1f68e1f --- /dev/null +++ b/language/japanese/platex-tools/plextarray.tex @@ -0,0 +1,157 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle} +\usepackage{doc} +\usepackage{array} +\usepackage{plextarray} +\GetFileInfo{plextarray.sty} +\title{Package \textsf{plextarray} \fileversion} +\author{Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +Package \textsf{array}, included in \textsf{latex-tools} bundle, is +incompatible with \textsf{plext} package on Japanese p\LaTeX. +This is because \textsf{plext} extends \texttt{tabular} and \texttt{array} +environments to add an optional argument for direction specification. +The package \textsf{plextarray} resolves this incompatibility, +and enables coexistence of both extensions provided by \textsf{plext} +and \textsf{array}. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +\section*{Brief explanation of ``\textsf{plext}'' package} + +This section is for people who are not familiar with Japanese p\LaTeX\ +and \textsf{plext} package. + +Package \textsf{plext} extends \texttt{tabular} and \texttt{array} +environments by adding \texttt{<dir>} option, which specifies the +writing direction: +\begin{verbatim} + \begin{tabular}<dir>[pos]{table spec} ... \end{tabular} + \begin{tabular*}<dir>{width}[pos]{table spec} ... \end{tabular*} + \begin{array}<dir>[pos]{table spec} ... \end{array} +\end{verbatim} +The option \texttt{<dir>} permits one of the following three values. +If none of them is specified, the direction inside the environment +is same as that outside the environment. +\begin{quote} + \begin{description} + \item[y] \emph{yoko} direction (horizontal writing) + \item[t] \emph{tate} direction (vertical writing) + \item[z] native direction of \TeX +\end{description} +\end{quote} +The rest of this document is written in Japanese, and includes some +examples of usage. + +\bigskip + +\textsf{latex-tools}バンドルに含まれる\textsf{array}パッケージは、 +p\LaTeX の拡張パッケージである\textsf{plext}パッケージと互換性がありません。 +これは、\textsf{plext}パッケージは、文書中で局所的に組方向を変える「組方向 +オプション」の拡張を持っていますが、これと\textsf{array}パッケージによる拡張 +が衝突してしまうためです\footnote{\textsf{plext}→\textsf{array}の順に読み込む +と\textsf{plext}による拡張がキャンセルされて使えなくなります。 +逆に\textsf{array}→\textsf{plext}の順に読み込むとエラーが出てしまいます。}。 +この\textsf{plextarray}パッケージを読み込むことで、 +\textsf{plext}パッケージの組方向オプション拡張と\textsf{array}パッケージの +拡張の両方を使うことができるようになります。 + +\section{使いかた} + +\textsf{plext}と\textsf{array}を共存させたいときに、プリアンブルに +\verb+\usepackage{plextarray}+と書きます。既にいずれかのパッケージが +読み込まれていても問題ありません。また、\textsf{plextarray}パッケージを +読み込めば、\textsf{plext}と\textsf{array}\footnote{より正確には、 +\textsf{array}と(u)p\LaTeX の衝突を解消する\textsf{plarray}を読み込む +ことで、間接的に\textsf{array}も読み込まれます。}も自動的に読み込まれます。 + +\textsf{dcolumn}や\textsf{tabularx}のような、内部で\textsf{array}を利用 +しているパッケージを\textsf{plext}と共存させたい場合にも、 +\textsf{plextarray}が便利です。 + +以下に例を示します。横組中で縦組の表を書く例。 + +\bigskip +\begin{minipage}{0.5\linewidth} +\begin{verbatim} + \documentclass{jsarticle} + \usepackage{plextarray} + \begin{document} + 組方向 \verb+<t>+ 指定 + \begin{tabular}<t>{|>{$}c<{$}|c|}\hline + \exp(x) & 指数関数 \\ \hline + \log(x) & 対数関数 \\ \hline + \end{tabular}% + 終わり + \end{document} +\end{verbatim} +\end{minipage} +\begin{minipage}{0.3\linewidth} + 組方向 \verb+<t>+ 指定 + \begin{tabular}<t>{|>{$}c<{$}|c|}\hline + \exp(x) & 指数関数 \\ \hline + \log(x) & 対数関数 \\ \hline + \end{tabular}% + 終わり +\end{minipage} + +\bigskip + +縦組中で横組の表を書く例。\pLaTeX の縦組クラスでは\textsf{plext}パッケージが +最初から読み込まれているため、\textsf{array}パッケージを使用したい場合には +必ず\textsf{plextarray}パッケージを読み込む必要があります。 + +\bigskip +\begin{minipage}{0.5\linewidth} +\begin{verbatim} + \documentclass{tarticle} + %\usepackage{array} + \usepackage{plextarray} + \begin{document} + 組方向 \verb+<y>+ 指定 + \begin{tabular}<y>{|m{8zw}|m{5zw}|m{5zw}|} + \hline + \multicolumn{3}{|c|}{果物のリスト} \\ \hline + 品名 & 金額 & 産地 \\ \hline + りんご & 170円 & 青森県 \\ \hline + みかん & 150円 & 和歌山県 \\ \hline + パイナップル & 400円 & 沖縄県 \\ \hline + バナナ & 190円 & フィリピン \\ \hline + \end{tabular}% + 終わり + \end{document} +\end{verbatim} +\end{minipage} +\begin{minipage}<t>{0.45\linewidth} +組方向 \verb+<y>+ 指定 +\begin{tabular}<y>{|m{8zw}|m{5zw}|m{5zw}|} + \hline + \multicolumn{3}{|c|}{果物のリスト} \\ \hline + 品名 & 金額 & 産地 \\ \hline + りんご & 170円 & 青森県 \\ \hline + みかん & 150円 & 和歌山県 \\ \hline + パイナップル & 400円 & 沖縄県 \\ \hline + バナナ & 190円 & フィリピン \\ \hline +\end{tabular}% +終わり +\end{minipage} +\bigskip + +\section{謝辞} + +本パッケージの実装にあたっては、 +Lua\TeX-jaプロジェクト\footnote{\texttt{https://osdn.net/projects/luatex-ja/}}の +\textsf{lltjext}パッケージを参考にしました。 + +\end{document} diff --git a/language/japanese/platex-tools/plextdelarray.pdf b/language/japanese/platex-tools/plextdelarray.pdf Binary files differnew file mode 100644 index 0000000000..81ae06afe0 --- /dev/null +++ b/language/japanese/platex-tools/plextdelarray.pdf diff --git a/language/japanese/platex-tools/plextdelarray.sty b/language/japanese/platex-tools/plextdelarray.sty new file mode 100644 index 0000000000..03b6a1ccff --- /dev/null +++ b/language/japanese/platex-tools/plextdelarray.sty @@ -0,0 +1,55 @@ +% +% plextdelarray.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the platex-tools bundle. +% https://github.com/aminophen/platex-tools +% +% This package is expected to be compatible with +% * delarray.sty in latex-tools +% (2014/10/28 v1.01) +% * plext.sty in platex +% (2001/09/26 v1.2 -- 2018/09/20 v1.2j) +% + +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{plextdelarray} + [2018/09/18 v1.0a array delimiter package for plext and delarray] +\RequirePackage{plextarray} +\RequirePackage{delarray} + +%% patching internal code for array.sty and plext.sty +% +\def\@tabarray{\@ifnextchar<\p@tabarray{\p@tabarray<Z>}} +% +%% adopt from \p@tabarray (from plext.sty) +\def\p@tabarray<#1>{\m@th\@ifnextchar[%] + {\p@@array<#1>}{\p@@array<#1>[c]}} +% +%% adopt from \@@array (from delarray.sty) +\def\p@@array<#1>[#2]{\@ifnextchar\bgroup + {\let\@arrayleft\relax\let\@arrayright\relax\p@array<#1>[#2]}% + {\p@del@array<#1>[#2]}} +% +%% adopt from \@del@array (from delarray.sty) +% Note: we can't use \unvbox\z@, because there is a possibility +% that \@arrayleft is followed by \raise etc, instead of +% a box-starting command (\vtop, \vbox etc). +% Otherwise, an error "! A <box> was supposed to be here." +% See definitions of \@begin@alignbox in \fork@array@option. +\def\p@del@array<#1>[#2]#3#4#5{% + \setbox\z@\hbox{$\left#3\right#5$}% + \if#2c\def\@arrayleft{\left#3}\def\@arrayright{\right#5}% + \else\def\@arrayleft{\setbox\z@=\hbox\bgroup}% !!! + \def\@arrayright{\egroup% !!! + \dimen@=\dp\z@ + \advance\dimen@-\ht\z@ + \divide \dimen@ by \tw@ + \advance\dimen@ by\fontdimen22 \textfont\tw@ + \lower\dimen@\hbox{$\left#3\vcenter{\box\z@}\right#5$}}% !!! + \fi + \p@array<#1>[#2]{#4}} +% +%% all done + +\endinput diff --git a/language/japanese/platex-tools/plextdelarray.tex b/language/japanese/platex-tools/plextdelarray.tex new file mode 100644 index 0000000000..cc5e5a745f --- /dev/null +++ b/language/japanese/platex-tools/plextdelarray.tex @@ -0,0 +1,159 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle} +\usepackage{doc} +\usepackage{delarray} +\usepackage{plextdelarray} +\GetFileInfo{plextdelarray.sty} +\title{Package \textsf{plextdelarray} \fileversion} +\author{Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +Package \textsf{delarray}, included in \textsf{latex-tools} bundle, is +incompatible with \textsf{plext} package for p\LaTeX. +The package \textsf{plextarray} resolves this incompatibility, +and enables coexistence of both extensions provided by \textsf{plext} +and \textsf{delarray}. If you are not familiar with Japanese p\LaTeX\ +and \textsf{plext} package, please find the documentation of +\textsf{plextarray} for brief explanation. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +The rest of this document is written in Japanese, and includes some +examples of usage. + +\bigskip + +\textsf{latex-tools}バンドルに含まれる\textsf{delarray}パッケージは、 +p\LaTeX の拡張パッケージである\textsf{plext}パッケージと互換性がありません。 +この\textsf{plextdelarray}パッケージは、\textsf{plext}パッケージの組方向 +オプション拡張と\textsf{delarray}パッケージの拡張の両方を「一応使える」状態 +にするものです。ただし、\textsf{plext}の内部実装の都合上、\textsf{delarray}と +完全に同じ結果にならない場合があるかもしれません\footnote{本パッケージは +「\textsf{delarray}を読み込んだだけで\textsf{plext}の部分的な縦書き機能が +すべて使えなくなってしまって困った」という場合の、あくまで非常手段という +程度にとらえてください。}。 + +\section{使いかた} + +\textsf{plext}と\textsf{delarray}を共存させたいときに、プリアンブルに +\verb+\usepackage{plextdelarray}+と書きます。既にいずれかのパッケージが +読み込まれていても問題ありません。また、\textsf{plextdelarray}パッケージを +読み込めば、\textsf{plext}と\textsf{delarray}も自動的に読み込まれます。 +また、\textsf{plextarray}パッケージも読み込みます。 + +以下に例を示します。左側が\textsf{delarray}の機能で左右括弧を付けたもの、 +右側が通常の\textsf{array}の機能で左右括弧を付けたものです。 +特に\verb+[t]+と\verb+[b]+は、\textsf{delarray}なしでは実現できない +ようです(例は\textsf{delarray}のドキュメントを少し改変)。 + +\bigskip +\begin{minipage}{0.5\linewidth} +\begin{verbatim} + \documentclass{jsarticle} + %\usepackage{plext} + %\usepackage{delarray} + \usepackage{plextdelarray} + \begin{document} + \[ + \begin{array}[t]\{{c}\} + 3 \\ 4 \\ 5 \end{array} + \begin{array}[c]\{{c}\} + 2 \\ 3 \\ 4 \end{array} + \begin{array}[b]\{{c}\} + 1 \\ 2 \\ 3 \end{array} + \] + \[ + \left\{ \begin{array}[t]{c} + 3 \\ 4 \\ 5 \end{array} \right\} + \left\{ \begin{array}[c]{c} + 2 \\ 3 \\ 4 \end{array} \right\} + \left\{ \begin{array}[b]{c} + 1 \\ 2 \\ 3 \end{array} \right\} + \] + \end{document} +\end{verbatim} +\end{minipage} +\begin{minipage}{0.4\linewidth} +\mbox{}\\[10ex] + \[ + \begin{array}[t]\{{c}\} + 3 \\ 4 \\ 5 \end{array} + \begin{array}[c]\{{c}\} + 2 \\ 3 \\ 4 \end{array} + \begin{array}[b]\{{c}\} + 1 \\ 2 \\ 3 \end{array} + \] +\\[5ex] + \[ + \left\{ \begin{array}[t]{c} + 3 \\ 4 \\ 5 \end{array} \right\} + \left\{ \begin{array}[c]{c} + 2 \\ 3 \\ 4 \end{array} \right\} + \left\{ \begin{array}[b]{c} + 1 \\ 2 \\ 3 \end{array} \right\} + \] +\end{minipage} +\bigskip + +\textsf{plext}と\textsf{delarray}の両方の拡張を同じ箇所で使用することも +できなくはありませんが、役に立つ状況は少ないと思います。 + +\bigskip +\begin{minipage}{0.5\linewidth} +\begin{verbatim} + \documentclass{jsarticle} + %\usepackage{plext} + %\usepackage{delarray} + \usepackage{plextdelarray} + \begin{document} + \[ + \begin{array}<t>[t]\{{c}\} + 3 \\ 4 \\ 5 \end{array} + \begin{array}<t>[c]\{{c}\} + 2 \\ 3 \\ 4 \end{array} + \begin{array}<t>[b]\{{c}\} + 1 \\ 2 \\ 3 \end{array} + \] + \[ + \newcolumntype{L}{>{$}l<{$}} + f(x)= + \begin{array}<t>\{{lL}. + 0 & if $x=0$ \\ + \sin(x)/x & otherwise + \end{array} + \] + \end{document} +\end{verbatim} +\end{minipage} +\begin{minipage}{0.4\linewidth} +\mbox{}\\[12ex] + \[ + \begin{array}<t>[t]\{{c}\} + 3 \\ 4 \\ 5 \end{array} + \begin{array}<t>[c]\{{c}\} + 2 \\ 3 \\ 4 \end{array} + \begin{array}<t>[b]\{{c}\} + 1 \\ 2 \\ 3 \end{array} + \] +\\[6ex] + \[ + \newcolumntype{L}{>{$}l<{$}} + f(x)= + \begin{array}<t>\{{lL}. + 0 & if $x=0$ \\ + \sin(x)/x & otherwise + \end{array} + \] +\end{minipage} + +\end{document} diff --git a/language/japanese/platex-tools/pxatbegshi.pdf b/language/japanese/platex-tools/pxatbegshi.pdf Binary files differnew file mode 100644 index 0000000000..afa389cd08 --- /dev/null +++ b/language/japanese/platex-tools/pxatbegshi.pdf diff --git a/language/japanese/platex-tools/pxatbegshi.sty b/language/japanese/platex-tools/pxatbegshi.sty new file mode 100644 index 0000000000..577bfed637 --- /dev/null +++ b/language/japanese/platex-tools/pxatbegshi.sty @@ -0,0 +1,100 @@ +% +% pxatbegshi.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the platex-tools bundle. +% https://github.com/aminophen/platex-tools +% +% Largely based on bxpapersize.sty by T. Yato. +% Previous versions were largely based on H. Kitagawa's +% code on GitHub:texjporg/tex-jp-build#21. +% + +%% package declaration +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{pxatbegshi} + [2018/09/21 v0.4 Patch to atbegshi for (u)pLaTeX] + +%% preparations +\def\pxabgs@pkgname{pxatbegshi} +\def\pxabgs@warn{\PackageWarningNoLine\pxabgs@pkgname} + +%% load it +\RequirePackage{atbegshi} + +%% internal macros are locally effective +\begingroup + +%--------------------------------------- helpers + +%% unique tokens +\def\pxabgs@mark{\pxabgs@mark@} +\def\pxabgs@fin{\pxabgs@fin@} + +%% \pxabgs@patch@cmd\CMD{<orig>}{<new>} +\@onlypreamble\pxabgs@patch@cmd +\def\pxabgs@patch@cmd#1#2#3{% + \def\pxabgs@next##1#2##2\pxabgs@mark##3\pxabgs@fin{% + \ifx\pxabgs@mark##3\pxabgs@mark + \let\pxabgs@fragment\relax + \else + \def\pxabgs@fragment{##2}% + \def#1{##1#3##2}% + \fi}% + \expandafter\pxabgs@next#1\pxabgs@mark#2\pxabgs@mark\pxabgs@fin} + +%--------------------------------------- + +%% patch \AtBegShi@Output +% concept: execute all hooks in temporary yoko direction, +% by prepending \yoko and switching back to the original +% +% prepare +\let\pxabgs@AtBegShi@Output\AtBegShi@Output +% first, check hooks inserted by bxpapersize.sty +% -> if detected, nothing to do +\pxabgs@patch@cmd\pxabgs@AtBegShi@Output + {\bxpr@ABS@prehook}{\bxpr@ABS@prehook}% +\ifx\pxabgs@fragment\relax\else % found + \pxabgs@patch@cmd\pxabgs@AtBegShi@Output + {\bxpr@ABS@posthook}{\bxpr@ABS@posthook}% + \ifx\pxabgs@fragment\relax\else % found + \let\pxabgs@AtBegShi@Output\relax + \fi +\fi +% -> if not detected, prepend/append hooks +\ifx\pxabgs@AtBegShi@Output\relax\else + \expandafter\def\expandafter\pxabgs@AtBegShi@Output\expandafter{% + \expandafter\pxabgs@ABS@prehook + \pxabgs@AtBegShi@Output + \pxabgs@ABS@posthook + } + % adjust for atbegshi.sty on non-e-TeX ... + % (for e-TeX, this patch should fail but does nothing!) + \pxabgs@patch@cmd\pxabgs@AtBegShi@Output + {\pxabgs@ABS@prehook\egroup\endgroup} + {\egroup\endgroup\pxabgs@ABS@prehook}% + % commit the change + \global\let\AtBegShi@Output\pxabgs@AtBegShi@Output +\fi +% +%% done + +%--------------------------------------- done + +\endgroup +%% internal macros are no longer effective + +%% hooks +\let\pxabgs@restore@dir\relax +\def\pxabgs@ABS@prehook{% + \iftdir + \yoko + \let\pxabgs@restore@dir\tate + \else + \let\pxabgs@restore@dir\relax + \fi} +\def\pxabgs@ABS@posthook{\pxabgs@restore@dir} + +\endinput +%% EOF diff --git a/language/japanese/platex-tools/pxatbegshi.tex b/language/japanese/platex-tools/pxatbegshi.tex new file mode 100644 index 0000000000..c69b1b6ab9 --- /dev/null +++ b/language/japanese/platex-tools/pxatbegshi.tex @@ -0,0 +1,82 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle} +\usepackage{doc} +\usepackage{pxatbegshi} +\GetFileInfo{pxatbegshi.sty} +\title{Package \textsf{pxatbegshi} \fileversion} +\author{Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +Package \textsf{atbegshi} (written by Heiko Oberdiek) provides +a command \verb+\AtBeginShipout{...}+, however it cannot be used +with Japanese classes for vertical writing (tarticle.cls, etc). +\begin{verbatim} + ! Incompatible direction list can't be unboxed. + \AtBeginShipoutAddToBox ...box \AtBeginShipoutBox + \kern 0pt}\AtBegShi@restor... +\end{verbatim} +The package \textsf{pxatbegshi} provides a patch for \textsf{atbegshi} +to work with both horizontal and vertical writing. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +\bigskip + +Heiko Oberdiek氏による\textsf{atbegshi}パッケージは +\verb+\AtBeginShipout{...}+というコマンドを提供しますが、これを +p\LaTeX の縦組クラス(tarticle.clsなど)で使うとエラーが出てしまいます +\footnote{単に縦組クラスで\textsf{atbegshi}パッケージを読み込んだだけ +では、エラーは出ないようです。}。 +この\textsf{pxatbegshi}パッケージは、縦組クラスでも +\textsf{atbegshi}パッケージの機能を使えるようにするためのものです。 +もちろん、横組クラスで\textsf{pxatbegshi}パッケージを使用しても +問題は起きません。 + +使いかたは、\textsf{atbegshi}パッケージの代わりに、あるいは +\textsf{atbegshi}パッケージに追加して、\textsf{pxatbegshi}パッケージを +読みこむだけです。使用例: +\begin{verbatim} + \documentclass[a4paper]{tarticle} + \usepackage[dvipdfmx]{graphicx} + \usepackage{pxatbegshi} + \AtBeginShipout{% + \AtBeginShipoutUpperLeft{% + \parbox[t][\paperheight][b]{\paperwidth}{% + \includegraphics[width=210truemm]{background.eps}}}} + \begin{document} + 背景に透かしを入れます。 + \end{document} +\end{verbatim} + +\section*{謝辞} + +本パッケージの実装には、Takayuki Yato (ZR) 氏による +\textsf{bxpapersize}パッケージを参考にしました +\footnote{2018/09/21 v0.3までは北川さん (Hironori Kitagawa) による +「\verb+\AtBegShi@Output+の処理を強引に横組でやらせるコード」 +をベースにしていましたが、v0.4で\verb+\AtBeginShipoutDiscard+へ +対応させる改修を機に、書き直しました。}。 + +\section*{References} + +\begin{itemize} +\item utbookでatbegshiパッケージを使いたい\\ + \texttt{https://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=2134} +\item \relax[tex-jp-build] [ptex] ページ・数式の組方向 + (※北川さんのコードの初出)\\ + \texttt{https://github.com/texjporg/tex-jp-build/issues/21} +\item CTAN: Package \textsf{bxpapersize}\\ + \texttt{https://ctan.org/pkg/bxpapersize} +\end{itemize} + +\end{document} diff --git a/language/japanese/platex-tools/pxeverysel.pdf b/language/japanese/platex-tools/pxeverysel.pdf Binary files differnew file mode 100644 index 0000000000..83ab40a82e --- /dev/null +++ b/language/japanese/platex-tools/pxeverysel.pdf diff --git a/language/japanese/platex-tools/pxeverysel.sty b/language/japanese/platex-tools/pxeverysel.sty new file mode 100644 index 0000000000..5c00f1830f --- /dev/null +++ b/language/japanese/platex-tools/pxeverysel.sty @@ -0,0 +1,169 @@ +% +% pxeverysel.sty +% originally written by Takayuki Yato (ZR) +% and modified by Hironobu Yamashita +% +% This package is distributed as part of the platex-tools bundle +% maintained by Hironobu Yamashita +% by courtesy of the original author. +% https://github.com/aminophen/platex-tools +% + +%% package declaration +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pxeverysel} + [2018/10/28 v0.9 Patch to everysel for (u)pLaTeX] + +%% previous code for ctex support has been removed in v0.5, +%% as ctex has depended on pxeverysel since 2016/12/27 v2.4.7 + +%% in case it's too late ... +\@ifpackageloaded{everysel}{% + % everysel.sty removes \@EverySelectfont@Init once it is used + \ifx\@EverySelectfont@Init\undefined + \PackageError{pxeverysel}{% + Patch too late!\MessageBreak + Load pxeverysel earlier}\@ehc + \expandafter\endinput + \fi +}{} + +%% load it, but ensure that \@EverySelectfont@Init is not executed +% [Note] everysel.sty contains +% \AtBeginDocument{\@EverySelectfont@Init} +% at the end. In most cases, the execution is actually delayed; +% however, +% \AtBeginDocument{\RequirePackage{everysel}} +% can execute it immediately (e.g. found in sidecap.sty). +% In this case, delay it until the end of pxeverysel.sty. +\ifx\AtBeginDocument\@firstofone + \def\pxys@begindocumenthook{\let\AtBeginDocument\@firstofone} + \def\AtBeginDocument{\g@addto@macro\pxys@begindocumenthook} + \AtEndOfPackage{\pxys@begindocumenthook} +\fi +\RequirePackage{everysel} + +%% support for (u)pLaTeX font tracing +\@ifpackageloaded{tracefnt}{% + \ifx\kanjiskip\@undefined\else\ifx\ucs\@undefined + \RequirePackage{ptrace}\else\RequirePackage{uptrace}\fi\fi}{} + +%--------------------------------------- helpers + +%% preparations +\def\pxys@pkgname{pxeverysel} +\def\pxys@warn{\PackageWarningNoLine\pxys@pkgname} + +%% unique tokens +\def\pxys@mark{\pxys@mark@} +\def\pxys@fin{\pxys@fin@} + +%% \pxys@patch@cmd\CMD{<pre>}{<post>}{<new>} +\@onlypreamble\pxys@patch@cmd +\def\pxys@patch@cmd#1#2#3#4{% + \def\pxys@next##1#2##2#3##3\pxys@mark##4\pxys@fin{% + \ifx\pxys@mark##4\pxys@mark + \let\pxys@fragment\relax + \else + \def\pxys@fragment{##2}% + \def#1{##1#4##3}% + \fi}% + \expandafter\pxys@next#1\pxys@mark#2#3\pxys@mark\pxys@fin} + +%% \pxys@append@to\CSa\CSb +\@onlypreamble\pxys@append@to +\def\pxys@append@to#1#2{% + \expandafter\g@addto@macro\expandafter#1\expandafter{#2}} + +%% \pxys@term +\let\pxys@term\relax + +%--------------------------------------- + +%% variables +\let\pxys@self@hook\@empty +\let\pxys@everysel@hook\@empty +\@onlypreamble\pxys@selectfont +\let\pxys@selectfont\relax +\@onlypreamble\pxys@org@selectfont +\let\pxys@org@selectfont\relax +\@onlypreamble\pxys@new@selectfont +\let\pxys@new@selectfont\relax + +%% \@EverySelectfont@Init redefined +\@onlypreamble\pxys@EverySelectfont@Init +\let\pxys@EverySelectfont@Init\@EverySelectfont@Init +\def\@EverySelectfont@Init{% + \pxys@preproc + \pxys@EverySelectfont@Init + \pxys@postproc} + +%% \pxys@preproc +\@onlypreamble\pxys@preproc +\def\pxys@preproc{% + % prepare + \expandafter\let\expandafter\pxys@selectfont + \csname selectfont \endcsname + \let\pxys@org@selectfont\pxys@selectfont + % extract "pre-\size@update" insertion + \pxys@append@to\pxys@selectfont\pxys@term + \pxys@patch@cmd\pxys@selectfont + {\pickup@font\font@name}{\size@update\pxys@term}% % plfonts/ptrace + {\pickup@font\font@name\pxys@self@hook\pxys@everysel@hook + \size@update}% + \ifx\pxys@fragment\relax + \let\pxys@selectfont\pxys@org@selectfont + % extract "pre-\enc@update" insertion + \pxys@patch@cmd\pxys@selectfont + {\pickup@font\font@name}{\size@update\enc@update}% % ltfsstrc/tracefnt + {\pickup@font\font@name\pxys@self@hook\pxys@everysel@hook + \size@update\enc@update}% + \ifx\pxys@fragment\relax % failure + \let\pxys@selectfont\relax + \else + \pxys@append@to\pxys@self@hook\pxys@fragment + \fi + \else + \pxys@append@to\pxys@self@hook\pxys@fragment + \fi + \let\pxys@new@selectfont\pxys@selectfont + % prepare for everysel routine + \let\pxys@CheckCommand\CheckCommand + \let\CheckCommand\@gobble + % hack for disabling duplicate font info + \expandafter\let\expandafter\pxys@ver@tracefnt + \csname ver@tracefnt.sty\endcsname + \expandafter\let\csname ver@tracefnt.sty\endcsname\@undefined} + +%% \pxys@postproc +\@onlypreamble\pxys@postproc +\def\pxys@postproc{% + % revert the hack for disabling duplicate font info + \expandafter\let\csname ver@tracefnt.sty\endcsname\pxys@ver@tracefnt + \let\pxys@ver@tracefnt\@undefined + % post handling of everysel routine + \let\CheckCommand\pxys@CheckCommand + \let\pxys@CheckCommand\@undefined + \expandafter\let\expandafter\pxys@selectfont + \csname selectfont \endcsname + % extract the code insertion by everysel + \pxys@patch@cmd\pxys@selectfont + {\pickup@font\font@name}{\size@update\enc@update}{}% + \ifx\pxys@fragment\relax % failure + \let\pxys@new@selectfont\relax + \else % success + \pxys@append@to\pxys@everysel@hook\pxys@fragment + \fi + % commit the change + \ifx\pxys@new@selectfont\relax % failure + \let\pxys@selectfont\pxys@org@selectfont % revert + \pxys@warn{Failed in patching \string\selectfont}% + \else % success + \let\pxys@selectfont\pxys@new@selectfont + \fi + \expandafter\let\csname selectfont \endcsname\pxys@selectfont} + +%--------------------------------------- done + +\endinput +%% EOF diff --git a/language/japanese/platex-tools/pxeverysel.tex b/language/japanese/platex-tools/pxeverysel.tex new file mode 100644 index 0000000000..ab46087954 --- /dev/null +++ b/language/japanese/platex-tools/pxeverysel.tex @@ -0,0 +1,66 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle} +\usepackage{doc} +\usepackage{pxeverysel} +\GetFileInfo{pxeverysel.sty} +\title{Package \textsf{pxeverysel} \fileversion} +\author{Takayuki Yato \& Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +Package \textsf{everysel}, written by Martin Schr\"oder, +is incompatible with the definition of \verb+\selectfont+ redefined +by p\LaTeX\ kernel. For this reason, when using \textsf{everysel}, +font selection scheme for Japanese characters goes wrong. +The package \textsf{pxeverysel} provides a patch for \textsf{everysel} +to work with p\LaTeX\ font selection. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +\bigskip + +Martin Schr\"oder氏による\textsf{everysel}パッケージをp\LaTeX で +使用すると、日本語の文字サイズが変わらなくなったり、 +\textsf{otf}パッケージで文字化けが起こったりします。 +これは、\pLaTeX カーネルが日本語用に再定義している\verb+\selectfont+が、 +\textsf{everysel}によって書き換えられてしまうためです。 +この\textsf{pxeverysel}パッケージを読み込むことで、p\LaTeX でも +\textsf{everysel}パッケージを使えるようになります。 + +使いかたは、\textsf{everysel}パッケージの代わりに、あるいは +\textsf{everysel}パッケージに追加して、\textsf{pxeverysel}パッケージを +読み込むだけです\footnote{稀に\\\texttt{% +!~Package pxeverysel Error:~Patch too late!\\ +(pxeverysel)~~~~~~~~~~~~~~~~Load pxeverysel earlier.% +}\\というエラーが出ることがあります。この場合は、 +\textsf{pxeverysel}パッケージを少し早めに読み込んでみてください。}。 +\textsf{everysel}を内部で読み込んでいる\textsf{ragged2e}を例に示します: +\begin{verbatim} + \documentclass[a4paper]{jsarticle} + \usepackage{ragged2e}% 読み込むだけでアウト + \usepackage{pxeverysel} + \begin{document} + % 和文のフォントサイズが変わらない! + {\TeX}はアレ{\Large{\TeX}はアレ} + \end{document} +\end{verbatim} + +\section*{References} + +\begin{itemize} +\item vwcol.styとutf.styを併用したい\\ + \texttt{http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1763} +\item pLaTeXでeveryselしたい話\\ + \texttt{http://d.hatena.ne.jp/zrbabbler/20151212/1449898508} +\end{itemize} + +\end{document} diff --git a/language/japanese/platex-tools/pxeveryshi.pdf b/language/japanese/platex-tools/pxeveryshi.pdf Binary files differnew file mode 100644 index 0000000000..b9b989d393 --- /dev/null +++ b/language/japanese/platex-tools/pxeveryshi.pdf diff --git a/language/japanese/platex-tools/pxeveryshi.sty b/language/japanese/platex-tools/pxeveryshi.sty new file mode 100644 index 0000000000..8a534095d9 --- /dev/null +++ b/language/japanese/platex-tools/pxeveryshi.sty @@ -0,0 +1,28 @@ +% +% pxeveryshi.sty +% written by Takayuki Yato (ZR) +% +% This package is distributed as part of the platex-tools bundle +% maintained by Hironobu Yamashita +% by courtesy of the original author. +% https://github.com/aminophen/platex-tools +% + +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{pxeveryshi} + [2012/05/19 v0.1 everyshi package for pLaTeX] +\RequirePackageWithOptions{everyshi} +% +\def\@EveryShipout@Output{% + \setbox8\vbox{% + \yoko + \@EveryShipout@Hook + \@EveryShipout@AtNextHook + \global\setbox\@cclv=\box\@cclv + }% + \gdef\@EveryShipout@AtNextHook{}% + \@EveryShipout@Org@Shipout\box\@cclv +} +% +\endinput +%% EOF diff --git a/language/japanese/platex-tools/pxeveryshi.tex b/language/japanese/platex-tools/pxeveryshi.tex new file mode 100644 index 0000000000..b5e612ba51 --- /dev/null +++ b/language/japanese/platex-tools/pxeveryshi.tex @@ -0,0 +1,67 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle} +\usepackage{doc} +\usepackage{pxeveryshi} +\GetFileInfo{pxeveryshi.sty} +\title{Package \textsf{pxeveryshi} \fileversion} +\author{Takayuki Yato} +\date{\filedate} +\begin{document} + +\maketitle + +Package \textsf{everyshi}, written by Martin Schr\"oder, +cannot be used with Japanese classes for vertical writing +(tarticle.cls, etc). This behavior is not comfortable, since +\textsf{everyshi} is required by some other packages +(e.g. \textsf{tikz}) and causes an error: +\begin{verbatim} + ! Incompatible direction list can't be unboxed. +\end{verbatim} +The package \textsf{pxeveryshi} provides a patch for \textsf{everyshi} +to work with both horizontal and vertical writing. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +\bigskip + +Martin Schr\"oder氏による\textsf{everyshi}パッケージは、 +p\LaTeX の縦組クラス(tarticle.clsなど)で使うとエラーが出てしまいます。 +この挙動は、たとえば\textsf{tikz}のような内部で\textsf{everyshi}パッケージ +を必要とするパッケージを縦組で使用する際に問題になります。 +この\textsf{pxeveryshi}パッケージを読み込むことで、縦組クラスでも +\textsf{everyshi}パッケージ(およびこれに依存するパッケージ)が +使えるようになります。 + +使いかたは、\textsf{everyshi}パッケージの代わりに、あるいは +\textsf{everyshi}パッケージに追加して、\textsf{pxeveryshi}パッケージを +読みこむだけです。使用例: +\begin{verbatim} + \documentclass{tarticle} + \usepackage[dvipdfmx]{graphicx} + \usepackage{tikz} + \usepackage{pxeveryshi} + \begin{document} + \begin{tikzpicture} + \draw (0,0) -- (1,2); + \end{tikzpicture} + \end{document} +\end{verbatim} + +\section*{References} + +\begin{itemize} +\item tikz を縦書きで\\ + \texttt{https://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa/56760.html} +\item Re: tikz を縦書きで\\ + \texttt{https://oku.edu.mie-u.ac.jp/~okumura/texfaq/qa/56761.html} +\end{itemize} + +\end{document} diff --git a/language/japanese/platex-tools/pxftnright.pdf b/language/japanese/platex-tools/pxftnright.pdf Binary files differnew file mode 100644 index 0000000000..918d40a324 --- /dev/null +++ b/language/japanese/platex-tools/pxftnright.pdf diff --git a/language/japanese/platex-tools/pxftnright.sty b/language/japanese/platex-tools/pxftnright.sty new file mode 100644 index 0000000000..2b5d4382b4 --- /dev/null +++ b/language/japanese/platex-tools/pxftnright.sty @@ -0,0 +1,140 @@ +% +% pxftnright.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the platex-tools bundle. +% https://github.com/aminophen/platex-tools +% +% This package `pxftnright' is based on: +% * ftnright.sty in latex-tools (2014/10/28 v1.1f) +% +% Problems with ftnright to use with pLaTeX: +% * \@startcolumn is redefined +% (incompatible with vertical typesetting) +% * \@makecol is redefined +% (bottom float after footnote) +% * \@makefntext is redefined +% (incompatible with some pLaTeX classes) +% * \footnotesep is not suitable for vertical typesetting +% when used with pLaTeX 2016/11/29 or earlier +% (rather a problem of \strutbox in pLaTeX2e kernel) +% so, this package provides patches. +% + +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{pxftnright} + [2017/02/28 v1.1 footnote layout package for pLaTeX] + +%% save \@makefntext definition from pLaTeX class +\@ifpackageloaded{ftnright}{% + \PackageError{pxftnright}{% + Package ftnright is already loaded!\MessageBreak + Load pxftnright earlier}\@ehc +}{} +\let\pxftn@makefntext\@makefntext + +%% load ftnright package +\RequirePackage{ftnright} + +%% patches for ftnright to work fine with pLaTeX +%% This code is based on pLaTeX2e 2017/04/08 community ed. + +\def\@startcolumn{% + \ifx\@deferlist\@empty + \global\@fcolmadefalse + \global\@colroom\@colht + \else + \ifvoid\footins\else + \ftn@amount\ht\footins + \advance\ftn@amount\dp\footins + \advance\ftn@amount\skip\footins + \fi + \global\advance\@colht-\ftn@amount + \global\@colroom\@colht + \@xstartcol + \global\advance\@colht\ftn@amount + \global\advance\@colroom\ftn@amount + \fi + \if@fcolmade + \setbox\@cclv\box\@outputbox + \@makecol + \else +%%%%% change for pLaTeX (import from \@reinserts in plcore) + \ifvoid\footins\else\insert\footins{% + \iftbox\footins\tate\else\yoko\fi + \unvbox\footins}\fi +%%%%% + \fi} + +\def\@makecol{% +%%%%% change for pLaTeX + \setbox\@outputbox\box\@cclv +%%%%% + \if@firstcolumn + \if@twocolumn \else + \ifvoid\footins \else + \@latexerr{ftnright package + used in one-column mode}% + {The ftnright package was designed to + work with LaTeX's standard^^Jtwocolumn + option. It does *not* work with the + multicol package.^^JSo please specify + `twocolumn' in the + \noexpand\documentclass command.}% + \shipout\box\footins \fi\fi + \ifnum\insertpenalties>\z@ + \@latexerr{ftnright package + scrambled footnotes}% + {There is too much footnote material in + the first column and ftnright^^Jis + unable to cope with this.^^JYou need + to reduce the amount to get a properly + formatted page.}% + \fi + \fi +%%%%% change for pLaTeX (bottom float first) + \xdef\@freelist{\@freelist\@midlist}% + \global \let \@midlist \@empty + \@combinefloats + \let\pltx@textbottom\@textbottom %%% pLaTeX + \if@firstcolumn\else + \ifvoid\footins\else + \setbox\@outputbox \vbox {% + \boxmaxdepth \@maxdepth + \unvbox \@outputbox + \@textbottom %%% pLaTeX + \vskip \skip\footins + \color@begingroup + \normalcolor + \footnoterule + \unvbox \footins + \color@endgroup + }% + \let\@textbottom\relax %%% pLaTeX + \fi + \fi +%%%%% + \ifvbox\@kludgeins + \@makespecialcolbox + \else + \setbox\@outputbox\vbox to\@colht + {\boxmaxdepth\maxdepth + \@texttop + \dimen@ \dp\@outputbox + \unvbox \@outputbox + \iftdir\vbox{\hskip\z@}\fi %%% pLaTeX + \vskip -\dimen@ + \@textbottom}% + \fi + \let\@textbottom\pltx@textbottom %%% pLaTeX + \global\maxdepth\@maxdepth +} + +%% adjust \footnotesep for vertical typesetting +\AtBeginDocument + {\global\footnotesep\ht\iftdir\tstrutbox\else\strutbox\fi} + +%% restore \@makefntext +\let\@makefntext\pxftn@makefntext + +\endinput diff --git a/language/japanese/platex-tools/pxftnright.tex b/language/japanese/platex-tools/pxftnright.tex new file mode 100644 index 0000000000..d34c9dcfb9 --- /dev/null +++ b/language/japanese/platex-tools/pxftnright.tex @@ -0,0 +1,66 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle} +\begingroup + \def\NeedsTeXFormat#1\ProvidesPackage#2[#3 #4 #5]{% + \gdef\fileversion{#4}\gdef\filedate{#3}\endinput} + \input{pxftnright.sty} +\endgroup +\title{Package \textsf{pxftnright} \fileversion} +\author{Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +Package \textsf{ftnright}, included in \textsf{latex-tools} bundle, +cannot be used with Japanese classes for vertical writing +(tarticle.cls, etc). The package \textsf{pxftnright} provides some +patches to \textsf{ftnright} to work fine with vertical writing. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +The rest of this document is written in Japanese, and includes some +examples of usage. + +\bigskip + +\textsf{latex-tools}バンドルに含まれる\textsf{ftnright}パッケージは、 +p\LaTeX の縦組クラス(tarticle.clsなど)で使うとエラーが出てしまいます。 +この\textsf{pxftnright}パッケージを読み込むことで、縦組クラスでも +\textsf{ftnright}パッケージと同等の機能(二段組において、横組なら +脚注が右カラムに、縦組なら傍注\footnote{\verb+\footnote+という命令を +使用して得られるのは、縦組では正式には「傍注」と呼びます。}が下カラムに +まとまる)を得ることができます。 + +\section{使いかた} + +\textsf{ftnright}パッケージの代わりに、あるいは +\textsf{ftnright}パッケージより\emph{前}に、 +\textsf{pxftnright}パッケージを読みこみます(後に読みこんだ場合は +対策が手遅れになるため、エラーを出します)。 + +\begin{verbatim} + \documentclass[twocolumn]{tarticle} + \usepackage{pxftnright}% ftnright の代わり + \begin{document} + 縦組では\verb+\footnote+命令を使用すると、 + 傍注が出てきます\footnote{紛らわしいですね。}。 + また、… + \end{document} +\end{verbatim} + +\section*{References} + +\begin{itemize} +\item 縦書き2段組の脚注について\\ + \texttt{http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1896} +\end{itemize} + +\end{document} diff --git a/language/japanese/platex-tools/pxmulticol.pdf b/language/japanese/platex-tools/pxmulticol.pdf Binary files differnew file mode 100644 index 0000000000..a82970574c --- /dev/null +++ b/language/japanese/platex-tools/pxmulticol.pdf diff --git a/language/japanese/platex-tools/pxmulticol.sty b/language/japanese/platex-tools/pxmulticol.sty new file mode 100644 index 0000000000..a55341af95 --- /dev/null +++ b/language/japanese/platex-tools/pxmulticol.sty @@ -0,0 +1,25 @@ +% +% pxmulticol.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the platex-tools bundle. +% https://github.com/aminophen/platex-tools +% +% This package is expected to be compatible with +% * multicol.sty in latex-tools +% (1995/10/19 v1.5l -- 2018/04/01 v1.8r) +% + +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{pxmulticol} + [2018/11/25 v0.2 footnote layout package for pLaTeX] +\RequirePackageWithOptions{multicol} + +%% patching internal code for multicol.sty +% +\def\reinsert@footnotes{\ifvoid\footins\else + \insert\footins{\iftbox\footins\tate\else\yoko\fi}\fi} +% +%% done + +\endinput diff --git a/language/japanese/platex-tools/pxmulticol.tex b/language/japanese/platex-tools/pxmulticol.tex new file mode 100644 index 0000000000..352c46a541 --- /dev/null +++ b/language/japanese/platex-tools/pxmulticol.tex @@ -0,0 +1,62 @@ +%# -*- coding: utf-8 -*- +\ifx\epTeXinputencoding\undefined\else % defined in e-pTeX (> TL2016) + \epTeXinputencoding utf8 % ensure utf-8 encoding for platex +\fi + +\documentclass[a4paper]{jsarticle} +\begingroup + \def\NeedsTeXFormat#1\ProvidesPackage#2[#3 #4 #5]{% + \gdef\fileversion{#4}\gdef\filedate{#3}\endinput} + \input{pxmulticol.sty} +\endgroup +\title{Package \textsf{pxmulticol} \fileversion} +\author{Hironobu Yamashita} +\date{\filedate} +\begin{document} + +\maketitle + +Package \textsf{multicol}, included in \textsf{latex-tools} bundle, +throws an error when \verb+\footnote+ appears in vertical writing on +(u)p\LaTeX. The package \textsf{pxmulticol} provides a patch to +solve this problem. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +The rest of this document is written in Japanese, and includes some +examples of usage. + +\bigskip + +\textsf{latex-tools}バンドルに含まれる\textsf{multicol}パッケージは、 +縦組で脚注 (\verb+\footnote+) を使うとエラーを出してしまいます。 +この\textsf{pxmulticol}パッケージを読み込むことで、縦組クラスでも +\textsf{multicols}環境内で脚注を使うことができるようになります。 + +\section{使いかた} + +\textsf{multicol}パッケージの代わりに、あるいは追加で +\textsf{pxmulticol}パッケージを読み込みます。 + +\begin{verbatim} + \documentclass[a4paper]{tarticle} + \usepackage{pxmulticol}% multicol の代わり + \begin{document} + \begin{multicols}{2} + 縦組で段組をする場合も、脚注\footnote{こんな感じです。}を使う + ことができます。 + \end{multicols} + \end{document} +\end{verbatim} + +\section*{References} + +\begin{itemize} +\item 縦書き二段組における段移動\\ + \texttt{https://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=2535} +\end{itemize} + +\end{document} |