texlive[64828] Master/texmf-dist: \subfile fixes, tex4ht r1224

commits+karl at tug.org commits+karl at tug.org
Wed Oct 26 23:20:53 CEST 2022


Revision: 64828
          http://tug.org/svn/texlive?view=revision&revision=64828
Author:   karl
Date:     2022-10-26 23:20:53 +0200 (Wed, 26 Oct 2022)
Log Message:
-----------
\subfile fixes, tex4ht r1224

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=1224

Modified Paths:
--------------
    trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
    trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
    trunk/Master/texmf-dist/tex/generic/tex4ht/subfiles.4ht
    trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2022-10-26 20:06:21 UTC (rev 64827)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2022-10-26 21:20:53 UTC (rev 64828)
@@ -1,3 +1,9 @@
+2022-10-26  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (subfiles.4ht): fixed handling of environments
+	inside TeX files included using \subfile.
+	https://github.com/michal-h21/make4ht/issues/84
+
 2022-10-25  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-4ht.tex (fontmath.4ht, plain.4ht),

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2022-10-26 20:06:21 UTC (rev 64827)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex	2022-10-26 21:20:53 UTC (rev 64828)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1223 2022-10-25 20:53:26Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1224 2022-10-26 14:03:21Z michal_h21 $
 % tex tex4ht-4ht   or   ht tex tex4ht-4ht
 %
 % Copyright 2009-2022 TeX Users Group    
@@ -4977,31 +4977,34 @@
 \endinput
 >>> \AddFile{9}{subfiles}
 
-We use the original version of \Verb|\subfiles at renewEndDocument|, the only 
-change is that we added the \Verb|\choose:begin| redefinition. It is necessary
-to prevent processing of the document after \Verb|\end{document}| in the 
-included subfile.
+The Subfiles package redefines handling of LaTeX environments.
+Because the included TeX files contain \Verb|\end{document}|,
+it causes immediate stop of the main file processing. 
 
+We must test for environment names in the included document,
+and set \Verb|\choose:begin| to grab the second argument,
+which will prevent the stop of the processing.
+
+
 \<subfiles enddocument\><<<
+\def\subfiles:end{%
+  \def\:temp{document}
+  \ifx\@currenvir\:temp
+    \let\choose:begin\@secondoftwo%
+    \subfiles at restoreEndFrom\:gobble
+  \fi%
+}
+
 \def\:tempa#1{%
   \ifcsname subfiles at end\endcsname
-  \else
-    \subfiles at saveEndTo\subfiles at end
-  \fi
-  \let\choose:begin\@secondoftwo
-  \expandafter\def\csname end \endcsname##1{%
-    \romannumeral
-    \subfiles at StrIfEqTF{##1}{document}{%
-      \z@
-      \subfiles at restoreEndFrom\subfiles at end
-      #1%
-    }{%
-      \expandafter\expandafter\expandafter\z@\subfiles at end{##1}%
-    }%
-  }%
+\else
+  \subfiles at saveEndTo\subfiles at end
+\fi
+\pend:defI\end\subfiles:end
 }
 
 \HLet\subfiles at renewEndDocument\:tempa
+
 >>>
 
 \Section{url.sty}

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/subfiles.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/subfiles.4ht	2022-10-26 20:06:21 UTC (rev 64827)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/subfiles.4ht	2022-10-26 21:20:53 UTC (rev 64828)
@@ -1,4 +1,4 @@
-% subfiles.4ht (2022-04-04-07:06), generated from tex4ht-4ht.tex
+% subfiles.4ht (2022-10-26-13:32), generated from tex4ht-4ht.tex
 % Copyright 2022 TeX Users Group
 %
 % This work may be distributed and/or modified under the
@@ -16,28 +16,27 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2022-04-04-07:06}
+\immediate\write-1{version 2022-10-26-13:32}
 
+\def\subfiles:end{%
+  \def\:temp{document}
+  \ifx\@currenvir\:temp
+    \let\choose:begin\@secondoftwo%
+    \subfiles at restoreEndFrom\:gobble
+  \fi%
+}
+
 \def\:tempa#1{%
   \ifcsname subfiles at end\endcsname
-  \else
-    \subfiles at saveEndTo\subfiles at end
-  \fi
-  \let\choose:begin\@secondoftwo
-  \expandafter\def\csname end \endcsname##1{%
-    \romannumeral
-    \subfiles at StrIfEqTF{##1}{document}{%
-      \z@
-      \subfiles at restoreEndFrom\subfiles at end
-      #1%
-    }{%
-      \expandafter\expandafter\expandafter\z@\subfiles at end{##1}%
-    }%
-  }%
+\else
+  \subfiles at saveEndTo\subfiles at end
+\fi
+\pend:defI\end\subfiles:end
 }
 
 \HLet\subfiles at renewEndDocument\:tempa
 
+
 \Hinput{subfiles}
 \endinput
 

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht	2022-10-26 20:06:21 UTC (rev 64827)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht	2022-10-26 21:20:53 UTC (rev 64828)
@@ -1,4 +1,4 @@
-% usepackage.4ht (2022-10-25-13:59), generated from tex4ht-4ht.tex
+% usepackage.4ht (2022-10-26-13:32), generated from tex4ht-4ht.tex
 % Copyright 2003-2009 Eitan M. Gurari
 % Copyright 2009-2022 TeX Users Group
 %
@@ -17,7 +17,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2022-10-25-13:59}
+\immediate\write-1{version 2022-10-26-13:32}
 
    \def\:temp{tex4ht}\ifx \:temp\@currname
    \:warning{\string\usepackage{tex4ht} again?}



More information about the tex-live-commits mailing list.