texlive[48454] Master/texmf-dist: plautopatch (22aug18)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 22 23:30:15 CEST 2018


Revision: 48454
          http://tug.org/svn/texlive?view=revision&revision=48454
Author:   karl
Date:     2018-08-22 23:30:14 +0200 (Wed, 22 Aug 2018)
Log Message:
-----------
plautopatch (22aug18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/plautopatch/README.md
    trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf
    trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex
    trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf
    trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex
    trunk/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty

Modified: trunk/Master/texmf-dist/doc/latex/plautopatch/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/plautopatch/README.md	2018-08-22 21:20:03 UTC (rev 48453)
+++ trunk/Master/texmf-dist/doc/latex/plautopatch/README.md	2018-08-22 21:30:14 UTC (rev 48454)
@@ -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 @@
 
 ## Release Date
 
-2018-08-21
+2018-08-22
 
 Hironobu Yamashita

Modified: trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex	2018-08-22 21:20:03 UTC (rev 48453)
+++ trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch-ja.tex	2018-08-22 21:30:14 UTC (rev 48454)
@@ -121,4 +121,11 @@
 \end{verbatim}
 のようにコンマで区切っていくつでも除外できます。
 
+\section*{変更履歴}
+
+\begin{itemize}
+  \item 2018/08/21 v0.2  最初のCTANリリース版
+  \item 2018/08/22 v0.3  元パッケージ検出の改良
+\end{itemize}
+
 \end{document}

Modified: trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex	2018-08-22 21:20:03 UTC (rev 48453)
+++ trunk/Master/texmf-dist/doc/latex/plautopatch/plautopatch.tex	2018-08-22 21:30:14 UTC (rev 48454)
@@ -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 @@
     \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}

Modified: trunk/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty	2018-08-22 21:20:03 UTC (rev 48453)
+++ trunk/Master/texmf-dist/tex/latex/plautopatch/plautopatch.sty	2018-08-22 21:30:14 UTC (rev 48454)
@@ -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 at pkgname{plautopatch}
+\def\platpc at err{\PackageError\platpc at pkgname}
 \def\platpc at warn{\PackageWarningNoLine\platpc at pkgname}
 \def\platpc at info{\PackageInfo\platpc at pkgname}
 
@@ -17,11 +18,13 @@
 
 % low-level helpers
 
-%% \platpc at req@add{<package>}
+%% \platpc at ifreq@add{<package>}
 % = if not loaded yet, \RequirePackage{<package>}
 %   and add to list.
-\def\platpc at req@add#1{%
-  \@ifpackageloaded{#1}{}{\RequirePackage{#1}\platpc at addtolist{#1}}%
+\def\platpc at ifreq@add#1{%
+  \@ifpackageloaded{#1}{}{%
+    \RequirePackage{#1}\platpc at addtolist{#1}%
+  }%
 }
 
 %% \platpc at addtolist{<package>}
@@ -29,6 +32,23 @@
 \def\platpc at addtolist#1{\xdef\platpc at list{\platpc at list, #1}}
 \def\platpc at list{}% initialize
 
+%% \platpc at ifnotdisabled{<package>}{<code>}
+% = execute <code> if <package> is not disabled.
+\def\platpc at ifnotdisabled#1{%
+  \expandafter\ifx\csname platpc at disable@#1\endcsname\relax
+    \expandafter\@firstofone
+  \fi
+}
+
+%% \platpc at ifloadederr{<package>}
+% = throw an error if <package> is already loaded.
+\def\platpc at ifloadederr#1{%
+  \@ifpackageloaded{#1}{%
+    \platpc at err{Package `#1' already loaded!\MessageBreak
+      Use \string\RequirePackage{\platpc at pkgname} earlier}\@ehc
+  }%
+}
+
 % high-level helpers
 
 %% \platpc at patch@after{<orig>}{<patch>}
@@ -35,11 +55,13 @@
 % = Load <patch> after <orig>.
 \def\platpc at patch@after#1#2{%
   \expandafter\def\csname platpc at end@#1\endcsname{%
-    \expandafter\ifx\csname platpc at disable@#1\endcsname\relax
-      \platpc at req@add{#2}%
-    \fi
+    \platpc at ifnotdisabled{#1}{\platpc at ifreq@add{#2}}%
   }%
-  \AtEndOfPackageFile{#1}{\csname platpc at end@#1\endcsname}%
+  \@ifpackageloaded{#1}{%
+    \csname platpc at end@#1\endcsname
+  }{%
+    \AtEndOfPackageFile{#1}{\csname platpc at end@#1\endcsname}%
+  }%
 }
 \@onlypreamble\platpc at patch@after
 
@@ -46,24 +68,29 @@
 %% \platpc at patch@after at both{<orig 1>}{<orig 2>}{<patch>}
 % = Load <patch> after both <orig 1> & <orig 2>.
 \def\platpc at patch@after at both#1#2#3{%
-  % for order #2 => #1
   \expandafter\def\csname platpc at end@#1+#2\endcsname{%
-    \expandafter\ifx\csname platpc at disable@#1\endcsname\relax
-     \expandafter\ifx\csname platpc at disable@#2\endcsname\relax
-      \@ifpackageloaded{#2}{\platpc at req@add{#3}}{}%
-     \fi
-    \fi
+    \platpc at ifnotdisabled{#1}{\platpc at ifnotdisabled{#2}{%
+      \platpc at ifreq@add{#3}%
+    }}%
   }%
-  \AtEndOfPackageFile{#1}{\csname platpc at end@#1+#2\endcsname}%
-  % for order #1 => #2
-  \expandafter\def\csname platpc at end@#2+#1\endcsname{%
-    \expandafter\ifx\csname platpc at disable@#2\endcsname\relax
-     \expandafter\ifx\csname platpc at disable@#1\endcsname\relax
-      \@ifpackageloaded{#1}{\platpc at req@add{#3}}{}%
-     \fi
-    \fi
+  \@ifpackageloaded{#1}{%
+    \@ifpackageloaded{#2}{%
+      \csname platpc at end@#1+#2\endcsname
+    }{%
+      \AtEndOfPackageFile{#2}{\csname platpc at end@#1+#2\endcsname}%
+    }%
+  }{%
+    \@ifpackageloaded{#2}{%
+      \AtEndOfPackageFile{#1}{\csname platpc at end@#1+#2\endcsname}%
+    }{%
+      \AtEndOfPackageFile{#1}{%
+        \@ifpackageloaded{#2}{\csname platpc at end@#1+#2\endcsname}{}%
+      }%
+      \AtEndOfPackageFile{#2}{%
+        \@ifpackageloaded{#1}{\csname platpc at end@#1+#2\endcsname}{}%
+      }%
+    }%
   }%
-  \AtEndOfPackageFile{#2}{\csname platpc at end@#2+#1\endcsname}%
 }
 \@onlypreamble\platpc at patch@after at both
 
@@ -74,9 +101,9 @@
 %   - <patch> contains \RequirePackage{<orig>}
 \def\platpc at patch@before#1#2{%
   \expandafter\def\csname platpc at begin@#1\endcsname{%
-    % if <patch> is already loaded, nothing to do
-    \@ifpackageloaded{#2}{}{% else
-      \expandafter\ifx\csname platpc at disable@#1\endcsname\relax
+    \platpc at 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 at begin@#1\endcsname\relax
@@ -93,9 +120,12 @@
           \filehook@@atbegin
           \filehook at atend}%
         % all done
-      \fi
+      }%
     }%
   }%
+  % if <orig> is already loaded at this point, too late!
+  \platpc at ifloadederr{#1}%
+  % do it
   \AtBeginOfPackageFile{#1}{\csname platpc at begin@#1\endcsname}%
 }
 \@onlypreamble\platpc at patch@before



More information about the tex-live-commits mailing list