diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/plautopatch/README.md | 14 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf | bin | 91739 -> 94965 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf | bin | 28241 -> 28681 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex | 21 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty | 84 |
6 files changed, 85 insertions, 41 deletions
diff --git a/Master/texmf-dist/doc/latex/plautopatch/README.md b/Master/texmf-dist/doc/latex/plautopatch/README.md index b9710306da9..7d21808aaf8 100644 --- a/Master/texmf-dist/doc/latex/plautopatch/README.md +++ b/Master/texmf-dist/doc/latex/plautopatch/README.md @@ -1,17 +1,17 @@ # 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 +with other LaTeX packages which are unaware of pLaTeX/upLaTeX. +In the worst case, such packages throw a 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. +there should be no need to worry about such incompatibilities, +because specific patches are loaded automatically +whenever 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. +similar to those of ordinally LaTeX ones. The following patches are currently registered: @@ -58,6 +58,6 @@ the 3-clause BSD license (see [LICENSE](./LICENSE)). ## Release Date -2018-08-21 +2018-08-22 Hironobu Yamashita diff --git a/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf b/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf Binary files differindex 605c28aa675..65350177c33 100644 --- a/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf +++ b/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf diff --git a/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex b/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex index 4ca3580f8f1..b54973f17d9 100644 --- a/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex +++ b/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex @@ -121,4 +121,11 @@ p\LaTeX/up\LaTeX{}で動作するソースと通常の\LaTeX{}ソースの \end{verbatim} のようにコンマで区切っていくつでも除外できます。 +\section*{変更履歴} + +\begin{itemize} + \item 2018/08/21 v0.2 最初のCTANリリース版 + \item 2018/08/22 v0.3 元パッケージ検出の改良 +\end{itemize} + \end{document} diff --git a/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf b/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf Binary files differindex 6eb94b17475..71649aed033 100644 --- a/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf +++ b/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf diff --git a/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex b/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex index 58b514d8834..466548c130a 100644 --- a/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex +++ b/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex @@ -14,18 +14,18 @@ \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 +Japanese \pLaTeX/up\LaTeX\ formats and packages often conflict +with other \LaTeX\ packages which are unaware of p\LaTeX/up\LaTeX. +In the worst case, such packages throw a 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. +there should be no need to worry about such incompatibilities, +because specific patches are loaded automatically +whenever 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. +similar to those of ordinally \LaTeX\ ones. The package is maintained on GitHub: \begin{verbatim} @@ -123,4 +123,11 @@ a comma-separated list of them: \plautopatchdisable{<original package 1>,<original package 2>} \end{verbatim} +\section*{Change History} + +\begin{itemize} + \item 2018/08/21 v0.2 First CTAN release + \item 2018/08/22 v0.3 Improve detection of problematic packages +\end{itemize} + \end{document} diff --git a/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty b/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty index dbc40429c32..483b77f67c8 100644 --- a/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty +++ b/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty @@ -8,8 +8,9 @@ \NeedsTeXFormat{pLaTeX2e} \ProvidesPackage{plautopatch} - [2018/08/21 v0.2 Automated patches for pLaTeX/upLaTeX] + [2018/08/22 v0.3 Automated patches for pLaTeX/upLaTeX] \def\platpc@pkgname{plautopatch} +\def\platpc@err{\PackageError\platpc@pkgname} \def\platpc@warn{\PackageWarningNoLine\platpc@pkgname} \def\platpc@info{\PackageInfo\platpc@pkgname} @@ -17,11 +18,13 @@ % low-level helpers -%% \platpc@req@add{<package>} +%% \platpc@ifreq@add{<package>} % = if not loaded yet, \RequirePackage{<package>} % and add to list. -\def\platpc@req@add#1{% - \@ifpackageloaded{#1}{}{\RequirePackage{#1}\platpc@addtolist{#1}}% +\def\platpc@ifreq@add#1{% + \@ifpackageloaded{#1}{}{% + \RequirePackage{#1}\platpc@addtolist{#1}% + }% } %% \platpc@addtolist{<package>} @@ -29,41 +32,65 @@ \def\platpc@addtolist#1{\xdef\platpc@list{\platpc@list, #1}} \def\platpc@list{}% initialize +%% \platpc@ifnotdisabled{<package>}{<code>} +% = execute <code> if <package> is not disabled. +\def\platpc@ifnotdisabled#1{% + \expandafter\ifx\csname platpc@disable@#1\endcsname\relax + \expandafter\@firstofone + \fi +} + +%% \platpc@ifloadederr{<package>} +% = throw an error if <package> is already loaded. +\def\platpc@ifloadederr#1{% + \@ifpackageloaded{#1}{% + \platpc@err{Package `#1' already loaded!\MessageBreak + Use \string\RequirePackage{\platpc@pkgname} earlier}\@ehc + }% +} + % 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 + \platpc@ifnotdisabled{#1}{\platpc@ifreq@add{#2}}% + }% + \@ifpackageloaded{#1}{% + \csname platpc@end@#1\endcsname + }{% + \AtEndOfPackageFile{#1}{\csname platpc@end@#1\endcsname}% }% - \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 + \platpc@ifnotdisabled{#1}{\platpc@ifnotdisabled{#2}{% + \platpc@ifreq@add{#3}% + }}% }% - \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 + \@ifpackageloaded{#1}{% + \@ifpackageloaded{#2}{% + \csname platpc@end@#1+#2\endcsname + }{% + \AtEndOfPackageFile{#2}{\csname platpc@end@#1+#2\endcsname}% + }% + }{% + \@ifpackageloaded{#2}{% + \AtEndOfPackageFile{#1}{\csname platpc@end@#1+#2\endcsname}% + }{% + \AtEndOfPackageFile{#1}{% + \@ifpackageloaded{#2}{\csname platpc@end@#1+#2\endcsname}{}% + }% + \AtEndOfPackageFile{#2}{% + \@ifpackageloaded{#1}{\csname platpc@end@#1+#2\endcsname}{}% + }% + }% }% - \AtEndOfPackageFile{#2}{\csname platpc@end@#2+#1\endcsname}% } \@onlypreamble\platpc@patch@after@both @@ -74,9 +101,9 @@ % - <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 + \platpc@ifnotdisabled{#1}{% + % if <patch> is already loaded, nothing to do + \@ifpackageloaded{#2}{}{% else % the code (*!) should be used only once, % remove it immediately when this macro is executed \expandafter\let\csname platpc@begin@#1\endcsname\relax @@ -93,9 +120,12 @@ \filehook@@atbegin \filehook@atend}% % all done - \fi + }% }% }% + % if <orig> is already loaded at this point, too late! + \platpc@ifloadederr{#1}% + % do it \AtBeginOfPackageFile{#1}{\csname platpc@begin@#1\endcsname}% } \@onlypreamble\platpc@patch@before |