diff options
Diffstat (limited to 'language')
17 files changed, 379 insertions, 16 deletions
diff --git a/language/japanese/platex-tools/LICENSE b/language/japanese/platex-tools/LICENSE index 99a0c323d1..c463b620a9 100644 --- a/language/japanese/platex-tools/LICENSE +++ b/language/japanese/platex-tools/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016-2018 Hironobu Yamashita +Copyright (c) 2016-2019 Hironobu Yamashita All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/language/japanese/platex-tools/Makefile b/language/japanese/platex-tools/Makefile index a1bc26e10a..ec3d1c5546 100644 --- a/language/japanese/platex-tools/Makefile +++ b/language/japanese/platex-tools/Makefile @@ -3,11 +3,15 @@ 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 + pxatbegshi.pdf \ + pxftnright.pdf \ + pxmulticol.pdf \ + pxxspace.pdf \ + pxeverysel.pdf \ + pxeveryshi.pdf .SUFFIXES: .tex .dvi .pdf -%.dvi: %.tex %.sty +.tex.dvi: platex $(KANJI) $< platex $(KANJI) $< rm *.aux *.log diff --git a/language/japanese/platex-tools/README.md b/language/japanese/platex-tools/README.md index 51d952a3b8..b1d55da4cc 100644 --- a/language/japanese/platex-tools/README.md +++ b/language/japanese/platex-tools/README.md @@ -27,20 +27,25 @@ and some additional packages are included. Patch for multicol.sty (latex-tools) to support `\footnote` in vertical writing. Can be used on pLaTeX/upLaTeX. +- pxxspace.sty: + Patch for xspace.sty (latex-tools) to fix + interword spacing with Japanese characters. + Can be used on pLaTeX/upLaTeX. + Version 0.2 was written by Takayuki YATO in 2019 + (https://gist.github.com/zr-tex8r/7de76036846e149bc28ec6399a683e3a), + and incorporated into this bundle by his courtesy. - 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 + Version 0.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 + Version 0.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: @@ -78,6 +83,6 @@ the 3-clause BSD license (see [LICENSE](./LICENSE)). ## Release Date -2018-11-25 +2019-09-05 Hironobu Yamashita diff --git a/language/japanese/platex-tools/plarray.sty b/language/japanese/platex-tools/plarray.sty index 111592705e..8c797ef59c 100644 --- a/language/japanese/platex-tools/plarray.sty +++ b/language/japanese/platex-tools/plarray.sty @@ -7,7 +7,7 @@ % % This package is expected to be compatible with % * array.sty in latex-tools -% (2016/10/06 v2.4d -- 2018/09/13 v2.4i) +% (2016/10/06 v2.4d -- 2018/11/13 v2.4j) % * plcore.ltx in platex % (2001/09/26 v1.2a -- 2018/09/02 v1.3) % diff --git a/language/japanese/platex-tools/plextarray.sty b/language/japanese/platex-tools/plextarray.sty index ee08eb0bbd..1e706d9a75 100644 --- a/language/japanese/platex-tools/plextarray.sty +++ b/language/japanese/platex-tools/plextarray.sty @@ -7,9 +7,9 @@ % % This package is expected to be compatible with % * array.sty in latex-tools -% (2016/10/06 v2.4d -- 2018/09/13 v2.4i) +% (2016/10/06 v2.4d -- 2018/11/13 v2.4j) % * plext.sty in platex -% (2001/09/26 v1.2 -- 2018/09/20 v1.2j) +% (2001/09/26 v1.2 -- 2018/10/07 v1.2k) % Largely based on lltjext.sty from LuaTeX-ja project. % diff --git a/language/japanese/platex-tools/plextdelarray.sty b/language/japanese/platex-tools/plextdelarray.sty index 03b6a1ccff..1c6b097c2c 100644 --- a/language/japanese/platex-tools/plextdelarray.sty +++ b/language/japanese/platex-tools/plextdelarray.sty @@ -9,7 +9,7 @@ % * delarray.sty in latex-tools % (2014/10/28 v1.01) % * plext.sty in platex -% (2001/09/26 v1.2 -- 2018/09/20 v1.2j) +% (2001/09/26 v1.2 -- 2018/10/07 v1.2k) % \NeedsTeXFormat{pLaTeX2e} diff --git a/language/japanese/platex-tools/pxmulticol.sty b/language/japanese/platex-tools/pxmulticol.sty index a55341af95..63274eb94e 100644 --- a/language/japanese/platex-tools/pxmulticol.sty +++ b/language/japanese/platex-tools/pxmulticol.sty @@ -12,7 +12,7 @@ \NeedsTeXFormat{pLaTeX2e} \ProvidesPackage{pxmulticol} - [2018/11/25 v0.2 footnote layout package for pLaTeX] + [2018/11/25 v0.2 multicol package for pLaTeX] \RequirePackageWithOptions{multicol} %% patching internal code for multicol.sty diff --git a/language/japanese/platex-tools/pxxspace.pdf b/language/japanese/platex-tools/pxxspace.pdf Binary files differnew file mode 100644 index 0000000000..2aa3d48831 --- /dev/null +++ b/language/japanese/platex-tools/pxxspace.pdf diff --git a/language/japanese/platex-tools/pxxspace.sty b/language/japanese/platex-tools/pxxspace.sty new file mode 100644 index 0000000000..1a8207536c --- /dev/null +++ b/language/japanese/platex-tools/pxxspace.sty @@ -0,0 +1,133 @@ +% +% pxxspace.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 +% +% Original copyright notice: +% -------------------------------------------------- +% Copyright (c) 2019 Takayuki YATO (aka. "ZR") +% GitHub: https://github.com/zr-tex8r +% Twitter: @zr_tex8r +% +% This package is distributed under the MIT License. +% -------------------------------------------------- +% +% This package is expected to be compatible with +% * xspace.sty in latex-tools +% (2009/10/20 v1.13 -- 2014/10/28 v1.13) +% + +%% package declaration +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{pxxspace} + [2019/04/30 v0.2 Patch for xspace for pLaTeX/upLaTeX] +\def\pxxs@pkgname{pxxspace} + +%--------------------------------------- preparations + +%% e-TeX is required +\RequirePackage{etoolbox}[2011/01/03]% v2.1 +\ifx\numdef\@undefined \endinput \fi + +%% packages +\RequirePackage{xspace}[2009/10/20]% v1.13 + +%% check if patchable +\chardef\pxxs@tmpa=\@ne +\ifpatchable\@xspace{% + \@xspace@lettoken@if@letter@TF +}{}{\chardef\pxxs@tmpa=\z@} +\ifpatchable\@xspace@eTeX@setup{% + \begingroup +}{}{\chardef\pxxs@tmpa=\z@} +\ifnum\pxxs@tmpa=\z@ + \PackageError\pxxs@pkgname + {Failure in patching}% + {Package loading is aborted.\MessageBreak\@ehc}% +\expandafter\endinput\fi\relax + +%--------------------------------------- helpers + +%% packages +\RequirePackage{pdftexcmds} + +%% engine check +\newif\ifpxxs@uptex +\pdf@isprimitive\forcecjktoken\forcecjktoken{\pxxs@uptextrue}{} + +%% \pxxs@forcecjktoken +\ifpxxs@uptex + \let\pxxs@forcecjktoken\forcecjktoken +\else + \let\pxxs@forcecjktoken\relax +\fi + +%--------------------------------------- adjustments to xspace + +%% \pxxs@jt@XXX : probe tokens +\begingroup + \def\do#1#2#3{% + \kcatcode#2=#3\relax \kansujichar1=#2\relax + \edef\next{% + \global\let\noexpand#1=\scantokens\expandafter{\kansuji1}% + }\next} + \pxxs@forcecjktoken + \everyeof{\noexpand}% disable EOF marker + \do\pxxs@jt@kanji{\jis"3441}{16}% + \do\pxxs@jt@kana{\jis"2422}{17}% + \do\pxxs@jt@other{\jis"2123}{18}% + \ifpxxs@uptex + \do\pxxs@jt@hangul{\ucs"D55C}{19}% + \fi +\endgroup + +%% \pxxs@lettoken@if@jachar{<true>}{<false>} +% Checks if \@let@token is a ja-character token. +% NB: Here \@let@token might be an \outer-token. +\let\@let@token\relax +\def\pxxs@tmpa#1#2{\unexpanded{% + \ifcat\noexpand\@let@token#1\expandafter\@firstoftwo + \else \expandafter#2\fi}} +\edef\pxxs@lettoken@if@jachar{% + \pxxs@tmpa\pxxs@jt@kana\pxxs@lettoken@if@jachar@a} +\edef\pxxs@lettoken@if@jachar@a{% + \pxxs@tmpa\pxxs@jt@kanji\pxxs@lettoken@if@jachar@b} +\edef\pxxs@lettoken@if@jachar@b{% + \pxxs@tmpa\pxxs@jt@other\pxxs@lettoken@if@jachar@c} +\edef\pxxs@lettoken@if@jachar@c{% + \pxxs@tmpa\pxxs@jt@hangul\@secondoftwo} +\unless\ifpxxs@uptex + \let\pxxs@lettoken@if@jachar@c\@secondoftwo +\fi + +%% \pxxs@precheck +% Placed just before \@xspace@lettoken@if@letter@TF to modify the +% behavior of \@xspace so that spaces are omitted if the following +% token is a ja-character. +\def\pxxs@precheck#1{% + \pxxs@lettoken@if@jachar{\@gobbletwo}{#1}% +} + +%% patch \@xspace +\patchcmd\@xspace{%from + \@xspace@lettoken@if@letter@TF +}{%to + \pxxs@precheck + \@xspace@lettoken@if@letter@TF +}{}{} + +%% patch \@xspace@eTeX@setup +\patchcmd\@xspace@eTeX@setup{%from + \begingroup +}{%to + \begingroup + \pxxs@forcecjktoken +}{}{} + +%--------------------------------------- done +\endinput +%% EOF diff --git a/language/japanese/platex-tools/pxxspace.tex b/language/japanese/platex-tools/pxxspace.tex new file mode 100644 index 0000000000..cbdba8abf3 --- /dev/null +++ b/language/japanese/platex-tools/pxxspace.tex @@ -0,0 +1,100 @@ +%# -*- 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{pxxspace} +\GetFileInfo{pxxspace.sty} +\title{Package \textsf{pxxspace} \fileversion} +\author{Takayuki Yato} +\date{\filedate} + +%%%%% BEGIN +% +% \RESTOREXSPACE: restore original behavior to show difference +% +\makeatletter\def\RESTOREXSPACE{% +% +%% patch \@xspace +\patchcmd\@xspace{%from + \pxxs@precheck + \@xspace@lettoken@if@letter@TF +}{%to + \@xspace@lettoken@if@letter@TF +}{}{} +%% patch \@xspace@eTeX@setup +\patchcmd\@xspace@eTeX@setup{%from + \begingroup + \pxxs@forcecjktoken +}{%to + \begingroup +}{}{} +% +}\makeatother +% +%%%%% END + +\begin{document} + +\maketitle + +The command \verb+\xspace+ of package \textsf{xspace} +(included in \textsf{latex-tools} bundle) +results in wrong interword spacing when followed by +a Japanese character. +The package \textsf{pxxspace} provides a patch for \textsf{xspace} +to correct interword spacing with Japanese characters. + +This package is part of \textsf{platex-tools} bundle: +\begin{verbatim} + https://github.com/aminophen/platex-tools +\end{verbatim} + +\bigskip + +\textsf{xspace}パッケージ(\textsf{latex-tools}バンドルの一つ)が +提供する \verb+\xspace+ 命令は、その直後に和文文字を伴うときに +その和文文字との間のスペーシングが正しくなりません。 +そこで、\textsf{pxxspace}パッケージを読み込めば +和文文字との間のスペーシングが修正されます。 + +以下に例を示します。 +\begin{verbatim} + % Sample code + \documentclass{article} + \usepackage{pxxspace}% or, \usepackage{xspace} + \newcommand\myTeX{\TeX\xspace} + \begin{document} + % ASCII-Kanji interword spacing should be 20pt. + % At the same time, no spacing before JP punctuations. + \xkanjiskip 20pt % visible + \myTeX is great!\par + \myTeX, it's awesome!\par + \myTeX は素晴らしい!\par + \myTeX、超スゴイ!\par + \end{document} +\end{verbatim} + +\begin{quote} +\begin{multicols}{2} + \xkanjiskip 20pt % visible + \newcommand\myTeX{\TeX\xspace} + \long\def\TEST{% + \myTeX is great!\par + \myTeX, it's awesome!\par + \myTeX は素晴らしい!\par + \myTeX、超スゴイ!\par + } + % 正しいスペーシング: + Correct with \verb+\usepackage{pxxspace}+\par + \TEST + % 誤ったスペーシング: + \RESTOREXSPACE + Wrong with \verb+\usepackage{xspace}+\par + \TEST +\end{multicols} +\end{quote} + +\end{document} diff --git a/language/japanese/plautopatch/README.md b/language/japanese/plautopatch/README.md index bfec3d0daf..a67ed6ec72 100644 --- a/language/japanese/plautopatch/README.md +++ b/language/japanese/plautopatch/README.md @@ -30,7 +30,9 @@ The following patches are currently registered: - atbegshi (oberdiek) -> pxatbegshi (platex-tools) - ftnright (latex-tools) -> pxftnright (platex-tools) - multicol (latex-tools) -> pxmulticol (platex-tools) +- xspace (latex-tools) -> pxxspace (platex-tools) - pdfpages -> pxpdfpages (maintained here!) +- stfloats (sttools) -> pxstfloats (pxsttools) - pgfrcs (pgf) -> pxpgfrcs (maintained here!) - pgfcore (pgf) -> pxpgfmark (by Takayuki YATO) @@ -72,6 +74,11 @@ together with the main package. Short information: Patch for pgfrcs.sty (part of PGF) to support Japanese classes for vertical writing. Can be used on pLaTeX/upLaTeX. +- pxstfloats.sty: + Patch for stfloats.sty (sttools) to improve + compatibility with pLaTeX/upLaTeX. + Actually part of pxsttols (https://github.com/aminophen/pxsttools) + but included here for convenience. ## Installation @@ -90,6 +97,6 @@ the 3-clause BSD license (see [LICENSE](./LICENSE)). ## Release Date -2019-06-06 +2019-09-05 Hironobu Yamashita diff --git a/language/japanese/plautopatch/plautopatch-ja.pdf b/language/japanese/plautopatch/plautopatch-ja.pdf Binary files differindex a1dfcfdac7..e3d20f56be 100644 --- a/language/japanese/plautopatch/plautopatch-ja.pdf +++ b/language/japanese/plautopatch/plautopatch-ja.pdf diff --git a/language/japanese/plautopatch/plautopatch-ja.tex b/language/japanese/plautopatch/plautopatch-ja.tex index f199a1b349..c6d37e605b 100644 --- a/language/japanese/plautopatch/plautopatch-ja.tex +++ b/language/japanese/plautopatch/plautopatch-ja.tex @@ -116,7 +116,9 @@ p\LaTeX/up\LaTeX{}で動作するソースと通常の\LaTeX{}ソースの \ITEMoTo atbegshi (oberdiek) -> pxatbegshi (platex-tools) \ITEMoTo ftnright (latex-tools) -> pxftnright (platex-tools) \ITEMoTo multicol (latex-tools) -> pxmulticol (platex-tools) +\ITEMoTo xspace (latex-tools) -> pxxspace (platex-tools) \ITEMxTx pdfpages -> pxpdfpages (maintained here!) +\ITEMoTo stfloats (sttools) -> pxstfloats (pxsttools) \ITEMoTx pgfrcs (pgf) -> pxpgfrcs (maintained here!) \ITEMoTx pgfcore (pgf) -> pxpgfmark (by Takayuki YATO) \end{itemize} @@ -149,6 +151,7 @@ p\LaTeX/up\LaTeX{}で動作するソースと通常の\LaTeX{}ソースの \item 2018/11/03 v0.9 \textsf{siunitx}のサポート \item 2018/11/25 v0.9b \textsf{multicol}と\textsf{doc}のサポート \item 2019/06/06 v0.9c \textsf{siunitx}のパッチ改良 + \item 2019/09/05 v0.9d \textsf{xspace}と\textsf{stfloats}のサポート \end{itemize} \end{document} diff --git a/language/japanese/plautopatch/plautopatch.pdf b/language/japanese/plautopatch/plautopatch.pdf Binary files differindex 2d9b0ad42b..245820e0ee 100644 --- a/language/japanese/plautopatch/plautopatch.pdf +++ b/language/japanese/plautopatch/plautopatch.pdf diff --git a/language/japanese/plautopatch/plautopatch.sty b/language/japanese/plautopatch/plautopatch.sty index 378c2b3208..2d9f3cb43a 100644 --- a/language/japanese/plautopatch/plautopatch.sty +++ b/language/japanese/plautopatch/plautopatch.sty @@ -8,7 +8,7 @@ \NeedsTeXFormat{LaTeX2e}% not pLaTeX2e on purpose! \ProvidesPackage{plautopatch} - [2019/06/06 v0.9c Automated patches for pLaTeX/upLaTeX] + [2019/09/05 v0.9d Automated patches for pLaTeX/upLaTeX] \ifx\pfmtname\@undefined \PackageWarningNoLine{plautopatch}{% @@ -189,7 +189,9 @@ \platpc@patch@after{atbegshi}{pxatbegshi}% platex-tools \platpc@patch@before{ftnright}{pxftnright}% platex-tools \platpc@patch@after{multicol}{pxmulticol}% platex-tools +\platpc@patch@after{xspace}{pxxspace}% platex-tools \platpc@patch@after{pdfpages}{pxpdfpages}% (maintained here!) +\platpc@patch@before{stfloats}{pxstfloats}% pxsttools -- (!!) % for TikZ/PGF \platpc@patch@after{pgfrcs}{pxpgfrcs}% (maintained here!) diff --git a/language/japanese/plautopatch/plautopatch.tex b/language/japanese/plautopatch/plautopatch.tex index 06f2db6946..cddfa40e47 100644 --- a/language/japanese/plautopatch/plautopatch.tex +++ b/language/japanese/plautopatch/plautopatch.tex @@ -115,7 +115,9 @@ Current version (\filedate\space\fileversion) supports the followings: \ITEMoTo atbegshi (oberdiek) -> pxatbegshi (platex-tools) \ITEMoTo ftnright (latex-tools) -> pxftnright (platex-tools) \ITEMoTo multicol (latex-tools) -> pxmulticol (platex-tools) +\ITEMoTo xspace (latex-tools) -> pxxspace (platex-tools) \ITEMxTx pdfpages -> pxpdfpages (maintained here!) +\ITEMoTo stfloats (sttools) -> pxstfloats (pxsttools) \ITEMoTx pgfrcs (pgf) -> pxpgfrcs (maintained here!) \ITEMoTx pgfcore (pgf) -> pxpgfmark (by Takayuki YATO) \end{itemize} @@ -151,6 +153,7 @@ a comma-separated list of them: \item 2018/11/03 v0.9 Add support for \textsf{siunitx} \item 2018/11/25 v0.9b Add support for \textsf{multicol} and \textsf{doc} \item 2019/06/06 v0.9c Update patch for \textsf{siunitx} + \item 2019/09/05 v0.9d Add support for \textsf{xspace} and \textsf{stfloats} \end{itemize} \end{document} diff --git a/language/japanese/plautopatch/pxstfloats.sty b/language/japanese/plautopatch/pxstfloats.sty new file mode 100644 index 0000000000..fe19974931 --- /dev/null +++ b/language/japanese/plautopatch/pxstfloats.sty @@ -0,0 +1,106 @@ +% +% pxstfloats.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is actually part of the pxsttools bundle, but +% for now distributed as part of the plautopatch bundle. +% https://github.com/aminophen/plautopatch +% +% This package `pxstfloats.sty' is based on: +% * stfloats.sty in sttools (2016/06/28 v3.2) +% Many thanks to lltjp-stfloats.sty in LuaTeX-ja project. +% + +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{pxstfloats} + [2017/02/19 v0.2 stfloats package for pLaTeX] +\RequirePackage{stfloats} + +%% mostly based on \fn@makecol in stfloats.sty, and +%% the additions for supporting pLaTeX are based on +%% pLaTeX2e 2017/04/08 community ed. +%% the code is essentially compatible with +%% fnpos.sty (yafoot) 1999/07/14 v1.0 +%% |\makeFNmid| + |\makeFNbelow| status. +\gdef\pxstfl@fnbelowfl@makecol{% + \setbox\@outputbox \box\@cclv + \let\@elt\relax + \xdef\@freelist{\@freelist\@midlist}% + \global \let \@midlist \@empty + \@combinefloats + \ifvoid\footins + \else + \setbox\@outputbox \vbox {% + \boxmaxdepth \@maxdepth + \unvbox \@outputbox + \vskip \skip\footins + \color@begingroup + \normalcolor + \footnoterule + \unvbox \footins + \color@endgroup + }% + \fi + \ifvbox\@kludgeins + \@makespecialcolbox + \else + \setbox\@outputbox \vbox to\@colht {% + \@texttop + \dimen@ \dp\@outputbox + \unvbox \@outputbox + \iftdir\vbox{\hskip\z@}\fi %% for pLaTeX + \vskip -\dimen@ + \@textbottom + }% + \fi + \global \maxdepth \@maxdepth +} + +%% mostly based on \@makecol in latex.ltx, and +%% the additions for supporting pLaTeX are based on +%% pLaTeX2e 2017/04/08 community ed. +%% the code is essentially compatible with +%% fnpos.sty (yafoot) 1999/07/14 v1.0 +%% |\makeFNmid| + |\makeFNabove| status. +\gdef\pxstfl@fnabovefl@makecol {% + \ifvoid\footins + \setbox\@outputbox \box\@cclv + \else + \setbox\@outputbox \vbox {% + \boxmaxdepth \@maxdepth + \unvbox \@cclv + \vskip \skip\footins + \color@begingroup + \normalcolor + \footnoterule + \unvbox \footins + \color@endgroup + }% + \fi + \let\@elt\relax + \xdef\@freelist{\@freelist\@midlist}% + \global \let \@midlist \@empty + \@combinefloats + \ifvbox\@kludgeins + \@makespecialcolbox + \else + \setbox\@outputbox \vbox to\@colht {% + \@texttop + \dimen@ \dp\@outputbox + \unvbox \@outputbox + \iftdir\vbox{\hskip\z@}\fi %% for pLaTeX + \vskip -\dimen@ + \@textbottom + }% + \fi + \global \maxdepth \@maxdepth +} + +%% the definition \fnunderfloat is unnecessary, as stfloats.sty +%% has already defined it. others should be re-declared here +\def\fnbelowfloat{\global\let\@makecol\pxstfl@fnbelowfl@makecol} +\def\fnabovefloat{\global\let\@makecol\pxstfl@fnabovefl@makecol} + +%% all done + +\endinput |