summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/plautopatch/LICENSE27
-rw-r--r--Master/texmf-dist/doc/latex/plautopatch/Makefile26
-rw-r--r--Master/texmf-dist/doc/latex/plautopatch/README.md63
-rw-r--r--Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdfbin0 -> 91739 bytes
-rw-r--r--Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex124
-rw-r--r--Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdfbin0 -> 28241 bytes
-rw-r--r--Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex126
-rw-r--r--Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty147
-rw-r--r--Master/texmf-dist/tex/latex/plautopatch/pxpdfpages.sty49
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check3
-rw-r--r--Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc3
-rw-r--r--Master/tlpkg/tlpsrc/plautopatch.tlpsrc0
12 files changed, 566 insertions, 2 deletions
diff --git a/Master/texmf-dist/doc/latex/plautopatch/LICENSE b/Master/texmf-dist/doc/latex/plautopatch/LICENSE
new file mode 100644
index 00000000000..09610e6994e
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/plautopatch/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 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/Master/texmf-dist/doc/latex/plautopatch/Makefile b/Master/texmf-dist/doc/latex/plautopatch/Makefile
new file mode 100644
index 00000000000..5f2ef4e5d65
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/plautopatch/Makefile
@@ -0,0 +1,26 @@
+KANJI = -kanji=utf8
+FONTMAP = -f ipaex.map -f ptex-ipaex.map
+TEXMF = $(shell kpsewhich -var-value=TEXMFHOME)
+
+all: plautopatch.pdf plautopatch-ja.pdf
+
+.SUFFIXES: .tex .dvi .pdf
+.tex.dvi:
+ platex $(KANJI) $<
+ platex $(KANJI) $<
+ rm *.aux *.log
+.dvi.pdf:
+ dvipdfmx $(FONTMAP) $<
+
+.PHONY: install clean
+install:
+ mkdir -p ${TEXMF}/doc/platex/plautopatch
+ cp ./Makefile ${TEXMF}/doc/platex/plautopatch/
+ cp ./LICENSE ${TEXMF}/doc/platex/plautopatch/
+ cp ./README.md ${TEXMF}/doc/platex/plautopatch/
+ cp ./*.pdf ${TEXMF}/doc/platex/plautopatch/
+ cp ./*.tex ${TEXMF}/doc/platex/plautopatch/
+ mkdir -p ${TEXMF}/tex/platex/plautopatch
+ cp ./*.sty ${TEXMF}/tex/platex/plautopatch/
+clean:
+ rm -f *.dvi *.pdf
diff --git a/Master/texmf-dist/doc/latex/plautopatch/README.md b/Master/texmf-dist/doc/latex/plautopatch/README.md
new file mode 100644
index 00000000000..b9710306da9
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/plautopatch/README.md
@@ -0,0 +1,63 @@
+# plautopatch
+
+Japanese pLaTeX/upLaTeX formats and packages often conflict
+with other LaTeX packages which are aware of pLaTeX/upLaTeX.
+In the worst case, such packages throw an fatal error or
+end up with a wrong output.
+
+The goal of this package "plautopatch" is that
+there is no need to worry about such incompatibilities,
+by automatically loading specific patches
+when they are necessary.
+This helps not only to simplify source files, but also
+to make the appearance of working pLaTeX/upLaTeX sources
+similar to that of ordinally LaTeX ones.
+
+The following patches are currently registered:
+
+- tracefnt (latex) -> ptrace/uptrace (platex/uplatex)
+- fltrace (latex) -> pfltrace (platex)
+- array (latex-tools) -> plarray (platex-tools)
+- array (latex-tools) + plext (platex) -> plextarray (platex-tools)
+- delarray (latex-tools) + plext (platex) -> plextdelarray (platex-tools)
+- everysel (ms) -> pxeverysel (platex-tools)
+- everyshi (ms) -> pxeveryshi (platex-tools)
+- atbegshi (oberdiek) -> pxatbegshi (platex-tools)
+- ftnright (latex-tools) -> pxftnright (platex-tools)
+- pdfpages -> pxpdfpages (maintained here!)
+
+## Requirements
+
+This package depends on "filehook" package,
+written by Martin Scharrer.
+
+## Miscellaneous
+
+This bundle may distribute some tiny patches
+together with the main package. Short information:
+
+- pxpdfpages.sty:
+ Patch for pdfpages.sty (by An­dreas Matthias) to support
+ Japanese-style crop marks (called 'tombow' in Japanese).
+ Can be used on pLaTeX/upLaTeX.
+
+## Installation
+
+- *.sty -> $TEXMF/tex/platex/plautopatch
+- *.tex, *.pdf -> $TEXMF/doc/platex/plautopatch
+
+## Repository
+
+The bundle is maintained on GitHub:
+ https://github.com/aminophen/plautopatch
+
+## License
+
+The bundle may be distributed and/or modified under the terms of
+the 3-clause BSD license (see [LICENSE](./LICENSE)).
+
+## Release Date
+
+2018-08-21
+
+Hironobu Yamashita
diff --git a/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf b/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf
new file mode 100644
index 00000000000..605c28aa675
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex b/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex
new file mode 100644
index 00000000000..4ca3580f8f1
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex
@@ -0,0 +1,124 @@
+%# -*- 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{plautopatch}% load this here to make \GetFileInfo work
+\GetFileInfo{plautopatch.sty}
+\title{Package \textsf{plautopatch} \fileversion}
+\author{Hironobu Yamashita}
+\date{\filedate}
+\begin{document}
+
+\maketitle
+
+日本のp\LaTeX/up\LaTeX{}フォーマットや専用パッケージが、
+これらを知らない\LaTeX{}パッケージ(しばしば海外で作られた
+汎用のもの)と衝突することがあります。
+最悪の場合にはエラーが出たり、誤った出力が得られたり
+することがあります。
+
+この\textsf{plautopatch}の目的は、こうした非互換を意識せずに
+済むようにすることです。具体的には、p\LaTeX/up\LaTeX{}と
+衝突するパッケージが使われた場合に、その衝突を解消するパッチを
+提供するパッケージを必要に応じて自動的に読み込みます。
+こうすることで、ソースコードを簡潔にできるだけでなく、
+p\LaTeX/up\LaTeX{}で動作するソースと通常の\LaTeX{}ソースの
+見た目を近づけることができます。
+
+このパッケージはGitHubで開発しています。
+\begin{verbatim}
+ https://github.com/aminophen/plautopatch
+\end{verbatim}
+
+\section*{動作条件}
+
+このパッケージは
+\textsf{filehook}パッケージ(Martin Scharrer氏の作)に依存します。
+
+\section*{使い方}
+
+このパッケージを\LaTeX{}ソースの冒頭で読み込みます。
+このために、\verb+\RequirePackage{plautopatch}+を
+\verb+\documentclass+や他のコマンドよりも\emph{前}に
+読み込むことをお勧めします
+(クラスファイルなどが問題のあるパッケージを読み込む可能性もあるため)。
+
+例を示します。
+\begin{verbatim}
+ %\RequirePackage{plautopatch}
+ \documentclass{tarticle}% 縦組クラス(plext使用)
+ \usepackage{array}% plextと非互換
+ \begin{document}
+ ...
+ \end{document}
+\end{verbatim}
+上記の例では、
+\textsf{tarticle}クラスが内部で読み込む\textsf{plext}パッケージと、
+ソース中で\verb+\usepackage+している\textsf{array}パッケージが
+衝突してエラーになる場合があります。しかし、冒頭で
+\verb+\RequirePackage{plautopatch}+とだけ書いておけば、
+\textsf{array}パッケージの時点で\textsf{plextarray}パッケージが
+追加で読み込まれるため、問題が解消します。
+このように自動追加されたパッケージは、\verb+\end{document}+の
+時点で次のように一覧として表示されます(複数の場合は
+コンマと空白で区切ったリストになります)。
+\begin{verbatim}
+***** List of packages loaded by `plautopatch': *****
+ plextarray.
+*****************************************************
+\end{verbatim}
+
+\section*{現在対応しているパッケージの一覧}
+
+\def\ITEMoo#1 (#2) -> #3 (#4){%
+ \item \textsf{#1} (\textsf{#2})\\
+ $\rightarrow$ \textsf{#3} (\textsf{#4})}
+\def\ITEMooo#1 (#2) + #3 (#4) -> #5 (#6){%
+ \item \textsf{#1} (\textsf{#2}) + \textsf{#3} (\textsf{#4})\\
+ $\rightarrow$ \textsf{#5} (\textsf{#6})}
+\def\ITEM#1 -> #2 {%
+ \item \textsf{#1}\\
+ $\rightarrow$ \textsf{#2} }
+
+凡例:
+\begin{itemize}
+\item \texttt{<元のパッケージ>} (\texttt{<元が含まれるバンドル名>})\\
+ \texttt{<パッチのパッケージ>} (\texttt{<パッチが含まれるバンドル名>})
+\end{itemize}
+
+現在のバージョン (\filedate\space\fileversion) がサポートしているのは
+下記のパッケージです。
+\begin{itemize}
+\ITEMoo tracefnt (latex) -> ptrace/uptrace (platex/uplatex)
+\ITEMoo fltrace (latex) -> pfltrace (platex)
+\ITEMoo array (latex-tools) -> plarray (platex-tools)
+\ITEMooo array (latex-tools) + plext (platex) -> plextarray (platex-tools)
+\ITEMooo delarray (latex-tools) + plext (platex) -> plextdelarray (platex-tools)
+\ITEMoo everysel (ms) -> pxeverysel (platex-tools)
+\ITEMoo everyshi (ms) -> pxeveryshi (platex-tools)
+\ITEMoo atbegshi (oberdiek) -> pxatbegshi (platex-tools)
+\ITEMoo ftnright (latex-tools) -> pxftnright (platex-tools)
+\ITEM pdfpages -> pxpdfpages (maintained here!)
+\end{itemize}
+もちろん、このリストは随時、追加・削除・置き換えていく予定です。
+互換性の問題や追加したいパッケージがある場合はご一報ください。
+
+\section*{特定のパッケージを除外したい場合}
+
+デフォルトでは、上記のリストに登録されている\texttt{<元のパッケージ>}が
+使われたことを検出すると、全て自動的にパッチを読み込みます。
+しかし、時にはこれが逆効果となり、問題が起きる可能性は否定できません。
+そのような場合は
+\begin{verbatim}
+ \plautopatchdisable{<元のパッケージ>}
+\end{verbatim}
+と書くことで、そのパッケージを検出対象から除外します。複数ある場合は
+\begin{verbatim}
+ \plautopatchdisable{<元のパッケージ1>,<元のパッケージ2>}
+\end{verbatim}
+のようにコンマで区切っていくつでも除外できます。
+
+\end{document}
diff --git a/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf b/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf
new file mode 100644
index 00000000000..6eb94b17475
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex b/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex
new file mode 100644
index 00000000000..58b514d8834
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex
@@ -0,0 +1,126 @@
+%# -*- 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{plautopatch}% load this here to make \GetFileInfo work
+\GetFileInfo{plautopatch.sty}
+\title{Package \textsf{plautopatch} \fileversion}
+\author{Hironobu Yamashita}
+\date{\filedate}
+\begin{document}
+
+\maketitle
+
+Japanese p\LaTeX/up\LaTeX\ formats and packages often conflict
+with other \LaTeX\ packages which are aware of p\LaTeX/up\LaTeX.
+In the worst case, such packages throw an fatal error or
+end up with a wrong output.
+
+The goal of this package \textsf{plautopatch} is that
+there is no need to worry about such incompatibilities,
+by automatically loading specific patches
+when they are necessary.
+This helps not only to simplify source files, but also
+to make the appearance of working p\LaTeX/up\LaTeX\ sources
+similar to that of ordinally \LaTeX\ ones.
+
+The package is maintained on GitHub:
+\begin{verbatim}
+ https://github.com/aminophen/plautopatch
+\end{verbatim}
+
+\section*{Requirements}
+
+This package depends on \textsf{filehook} package,
+written by Martin Scharrer.
+
+\section*{Usage}
+
+Load this package at the very beginning of the \LaTeX\ source.
+It is strongly recommended to use
+\verb+\RequirePackage{plautopatch}+
+before \verb+\documentclass+ or any other commands,
+as such other classes and packages may load
+some problematic packages internally.
+
+Here is an example:
+\begin{verbatim}
+ %\RequirePackage{plautopatch}
+ \documentclass{tarticle}% vertical writing (requires plext)
+ \usepackage{array}% incompatible with plext
+ \begin{document}
+ ...
+ \end{document}
+\end{verbatim}
+In the above example, the class \textsf{tarticle} internally
+requires the package \textsf{plext}.
+However, \textsf{array} explicitly required by \verb+\usepackage+
+conflicts with \textsf{plext}.
+By using \verb+\RequirePackage{plautopatch}+,
+\textsf{plextarray} is automatically loaded and the problem goes.
+The list of automatically-loaded packages is shown at
+\verb+\end{document}+:
+\begin{verbatim}
+***** List of packages loaded by `plautopatch': *****
+ plextarray.
+*****************************************************
+\end{verbatim}
+When multiple packages are loaded, they are all printed
+as a list separated by commas and spaces.
+
+\section*{List of currently available patches}
+
+\def\ITEMoo#1 (#2) -> #3 (#4){%
+ \item \textsf{#1} (\textsf{#2})\\
+ $\rightarrow$ \textsf{#3} (\textsf{#4})}
+\def\ITEMooo#1 (#2) + #3 (#4) -> #5 (#6){%
+ \item \textsf{#1} (\textsf{#2}) + \textsf{#3} (\textsf{#4})\\
+ $\rightarrow$ \textsf{#5} (\textsf{#6})}
+\def\ITEM#1 -> #2 {%
+ \item \textsf{#1}\\
+ $\rightarrow$ \textsf{#2} }
+
+The legend:
+\begin{itemize}
+\item \texttt{<original package>} (\texttt{<bundle name of original package>})\\
+ \texttt{<patch package>} (\texttt{<bundle name of patch package>})
+\end{itemize}
+
+Current version (\filedate\space\fileversion) supports the followings:
+\begin{itemize}
+\ITEMoo tracefnt (latex) -> ptrace/uptrace (platex/uplatex)
+\ITEMoo fltrace (latex) -> pfltrace (platex)
+\ITEMoo array (latex-tools) -> plarray (platex-tools)
+\ITEMooo array (latex-tools) + plext (platex) -> plextarray (platex-tools)
+\ITEMooo delarray (latex-tools) + plext (platex) -> plextdelarray (platex-tools)
+\ITEMoo everysel (ms) -> pxeverysel (platex-tools)
+\ITEMoo everyshi (ms) -> pxeveryshi (platex-tools)
+\ITEMoo atbegshi (oberdiek) -> pxatbegshi (platex-tools)
+\ITEMoo ftnright (latex-tools) -> pxftnright (platex-tools)
+\ITEM pdfpages -> pxpdfpages (maintained here!)
+\end{itemize}
+Note that, of course, the list may be adjusted
+(addition, deletion or replacement)
+in the future to get the expected result.
+Feel free to report some compatibility issue or request changes!
+
+\section*{Disabling a specific patch}
+
+By default, \texttt{<patch package>} is automatically loaded when
+\texttt{<original package>} is detected, following the whole list.
+However, there is still a possibility of another regression issue.
+In that case, you can disable the detection of
+\texttt{<original package>} by using the command:
+\begin{verbatim}
+ \plautopatchdisable{<original package>}
+\end{verbatim}
+If you want to disable multiple packages, you can give
+a comma-separated list of them:
+\begin{verbatim}
+ \plautopatchdisable{<original package 1>,<original package 2>}
+\end{verbatim}
+
+\end{document}
diff --git a/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty b/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty
new file mode 100644
index 00000000000..dbc40429c32
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty
@@ -0,0 +1,147 @@
+%
+% plautopatch.sty
+% written by Hironobu Yamashita (@aminophen)
+%
+% This package is part of the plautopatch bundle.
+% https://github.com/aminophen/plautopatch
+%
+
+\NeedsTeXFormat{pLaTeX2e}
+\ProvidesPackage{plautopatch}
+ [2018/08/21 v0.2 Automated patches for pLaTeX/upLaTeX]
+\def\platpc@pkgname{plautopatch}
+\def\platpc@warn{\PackageWarningNoLine\platpc@pkgname}
+\def\platpc@info{\PackageInfo\platpc@pkgname}
+
+\RequirePackage{filehook}
+
+% low-level helpers
+
+%% \platpc@req@add{<package>}
+% = if not loaded yet, \RequirePackage{<package>}
+% and add to list.
+\def\platpc@req@add#1{%
+ \@ifpackageloaded{#1}{}{\RequirePackage{#1}\platpc@addtolist{#1}}%
+}
+
+%% \platpc@addtolist{<package>}
+% = add <package> to list named \platpc@list.
+\def\platpc@addtolist#1{\xdef\platpc@list{\platpc@list, #1}}
+\def\platpc@list{}% initialize
+
+% high-level helpers
+
+%% \platpc@patch@after{<orig>}{<patch>}
+% = Load <patch> after <orig>.
+\def\platpc@patch@after#1#2{%
+ \expandafter\def\csname platpc@end@#1\endcsname{%
+ \expandafter\ifx\csname platpc@disable@#1\endcsname\relax
+ \platpc@req@add{#2}%
+ \fi
+ }%
+ \AtEndOfPackageFile{#1}{\csname platpc@end@#1\endcsname}%
+}
+\@onlypreamble\platpc@patch@after
+
+%% \platpc@patch@after@both{<orig 1>}{<orig 2>}{<patch>}
+% = Load <patch> after both <orig 1> & <orig 2>.
+\def\platpc@patch@after@both#1#2#3{%
+ % for order #2 => #1
+ \expandafter\def\csname platpc@end@#1+#2\endcsname{%
+ \expandafter\ifx\csname platpc@disable@#1\endcsname\relax
+ \expandafter\ifx\csname platpc@disable@#2\endcsname\relax
+ \@ifpackageloaded{#2}{\platpc@req@add{#3}}{}%
+ \fi
+ \fi
+ }%
+ \AtEndOfPackageFile{#1}{\csname platpc@end@#1+#2\endcsname}%
+ % for order #1 => #2
+ \expandafter\def\csname platpc@end@#2+#1\endcsname{%
+ \expandafter\ifx\csname platpc@disable@#2\endcsname\relax
+ \expandafter\ifx\csname platpc@disable@#1\endcsname\relax
+ \@ifpackageloaded{#1}{\platpc@req@add{#3}}{}%
+ \fi
+ \fi
+ }%
+ \AtEndOfPackageFile{#2}{\csname platpc@end@#2+#1\endcsname}%
+}
+\@onlypreamble\platpc@patch@after@both
+
+%% \platpc@patch@before{<orig>}{<patch>}
+% = Load <patch> before <orig>.
+% used when both conditions are met:
+% - <patch> must be loaded *before* <orig>
+% - <patch> contains \RequirePackage{<orig>}
+\def\platpc@patch@before#1#2{%
+ \expandafter\def\csname platpc@begin@#1\endcsname{%
+ % if <patch> is already loaded, nothing to do
+ \@ifpackageloaded{#2}{}{% else
+ \expandafter\ifx\csname platpc@disable@#1\endcsname\relax
+ % the code (*!) should be used only once,
+ % remove it immediately when this macro is executed
+ \expandafter\let\csname platpc@begin@#1\endcsname\relax
+ % pretend as if <orig> not loaded
+ \expandafter\let\csname ver@#1.sty\endcsname\relax
+ % load the <patch> package
+ \RequirePackage{#2}\platpc@addtolist{#2}%
+ % avoid loading <orig> twice by discarding "\@@input <orig>" (*!)
+ \let\platpc@filehook@@atbegin\filehook@@atbegin
+ \def\filehook@@atbegin\@@input####1\filehook@atend{%
+ \let\filehook@@atbegin\platpc@filehook@@atbegin
+ % avoid infinite loop even when \AtEndOfPackageFile used
+ \expandafter\let\csname filehook@atend@#1.sty\endcsname\relax
+ \filehook@@atbegin
+ \filehook@atend}%
+ % all done
+ \fi
+ }%
+ }%
+ \AtBeginOfPackageFile{#1}{\csname platpc@begin@#1\endcsname}%
+}
+\@onlypreamble\platpc@patch@before
+
+% interface for users who want don't patches
+
+%% \plautopatchdisable{<orig 1>,<orig 2>,...}
+% = Disable patches triggered by <orig 1>, <orig 2>, ...
+\newcommand{\plautopatchdisable}[1]{%
+ \edef\@tempa{\zap@space#1 \@empty}%
+ \@for\@tempa:=\@tempa\do{%
+ \expandafter\let\csname platpc@disable@\@tempa\endcsname\@empty
+ }%
+}
+\@onlypreamble\plautopatchdisable
+
+% show list of loaded patches
+
+\AtEndDocument{\platpc@showlist}
+\def\platpc@showlist{%
+ \ifx\platpc@list\@empty
+ \platpc@info{No additional packages loaded}
+ \else
+ % the first token of \platpc@list should be ','
+ \typeout{%
+ ***** List of packages loaded by `\platpc@pkgname': *****^^J%
+ \expandafter\@gobble\platpc@list.^^J%
+ *****************************************************}%
+ \fi
+}
+
+% register patches
+
+\ifx\enablecjktoken\@undefined
+ \platpc@patch@after{tracefnt}{ptrace}% platex
+\else
+ \platpc@patch@after{tracefnt}{uptrace}% uplatex
+\fi
+\platpc@patch@after{fltrace}{pfltrace}% platex
+\platpc@patch@after{array}{plarray}% platex-tools
+\platpc@patch@after@both{array}{plext}{plextarray}% platex-tools
+\platpc@patch@after@both{delarray}{plext}{plextdelarray}% platex-tools
+\platpc@patch@after{everysel}{pxeverysel}% platex-tools
+\platpc@patch@after{everyshi}{pxeveryshi}% platex-tools
+\platpc@patch@after{atbegshi}{pxatbegshi}% platex-tools
+\platpc@patch@before{ftnright}{pxftnright}% platex-tools
+\platpc@patch@after{pdfpages}{pxpdfpages}% (maintained here!)
+
+\endinput
diff --git a/Master/texmf-dist/tex/latex/plautopatch/pxpdfpages.sty b/Master/texmf-dist/tex/latex/plautopatch/pxpdfpages.sty
new file mode 100644
index 00000000000..3eb6ef13f34
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/plautopatch/pxpdfpages.sty
@@ -0,0 +1,49 @@
+%
+% pxpdfpages.sty
+% written by Hironobu Yamashita (@aminophen)
+%
+% This package is part of the plautopatch bundle.
+% https://github.com/aminophen/plautopatch
+%
+% This package `pxpdfpages.sty' is based on:
+% * pdfpages.sty (2017/10/31 v0.5l)
+% * plcore.ltx in platex (2018/05/13 v1.2z)
+%
+
+%% package declaration
+\NeedsTeXFormat{pLaTeX2e}
+\ProvidesPackage{pxpdfpages}
+ [2018/08/20 v0.1 Patch to pdfpages for (u)pLaTeX]
+
+%% preparations
+\def\pxpdpg@pkgname{pxpdfpages}
+\def\pxpdpg@warn{\PackageWarningNoLine\pxpdpg@pkgname}
+\def\pxpdpg@info{\PackageInfo\pxpdpg@pkgname}
+
+%% load it
+\RequirePackageWithOptions{pdfpages}
+\RequirePackage{pxatbegshi}% pdfpages requires atbegshi
+
+%% patch internal for pdfpages to work with tombow
+%% Note: this code should be copied to gentombow.sty!
+\def\pxpdpg@patch@pdfpages{%
+ \RequirePackage{etoolbox}
+ \patchcmd{\AM@output}{%
+ \setlength{\@tempdima}{\AM@xmargin}%
+ \edef\AM@xmargin{\the\@tempdima}%
+ \setlength{\@tempdima}{\AM@ymargin}%
+ \edef\AM@ymargin{\the\@tempdima}%
+ }{%
+ \setlength{\@tempdima}{\AM@xmargin\iftombow+1in\fi}%
+ \edef\AM@xmargin{\the\@tempdima}%
+ \setlength{\@tempdima}{\AM@ymargin\iftombow-1in\fi}%
+ \edef\AM@ymargin{\the\@tempdima}%
+ }
+ {\pxpdpg@info{Patch for pdfpages applied}}
+ {\pxpdpg@warn{Patch for pdfpages failed}}%
+ }
+\AtBeginDocument{\@ifpackageloaded{pdfpages}{\pxpdpg@patch@pdfpages}{}}
+
+%% all done
+
+\endinput
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 82bcad8214a..6d3d2faa2d7 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -506,7 +506,8 @@ my @TLP_working = qw(
pinlabel pitex pittetd pixelart pkfix pkfix-helper pkgloader pkuthss
pl placeat placeins placeins-plain
plain-doc plainpkg plari plantslabels plantuml plates
- platex platex-tools platexcheat play playfair plex plex-otf plipsum
+ platex platex-tools platexcheat plautopatch
+ play playfair plex plex-otf plipsum
plnfss plstmary plweb pm-isomath pmgraph pmx pmxchords pnas2009
poemscol poetry poetrytex polexpr polski poltawski
polyglossia polynom polynomial
diff --git a/Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc b/Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc
index bd798680040..b256e8653ee 100644
--- a/Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-langjapanese.tlpsrc
@@ -30,10 +30,11 @@ depend pbibtex-base
depend platex
depend platex-tools
depend platexcheat
+depend plautopatch
depend ptex
depend ptex-base
-depend ptex-fonts
depend ptex-fontmaps
+depend ptex-fonts
depend ptex2pdf
depend pxbase
depend pxchfon
diff --git a/Master/tlpkg/tlpsrc/plautopatch.tlpsrc b/Master/tlpkg/tlpsrc/plautopatch.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/plautopatch.tlpsrc