From b3ba42c57f43aa4acf39c30b4fc092ffdbf63269 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 12 Jun 2010 00:10:19 +0000
Subject: mylatexformat 2 (11jun10)

git-svn-id: svn://tug.org/texlive/trunk@18899 c570f23f-e606-0410-a88d-b1316a301751
---
 .../source/latex/mylatexformat/mylatexformat.dtx   | 50 +++++++++++++++++-----
 1 file changed, 39 insertions(+), 11 deletions(-)

(limited to 'Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx')

diff --git a/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx b/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx
index d7684e67168..0c50012e2db 100644
--- a/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx
+++ b/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx
@@ -1,5 +1,5 @@
 % \iffalse meta-comment
-% mylatexformat : 2010/04/30 v1.0 - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file]
+% mylatexformat : 2010/06/20 v2 - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file]
 %
 % This work may be distributed and/or modified under the
 % conditions of the LaTeX Project Public License, either
@@ -36,7 +36,7 @@
 \input docstrip.tex
 \Msg{************************************************************************}
 \Msg{* Installation}
-\Msg{* Package 2010/04/30 v1.0 - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file*}
+\Msg{* Package 2010/06/20 v2 - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file*}
 \Msg{************************************************************************}
 
 \keepsilent
@@ -47,7 +47,7 @@
 
 This is a generated file.
 
-mylatexformat : 2010/04/30 v1.0 - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file
+mylatexformat : 2010/06/20 v2 - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file
 
 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either
@@ -98,8 +98,8 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
 %<*driver>
 \edef\thisfile{\jobname}
 \def\thisinfo{Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file}
-\def\thisdate{2010/04/30}
-\def\thisversion{1.0}
+\def\thisdate{2010/06/20}
+\def\thisversion{2}
 \let\loadclass\LoadClass
 \def\LoadClass#1{\loadclass[abstracton]{scrartcl}\let\scrmaketitle\maketitle\AtEndOfClass{\let\maketitle\scrmaketitle}}
 \documentclass[a4paper,oneside]{ltxdoc}
@@ -126,7 +126,7 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
 %</driver>
 % \fi
 %
-% \CheckSum{0}
+% \CheckSum{208}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -573,8 +573,12 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
 %% Save the original definition.
 \makeatletter
 \let\etex@primitive@openout\openout
-\def\openout#1 {\g@addto@macro\MYLATEXopens{\immediate\etex@primitive@openout#1 }}
-\let\MYLATEXopens\@empty
+\let\ltx@listfiles\listfiles
+\def\openout#1 {\g@addto@macro\MYLATEXopens{\immediate\openout#1 }}
+\def\MYLATEXopens{%
+   \let\openout\etex@primitive@openout
+   \let\etex@primitive@openout\ltx@undefined
+}% \MYLATEXopens
 %% \begin is overloaded in order to stop \dump at begin document
 %% if the macro \endofdump is not given somewhere in the preamble.
 %% Rem: it is NOT POSSIBLE to redefine \document, for the macro
@@ -605,14 +609,14 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
       \ifdefined\footnotesize\footnotesize\fi
       \ifdefined\tiny\tiny\fi
    }}%
-   \let\openout\etex@primitive@openout
-   \let\etex@primitive@openout\@undefined
+   \let\openout\etex@primitive@openout% just in case - normally not necessary
    \let\begin\MYLATEX@latex@begin
    \let\MYLATEX@latex@begin\@undefined
+   \the\MYLATEX@hook\MYLATEX@hook{}%
    \makeatother
    \everyjob\expandafter{\the\everyjob
       \begingroup
-         \listfiles
+         \listfiles\let\listfiles\ltx@listfiles
          \expandafter\MYLATEXcustomised\@dofilelist
       \endgroup}%
    \catcode`\\=13\relax%
@@ -673,6 +677,20 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
             /MYLATEX}%
       ^^M}%
 }% Leaving simple groupe (level 1) => start reading document
+%    \end{macrocode}
+%
+%\begin{macro}{\AtEndOfDump}
+% This is just a hook to be executed when \cs{endofdump} is encoutered,
+% (or \cs{begin}\{document\}). Therefore, the code having been set \cs{AtEndOfDump}
+% is included in the format:
+%    \begin{macrocode}
+\newtoks\MYLATEX@hook
+\def\AtEndOfDump{\addto@hook\MYLATEX@hook}
+\AtEndOfDump{\let\AtEndOfDump\@undefined}
+%    \end{macrocode}
+%\end{macro}
+%
+%    \begin{macrocode}
 %% Trick lookahead to allow mylatex.ltx and the document filename to be
 %% given on the same command line. (initex &latex mylatex.ltx {abc.tex})
 \expandafter\input\endinput%
@@ -682,6 +700,16 @@ Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
 % \DeleteShortVerb{\+}^^A\UndefineShortVerb{\+}
 % \begin{History}
 %
+%   \begin{Version}{2010/06/20 v2}
+%   \item Added: \cs{AtEndOfDump} macro to include some code in the format, just before \cs{dump}.
+%   \item Added: \cs{listfiles} is now available in the preamble, after \cs{endofdump}, when the document is compiled with its format.
+%   \end{Version}
+%
+%   \begin{Version}{2010/05/20 v1.2}
+%   \item Fixed a bug in \cs{MYLATEXopens} \\
+%         (There was problems when including an index in the format for example...)
+%   \end{Version}
+%
 %   \begin{Version}{2010/04/30 v1.0}
 %   \item First version.
 %   \end{Version}
-- 
cgit v1.2.3

