diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-29 23:59:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-29 23:59:41 +0000 |
commit | 20c4fb92a115f9fbb0362a9834d4fc56aa99adcb (patch) | |
tree | 15ea8d7fc92164bf75d7141553e058a3e541f6b1 | |
parent | 8f6599a9f86ce52e246d5595a68700551208ee9c (diff) |
new package mylatexformat (29apr10)
git-svn-id: svn://tug.org/texlive/trunk@18049 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/mylatexformat/README | 44 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mylatexformat/mylatexformat.pdf | bin | 0 -> 154510 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/mylatexformat/mylatexformat.drv | 55 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx | 693 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mylatexformat/mylatexformat.ins | 86 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/mylatexformat/mylatexformat.ltx | 284 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 1 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 3 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/mylatexformat.tlpsrc | 0 |
10 files changed, 1166 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/mylatexformat/README b/Master/texmf-dist/doc/latex/mylatexformat/README new file mode 100644 index 00000000000..3a738ff5c36 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mylatexformat/README @@ -0,0 +1,44 @@ +Use mylatexformat.ltx to make a format based on the preamble +of any LaTeX file. + +The use of formats helps to speed up compilations: packages which have been +dumped in the format are loaded at very high speed. This is useful when a +document load many packages (pgf-TikZ among other...) + +For the creation of the format use a command line like: + +etex -initialize [opts] "&pdflatex" mylatexformat.ltx """abc.tex""" + +mylatexformat.ltx has been primarily written from mylatex.ltx +(available on CTAN under the contrib/Carlisle/ directory) but +gets rid of many limitations or problems of mylatex.ltx. + +More precisely: + +- The format is created from the beginning of the file (usually + \documentclass[...]{...} + until either: + ~ \begin{document} + ~ \endofdump + if \endofdump is encountered in the preamble + ~ \csname endofdump\endcsname + for convenience: to avoid `undefined control sequence' + in case the document is compiled without the format. + +- \begin{document} \endofdump or \csname endofdump\endcsname + can be precedeed or followed by other macros or commentaries. + +- Commentaries in the preamble are ignored (braces are not required + to be equilibrated). + +- packages that modify the \document macro (like auxhook.sty or + etoolbox.sty) can be included in the format. + +- A report is available in the .log file. + +I have been using mylatexformat.ltx with MikTeX under: + - pdfTeX in dvi mode + - pdfTeX in pdf mode + - XeTeX + +Comments about its use on other system are welcome !
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mylatexformat/mylatexformat.pdf b/Master/texmf-dist/doc/latex/mylatexformat/mylatexformat.pdf Binary files differnew file mode 100644 index 00000000000..6fab689d54b --- /dev/null +++ b/Master/texmf-dist/doc/latex/mylatexformat/mylatexformat.pdf diff --git a/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.drv b/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.drv new file mode 100644 index 00000000000..8a72d6a75f5 --- /dev/null +++ b/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.drv @@ -0,0 +1,55 @@ +%% +%% This is file `mylatexformat.drv', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mylatexformat.dtx (with options: `driver') +%% +%% 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 +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% +%% This work consists of the main source file mylatexformat.dtx +%% and the derived files +%% mylatexformat.ltx, mylatexformat.pdf, mylatexformat.ins +%% +%% mylatexformat - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +\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} +\let\loadclass\LoadClass +\def\LoadClass#1{\loadclass[abstracton]{scrartcl}\let\scrmaketitle\maketitle\AtEndOfClass{\let\maketitle\scrmaketitle}} +\documentclass[a4paper,oneside]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[american]{babel} +\usepackage[T1]{fontenc} +\usepackage{etex,etoolbox,holtxdoc,geometry,lastpage,tocloft,graphicx,xspace,fancyhdr,color,bbding,embedfile,framed,keycommand,multirow,txfonts,makecell,enumitem,arydshln,atveryend} +\CodelineNumbered +\usepackage{fancyvrb} +\lastlinefit999 +\geometry{top=2cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} +\hypersetup{% + pdftitle={The mylatexformat package}, + pdfsubject={Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file}, + pdfauthor={Florent CHERVET}, + colorlinks,linkcolor=reflink, + pdfstartview={FitH}, + pdfkeywords={tex, e-tex, latex, package, format, formats, pdfTeX}, + bookmarksopen=true,bookmarksopenlevel=2} +\embedfile{\thisfile.dtx} +\begin{document} + \DocInput{\thisfile.dtx} +\end{document} +\endinput +%% +%% End of file `mylatexformat.drv'. diff --git a/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx b/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx new file mode 100644 index 00000000000..d7684e67168 --- /dev/null +++ b/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.dtx @@ -0,0 +1,693 @@ +% \iffalse meta-comment +% mylatexformat : 2010/04/30 v1.0 - 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 +% version 1.3 of this license or (at your option) any later +% version. The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% +% This work consists of the main source file mylatexformat.dtx +% and the derived files +% mylatexformat.ltx, mylatexformat.pdf, mylatexformat.ins +% +% Unpacking: +% (a) If mylatexformat.ins is present: +% etex mylatexformat.ins +% (b) Without mylatexformat.ins: +% etex mylatexformat.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{mylatexformat.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (pdf)latex mylatexformat.dtx +% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%<*ignore> +\begingroup + \def\x{LaTeX2e}% +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +%</ignore> +%<*install> +\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{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +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 + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 of this license or (at your option) any later +version. The latest version of this license is in + http://www.latex-project.org/lppl.txt + +This work consists of the main source file mylatexformat.dtx +and the derived files + mylatexformat.ltx, mylatexformat.pdf, mylatexformat.ins + +mylatexformat - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file +Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{mylatexformat.ins}{\from{mylatexformat.dtx}{install}}% + \file{mylatexformat.ltx}{\from{mylatexformat.dtx}{package}}% +} + +%%\askforoverwritetrue +\generate{% + \file{mylatexformat.drv}{\from{mylatexformat.dtx}{driver}}% +} + +\obeyspaces +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* mylatexformat.ltx} +\Msg{*} +\Msg{* To produce the documentation run the file `mylatexformat.dtx'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +%</install> +%<*ignore> +\fi +%</ignore> +%<*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} +\let\loadclass\LoadClass +\def\LoadClass#1{\loadclass[abstracton]{scrartcl}\let\scrmaketitle\maketitle\AtEndOfClass{\let\maketitle\scrmaketitle}} +\documentclass[a4paper,oneside]{ltxdoc} +\usepackage[latin1]{inputenc} +\usepackage[american]{babel} +\usepackage[T1]{fontenc} +\usepackage{etex,etoolbox,holtxdoc,geometry,lastpage,tocloft,graphicx,xspace,fancyhdr,color,bbding,embedfile,framed,keycommand,multirow,txfonts,makecell,enumitem,arydshln,atveryend} +\CodelineNumbered +\usepackage{fancyvrb} +\lastlinefit999 +\geometry{top=2cm,headheight=1cm,headsep=.3cm,bottom=1.4cm,footskip=.5cm,left=2.5cm,right=1cm} +\hypersetup{% + pdftitle={The mylatexformat package}, + pdfsubject={Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file}, + pdfauthor={Florent CHERVET}, + colorlinks,linkcolor=reflink, + pdfstartview={FitH}, + pdfkeywords={tex, e-tex, latex, package, format, formats, pdfTeX}, + bookmarksopen=true,bookmarksopenlevel=2} +\embedfile{\thisfile.dtx} +\begin{document} + \DocInput{\thisfile.dtx} +\end{document} +%</driver> +% \fi +% +% \CheckSum{0} +% +% \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 +% Lower-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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \DoNotIndex{\begin,\CodelineIndex,\CodelineNumbered,\def,\DisableCrossrefs,\~,\@ifpackagelater} +% \DoNotIndex{\ttfamily,\tiny,\sffamily,\small,\normalfont,\newindex,\makeindex,\makeglossary,\LARGE,\Large,\large,\itshape,\immediate} +% \DoNotIndex{\&,\/,\=,\@dofilelist,\@spaces,\@undefined,\^,\active,\bfseries,\boldmath,\etex@primitive@openout,\footnotesize,\g@addto@macro,\Huge} +% \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\end,\GetFileInfo} +% \DoNotIndex{\NeedsTeXFormat,\OnlyDescription,\RecordChanges,\usepackage} +% \DoNotIndex{\ProvidesClass,\ProvidesPackage,\ProvidesFile,\RequirePackage} +% \DoNotIndex{\filename,\fileversion,\filedate,\let} +% \DoNotIndex{\@listctr,\@nameuse,\csname,\else,\endcsname,\expandafter} +% \DoNotIndex{\gdef,\global,\if,\item,\newcommand,\nobibliography} +% \DoNotIndex{\par,\providecommand,\relax,\renewcommand,\renewenvironment} +% \DoNotIndex{\stepcounter,\usecounter,\nocite,\fi} +% \DoNotIndex{\@fileswfalse,\@gobble,\@ifstar,\@unexpandable@protect} +% \DoNotIndex{\AtBeginDocument,\AtEndDocument,\begingroup,\endgroup} +% \DoNotIndex{\frenchspacing,\MessageBreak,\newif,\PackageWarningNoLine} +% \DoNotIndex{\protect,\string,\xdef,\ifx,\texttt,\@biblabel,\bibitem} +% \DoNotIndex{\z@,\wd,\wheremsg,\vrule,\voidb@x,\verb,\bibitem} +% \DoNotIndex{\FrameCommand,\MakeFramed,\FrameRestore,\hskip,\hfil,\hfill,\hsize,\hspace,\hss,\hbox,\hb@xt@,\endMakeFramed,\escapechar} +% \DoNotIndex{\do,\date,\if@tempswa,\@tempdima,\@tempboxa,\@tempswatrue,\@tempswafalse,\ifdefined,\ifhmode,\ifmmode,\cr} +% \DoNotIndex{\box,\author,\advance,\multiply,\Command,\outer,\next,\leavevmode,\kern,\title,\toks@,\trcg@where,\tt} +% \DoNotIndex{\the,\width,\star,\space,\section,\subsection,\textasteriskcentered,\textwidth} +% \DoNotIndex{\",\:,\@empty,\@for,\@gtempa,\@latex@error,\@namedef,\@nameuse,\@tempa,\@testopt,\@width,\\,\m@ne,\makeatletter,\makeatother} +% \DoNotIndex{\maketitle,\parindent,\setbox,\x,\kernel@ifnextchar} +% \DoNotIndex{\KVS@CommaComma,\KVS@CommaSpace,\KVS@EqualsSpace,\KVS@Equals,\KVS@Global,\KVS@SpaceEquals,\KVS@SpaceComma,\KVS@Comma} +% \DoNotIndex{\DefineShortVerb,\DeleteShortVerb,\UndefineShortVerb,\MakeShortVerb,\endinput} +% ^^A\AfterLastShipout{\label{LastPage}}% +% \let\ClearPage\clearpage +% \makeatletter +% \MakeShortVerb{\+}\DeleteShortVerb{\|}\DefineShortVerb{\|} +% \catcode`\§ \active \def§{\@ifnextchar §{\par\nobreak\vskip-2\parskip}{\par\nobreak\vskip-\parskip}} +% \def\thispackage{\xpackage{\thisfile}\xspace} +% \def\ThisPackage{\Xpackage{\thisfile}\xspace} +% \def\Xpackage{\@dblarg\X@package} +% \def\X@package[#1]#2{\@testopt{\X@@package{#1}{#2}}{}} +% \def\X@@package#1#2[#3]{% +% \xpackage{#2\footnote{\noindent\xpackage{#2}: \href{http://www.ctan.org/tex-archive/macros/latex/contrib/#1}{\nolinkurl{CTAN:macros/latex/contrib/#1}}#3}}} +% \def\Underbrace#1_#2{$\underbrace{\vtop to2ex{}\hbox{#1}}_{\footnotesize\hbox{#2}}$} +% +% \parindent\z@\parskip.4\baselineskip\topsep\parskip\partopsep\z@ +% \g@addto@macro\macro@font{\macrocodecolor\let\AltMacroFont\macro@font} +% \g@addto@macro\@list@extra{\parsep\parskip\topsep\z@\itemsep\z@} +% \def\smex{\leavevmode\hb@xt@2em{\hfil$\longrightarrow$\hfil}} +% \newrobustcmd\verbfont{\usefont{T1}{\ttdefault}{\f@series}{n}} \let\vb\verbfont +% \renewrobustcmd\#[1]{{\usefont{T1}{pcr}{bx}{n}\char`\##1}} +% \newrobustcmd\csred[1]{\textcolor{red}{\cs{#1}}} +% \renewrobustcmd\cs[2][]{\mbox{\vb#1\expandafter\@gobble\string\\#2}} +% \newrobustcmd\CSbf[1]{\textbf{\CS{#1}}} +% \newrobustcmd\csbf[2][]{\textbf{\cs[{#1}]{#2}}} +% \newrobustcmd\textttbf[1]{\textbf{\texttt{#1}}} +% \renewrobustcmd*\bf{\bfseries}\newcommand\nnn{\normalfont\mdseries\upshape}\newcommand\nbf{\normalfont\bfseries\upshape} +% \newrobustcmd*\blue{\color{blue}}\newcommand*\red{\color{dr}}\newcommand*\green{\color{green}}\newcommand\rred{\color{red}} +% \newrobustcmd\rrbf{\color{red}\bfseries} +% \definecolor{copper}{rgb}{0.67,0.33,0.00} \newcommand\copper{\color{copper}} +% \definecolor{dg}{rgb}{0.16,0.33,0.00} \newcommand\dg{\color{dg}} +% \definecolor{db}{rgb}{0,0,0.502} \newcommand\db{\color{db}} +% \definecolor{dr}{rgb}{0.49,0.00,0.00} \let\dr\red +% \newrobustcmd\bk{\color{black}}\newcommand\md{\mdseries} +% \DefineVerbatimEnvironment{Verb}{Verbatim}{gobble=1} +% \DefineVerbatimEnvironment{VerbLines}{Verbatim}{gobble=1,frame=lines,framesep=6pt,fontfamily=txtt,fontseries=b} +% \DeleteShortVerb{\+} +%\newkeyenvironment+[\|]{dblruled}[first=.4pt,second=.4pt,sep=1pt,left=\z@]% +% {|\def\FrameCommand|{% +% \vrule\@width\commandkey{first} +% \hskip\commandkey{sep} +% \vrule\@width\commandkey{second} +% |\hspace|{\commandkey{left}}} +% |\MakeFramed| {\advance\hsize-|\width \FrameRestore|}% +% }{% +% |\endMakeFramed|% +% } +% \fancyhf{}\fancyhead[L]{The \thispackage package -- \thisinfo} +% \fancyfoot[L]{\color[gray]{.35}\scriptsize\thispackage\quad[rev.\thisversion]\quad\copyright\oldstylenums{2010}\,\lower.3ex\hbox{\NibRight}\,Florent Chervet} +% \fancyfoot[R]{\oldstylenums{\thepage} / \oldstylenums{\pageref{LastPage}}} +% \pagestyle{fancy} +% \fancypagestyle{plain}{% +% \let\headrulewidth\z@ +% \fancyhf{}% +% \fancyfoot[R]{\oldstylenums{\thepage} / \oldstylenums{\pageref{LastPage}}}} +% +% \newcommand\macrocodecolor{\color{macrocode}}\definecolor{macrocode}{rgb}{0.18,0.00,0.45} +% \newcommand\reflinkcolor{\color{reflink}}\definecolor{reflink}{rgb}{0.49,0.00,0.00} +% \newrobustcmd\stform{\@ifnextchar*{\@stform[]\textasteriskcentered\@gobble}\@stform} +% \newrobustcmd\@stform[2][\string]{\textttbf{\rred#1#2}\xspace} +% +% \makeatother +% +% \deffootnote{1em}{0pt}{\rlap{\textsuperscript{\thefootnotemark}}\kern1em} +% +% \title{\vskip-18pt\mdseries The {\bfseries\ThisPackage}\kern.6em package} +% \author{\footnotesize\xemail{florent.chervet@free.fr}} +% \date{\thisdate~--~version \thisversion} +% \subtitle{Use {\db mylatexformat.ltx} to make a format based on the preamble of any LaTeX file} +% ^^A\subject{\thisinfo} +% +% \maketitle +% +% \makeatletter\begingroup\let\@thefnmark\@empty\let\@makefntext\@firstofone +% \footnotetext{\noindent +% This documentation is produced with the +DocStrip+ utility. +% \begin{tabbing} +% \qquad\=\smex\=To get the documentation, \= run (thrice):\quad\= \texttt{pdflatex \thisfile.dtx} \\ +% \qquad\>\>To get the index, \> run:\>\texttt{makeindex -s gind.ist \thisfile.idx} \\ +% \>\smex\>To get the package, \> run:\> \texttt{etex \thisfile.dtx} +% \end{tabbing}§ +% The \xext{dtx} file is embedded into this pdf file thank to \xpackage{embedfile} by H. Oberdiek.} +% \endgroup\makeatother +% +% \deffootnote{1em}{0pt}{\rlap{\thefootnotemark.}\kern1em} +% +% ^^A---------------------------------------------------------------------------- +% \vskip-48pt +% \begin{abstract}\parindent0pt\noindent\leftskip1cm\rightskip\leftskip\lastlinefit0% +% +% {\db\xpackage{mylatexformat.ltx}} can be used to make a format from any \LaTeX{} file. +% \medskip +% +% The use of formats helps to speed up compilations: packages which have been +% dumped in the format are loaded at very high speed. +% \medskip +% +% The format is usually made from the preamble of a \xext{tex} file. But with +% \thispackage, you may stop the format at any point in the preamble +% using the command \csbf[\rred]{endofdump} before \texttt{\cs{begin}\{document\}}.% +% \medskip +% +% As far as I am concerned, I'm using MikTeX and have not been able to test the +% file on other systems. However, the portability of \TeX{} documents is well known... +% +% I've been using \xpackage{mylatexformat.ltx} with \LaTeX{}, pdf\TeX{} and Xe\TeX{} and it worked fine... +% \medskip +% +% \thispackage was primarily a written from \Xpackage[carlisle]{mylatex.ltx}[ from David Carlisle (1994/09/27)], +% but is very different in many points. +% +% \end{abstract} +% +% \DeleteShortVerb{\+}\enlargethispage{2\baselineskip} +% \cftbeforesecskip=4pt plus2pt minus2pt +% \cftbeforesubsecskip=0pt plus2pt minus2pt +% \renewcommand\contentsname{Contents\quad\leaders\vrule height3.4pt depth-3pt\hfill\null\kern0pt\vskip-6pt} +% ^^A\vskip-.8\baselineskip +% \tableofcontents +% \leavevmode\leaders\vrule height3.4pt depth-3pt\hfill\null +% \clearpage +% ^^A---------------------------------------------------------------------------- +% +% \hypersetup{bookmarksopenlevel=3} +% +% ^^A\clearpage +% \MakeShortVerb{\+} +% +% \def\B#1{\texttt{[}\meta{#1}\texttt{]}} +% +% \section{Creating a format} +% +% \subsection{Using MikTeX} +% +% \subsubsection{With preloaded pdflatex format (pdf output)} +% +% Use the following command line: +% +% \quad+etex -initialize [opts] "&pdflatex" mylatexformat.ltx """abc.tex"""+ +% +% You need 3 quotes around your \xext{tex} file if its name contains space +% (only one quote if it does not contain any space, but 3 quotes is more general...) +% \medskip +% +% Full example:§§ +% \begin{VerbLines} +% etex -initialize -interaction=nonstopmode +% -save-size=20000 -stack-size=20000 +% -jobname="Mon Beau Format Perso" +% "&pdflatex" mylatexformat.ltx """Mon Fichier TeX.tex""" +% \end{VerbLines} +% +% +% \subsubsection{With preloaded latex format (dvi output)} +% +% Use the following command line: +% +% \quad+etex -initialize [opts] "&latex" mylatexformat.ltx """abc.tex"""+ +% +% +% \subsubsection{With preloaded format xelatex (pdf output)} +% +% Use the following command line: +% +% \quad+xetex -initialize [opts] "&xelatex" mylatexformat.ltx """abc.tex"""+ +% +% +% \subsection{Using other distributions} +% +% As I pointed out in the \texttt{abstract}, I have not been able to test the file on other distributions. +% +% \section{Using a format} +% +% \subsection{Using MikTeX} +% +% Add the format to the very first line of your LaTeX file : +% +% \quad+%&"Mon Beau Format"+ +% +% You may use the $\varepsilon$-\TeX{} option : +-dont-parse-first-line+ \quad to avoid loading the format. +% +% \subsection{Using other distributions} +% +% As I pointed out in the \texttt{abstract}, I have not been able to test the file on other distributions. +% +% \clearpage +% +% \section[How does it work ? (and why it is different from mylatex.ltx)]{How does it work ? (and why it is different from \xpackage{mylatex.ltx})} +% +% \xpackage{mylatex.ltx} has three important limitations: +% \begin{enumerate}[label=\arabic*)~] +% \item The end of the format is either \verb+\begin{document}+ or the comment \verb+%mylatex+\\ +% Therefore, after the format has been loaded, \TeX{} checks the commentaries in the preamble +% in order to skip everything before \verb+%mylatex+. \\ +% But this way, braces \textbf{must match inside commentaries !} +% \item \xpackage{mylatex.ltx} temporarily redefines the command \cs{document} in order to stop +% the creation of the format (execution of \cs{dump}) at begin document. \\ +% However, the \textbf{initial definition of the macro \csbf{document}} is saved +% and reloaded after the format has been loaded. \\ +% Therefore, package that modifies this macro (such as \Xpackage[oberdiek/auxhook]{auxhook}[ H. Oberdiek] or +% \Xpackage{etoolbox}[ P. Lehman] cannot be included in the format! +% \item If your document starts with :\\ +% \verb+\begin{document}% commentary+ or with :\\ +% \verb+\begin{document}\makeatletter+ \\ +% the format is not stopped at \verb+\begin{document}+ and an error occurs. +% \end{enumerate} +% +% ^^AWith \xpackage{mylatexformat.ltx}, those limitations are lifted. +% ^^A\begin{enumerate}[label=\arabic*)~] +% ^^A\item Temporarily redefines \cs{begin} in order to check if its argument is \meta{document}. +% ^^A\end{enumerate} +% +% \begin{dblruled}[first=2pt,sep=1pt,second=.6pt,left=4pt] +% With \xpackage{mylatexformat.ltx}, those limitations are lifted. +% +% \xpackage{mylatexformat.ltx}: +% \begin{enumerate}[label=\arabic*)~] +% \item Temporarily redefines \cs{begin} in order to check if its argument is \meta{document}. \\ +% Therefore, packages like \xpackage{auxhook} or \xpackage{etoolbox} can be included in the format. +% \item Stops the format when it encounters \verb+\begin{document}+ or \cs{endofdump}. +% \item Does not read inside commentaries +% \item After the format has been loaded, each line is checked to see if it \textbf{contains} either: +% \begin{description}[align=left,labelsep=1cm,font=\bfseries,labelindent=1cm] +% \item[] {\dr\verb+\begin{document}+} +% \item[or: ] {\dr\verb+\endofdump+} +% \item[or: ] {\dr\verb+\csname endofdump\endcsname+}\textsuperscript{\bfseries\textasteriskcentered} +% \end{description} +% Report is written in the \xext{log} file, with the job name, the name of the preloaded format, +% the list of preloaded files and the first input line read after loading of format. +% \end{enumerate} +% +% {\footnotesize\textsuperscript{\bfseries\textasteriskcentered} this way, the command \verb+\csname endofdump\endcsname+ is silently ignored +% (equiv. to \cs{relax}) in case the format is not used.} +% \end{dblruled} +% +% +% +% +% \StopEventually{ +% } +% +% \begin{center}\vskip6pt$\star$\hskip4em\lower12pt\hbox{$\star$}\hskip4em$\star$\vadjust{\vskip12pt}\end{center} +% +% \hypersetup{bookmarksopenlevel=1} +% \section{Implementation} \label{Implementation} +% \csdef{HDorg@PrintMacroName}#1{\hbox to4em{\strut \MacroFont \string #1\ \hss}} +% +% \begin{macrocode} +%<*package> +%%% _____________________________________________________________________ +%%% mylatexformat.ltx +%%% ^^^^^^^^^^^^^^^^^ +%%% From an original idea by David Carlisle - mylatex.ltx 1994/09/27 +%%% © lppl 2010 - F Chervet - 2010/04/25 +%%% _____________________________________________________________________ +%%% +%%% Use this file to make a format based on the preamble of any LaTeX +%%% file. +%%% +%%% The format is made from the very beginning of the file up to either: +%%% i) the command : \endofdump +%%% placed in the preamble +%%% ii) the command : \csname endofdump\endcsname +%%% placed in the preamble +%%% iii) \begin{document} +%%% if \endofdump nor \csname endofdump\endcsname +%%% haven't been found in the preamble. +%%% +%%% A format helps to speed up compilations, packages which have been +%%% dumped in the format are loaded at very high speed. +%%% -------------------------------------------------------------------- +%%% There are no restrictions on the distribution or modification of +%%% this file, except that other people should not attempt to alter +%%% the master copy on the ctan archives. +%%% +%%% Making the format -------------------------------------------------- +%%% ^^^^^^^^^^^^^^^^^ USING MikTeX +%%% * With preloaded pdflatex format (pdf output) : +%%% etex -initialize [opts] "&pdflatex" mylatexformat.ltx """abc.tex""" +%%% => compile your document using : +%%% pdflatex +%%% or texify --tex-option=-output-format=pdf +%%% +%%% * With preloaded latex format (dvi output) : +%%% etex -initialize [opts] "&latex" mylatexformat.ltx """abc.tex""" +%%% => compile your document using +%%% latex +%%% or texify --tex-option=-output-format=dvi +%%% +%%% * With preloaded format xelatex (pdf output) : +%%% xetex -initialize [opts] "&xelatex" mylatexformat.ltx """abc.tex""" +%%% => compile your document using xelatex +%%% +%%% NOTA BENE: Please, notice the 3 quotes ! +%%% ^^^^^^^^^^ +%%% +%%% In fact, 3 quotes are necessary only if you "file name.tex" contains a space ! +%%% +%%% -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +%%% Exemple of a command line for making format using pdfTeX : +%%% +%%% etex -initialize -interaction=nonstopmode +%%% -save-size=20000 -stack-size=20000 +%%% -jobname="Mon Beau Format Perso" +%%% "&pdflatex" mylatexformat.ltx "Mon Fichier TeX.tex" +%%% +%%% "Mon Beau Format Perso.fmt" (en Français dans le texte) will be created +%%% (or overwritten) in the current working directory. +%%% +%%% Using the format --------------------------------------------------- +%%% ^^^^^^^^^^^^^^^^^ USING MikTeX +%%% Add the format to the very first line of your LaTeX file : +%%% --> first line : %&"format file name" +%%% without the .fmt extension. +%%% [You may use the option : -dont-parse-first-line option +%%% to avoid loading the format] +%%% -------------------------------------------------------------------- +%% ____________________________________________________________________ +%% The following informations come from mylatex.ltx from David Carlisle: +%% Given a LaTeX file `abc.tex', use initex as follows: +%% +%% initex &latex mylatexformat.ltx abc (Generic TeX) +%% initex \&latex mylatexformat.ltx abc (unix and other TeX's) +%% tex /i &latex mylatexformat.ltx abc (emtex) +%% +%% If you are on a Mac or using some shell that makes it inconvenient +%% to use a command line such as the above examples then you may +%% make a file `mylatex.tex' with the single line +%% \input mylatex.ltx abc +%% and then pass the file mylatex.tex to your (ini)tex shell to produce +%% the format, ie something equivalent to initex &latex mylatex.tex. +%% +%% If you are using OzTeX, see the separate instructions below. +%% +%% This should make a format file mylatex.fmt which you can then use +%% as follows +%% +%% Using the new format +%% ^^^^^^^^^^^^^^^^^^^^ +%% +%% tex &mylatex abc (generic TeX) +%% virtex \&mylatex abc (Unix TeX) +%% +%% This will process your document, abc.tex, just as LaTeX does, but +%% quicker as the contents of the preamble will be stored in the +%% format file and will not need to be run each time. +%% +%% If (vir)tex fails to find your mylatex.fmt then it is not searching +%% in the current directory, either modify your TEXFORMATS path (or +%% equivalent) to search `.' or (on unix/dos) use ./ as in: +%% virtex \&./mylatex abc +%% +%% Making and using the format with OzTeX +%% ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +%% +%% Given a LaTeX file `abc.tex', do this: select `TeX...' from OzTeX's +%% TeX menu, and go to the folder containing the file `abc.tex' as if you +%% were selecting the file `abc.tex'. Then hit the Cancel button - this +%% procedure sets OzTeX's working folder to the one containing abc.tex. +%% Next, select iniTeX from the TeX menu, and type: +%% +%% &latex mylatex.ltx abc +%% +%% This should make a format file mylatex.fmt which you can save in the +%% same folder as the file you're working on. +%% +%% To use the new format, put this at the very start of the very first +%% line of your document: +%% +%% %&mylatex +%% +%% Further Notes +%% +%% The file abc.tex must contain a line *just* with +%% \begin{document} +%% Everything up to (but not including) the \begin{document} will +%% be saved in the format and not executed in subsequent runs. +%% +%% If you are modifying the document (or working on a similar document) +%% you may wish to add new commands to your document preamble. +%% The `mylatex' format normally skips the whole preamble (believing +%% it to be pre-loaded) and so such new commands do not take effect. +%% You could re-make the format, preloading the new preamble, but that +%% might be inconvenient to do every time, and so an alternative scheme +%% has been introduced. +%% If the preamble contains a comment mylatex (ie a line just +%% containing a % white space and the word mylatex) then the mylatex +%% format will start reading the preable at that point so any new +%% commands can be placed after such a comment and they will be +%% executed. +%% -------------------------------------------------------------------- +% +% +% +%%\RequirePackage{etex}% RequirePackage may be used before the class +%\makeatletter +%% In principle \openout stream= filename need not be space terminated, +%% and need not be immediate, but this covers \makeindex \makeglossary +%% and index package's \newindex which are all the cases of \openout +%% that occur before \begin{document} that I could see. +%% Thanks to Ross Moore for pointing out \AtBeginDocument is too late +%% eg changebar package *closes* the stream in \AtBeginDocument, so need +%% to make sure it is opened before that. Make a special purpose hook. +%% +%% 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 +%% \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 +%% \document is changed or patched by some classes or packages +%% (auxhook, etoolbox etc.) +\let\MYLATEX@latex@begin\begin +\def\begin#1{% + \expandafter\ifx\csname#1\endcsname\document + \expandafter\expandafter\expandafter\endofdump\expandafter\@gobble + \else\expandafter\MYLATEX@latex@begin + \fi{#1}} +%% The version of \document to use on the initex run. +%% Just preloads some fonts, puts back \document and \openout, +%% sets up the banner to display the file list of files preloaded, +%% then sets up some special catcodes so the preamble will be +%% skipped on normal runs with the new format. +\def\endofdump{% +%% Force some font preloading. + {\setbox\z@\hbox{% + $$% math (not bold, some setups don't have \boldmath) + \normalfont% normal + {\bfseries\itshape}{\itshape}\ttfamily\sffamily + \ifdefined\large\large\fi + \ifdefined\Large\Large\fi + \ifdefined\LARGE\LARGE\fi + \ifdefined\Huge\Huge\fi + \ifdefined\small\small\fi + \ifdefined\footnotesize\footnotesize\fi + \ifdefined\tiny\tiny\fi + }}% + \let\openout\etex@primitive@openout + \let\etex@primitive@openout\@undefined + \let\begin\MYLATEX@latex@begin + \let\MYLATEX@latex@begin\@undefined + \makeatother + \everyjob\expandafter{\the\everyjob + \begingroup + \listfiles + \expandafter\MYLATEXcustomised\@dofilelist + \endgroup}% + \catcode`\\=13\relax% + \let\endofdump\relax + \dump + } +% Banner for \everyjob. +\edef\MYLATEXcustomised#1#2#3\typeout#4{% + \noexpand\typeout{==============================================================================}% + \noexpand\typeout{JOB NAME\noexpand\@spaces\noexpand\@spaces\noexpand\space\noexpand\space:% + \string"\noexpand\jobname\string"}% + \noexpand\typeout{CUSTOMISED FORMAT :\string"\jobname\string"}% + \noexpand\typeout{PRELOADED FILES:}% + #3% + \noexpand\typeout{==============================================================================}% + \noexpand\typeout{(mylatexformat)Info: starting reading document% + \string"\noexpand\jobname\string"}% +} +%% While the preamble is being skipped (inside a group) +%% the EOL is active and defined to grab each line and +%% inspect it looking for : +%% \endofdump +%% or \csname endofdump\endcsname +%% or \begin{document}. +%% +%% The special catcodes required are not enabled until after the +%% first TeX command in the file, so as to avoid problems with +%% the special processing that TeX does on the first line, choosing +%% the format, or the file name etc. +{% Entering simple groupe (level 1) => skip the preamble +\catcode`\^^M=\active% + \catcode`\/=0 % + /catcode`\\=13 % + /catcode`/& 8 % + /gdef\{/catcode`/\=0 /catcode`/^^M=13 ^^M}% /catcode`/%=9 ^^M}% +%% + /long/gdef^^M{/begingroup% + /long/def/MYLATEX@endofdump##1/endofdump##2##3&##4##5##6/MYLATEX{##5}% + /long/def/MYLATEX@endofdump@cs##1/csname endofdump/endcsname##2##3&##4##5##6/MYLATEX{##5}% + /long/def/MYLATEX@document ##1document##2##3&##4##5##6/MYLATEX{##5}% + /long/def/MYLATEX@begindocument##1/begin##2##3/MYLATEX##4{% + /MYLATEX@document ##2document&&{/MYLATEX@start1{##4}}{^^M}/MYLATEX}% + /long/def/MYLATEX@start##1##2{% + /typeout{(mylatexformat)/@spaces/space/on@line./space(% + /ifcase##1 /string/endofdump/else/string/begin{document}/fi)}% + /typeout{==============================================================================}% + /endgroup% + /catcode`/^^M=5/relax% + /let^^M/par% + /MYLATEXopens##2}% + /long/gdef^^M##1^^M{% + /MYLATEX@endofdump##1/endofdump&&% + {/MYLATEX@start0{##1}}% + {/MYLATEX@endofdump@cs##1/csname endofdump/endcsname&&% + {/MYLATEX@start0{##1}}% + {/MYLATEX@begindocument##1/begin/relax/MYLATEX{##1}}% + /MYLATEX}% + /MYLATEX}% + ^^M}% +}% Leaving simple groupe (level 1) => start reading document +%% 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% +%</package> +% \end{macrocode} +% +% \DeleteShortVerb{\+}^^A\UndefineShortVerb{\+} +% \begin{History} +% +% \begin{Version}{2010/04/30 v1.0} +% \item First version. +% \end{Version} +% +% \end{History} +% +% \PrintIndex +% +% \Finale
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.ins b/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.ins new file mode 100644 index 00000000000..f7bad01d93f --- /dev/null +++ b/Master/texmf-dist/source/latex/mylatexformat/mylatexformat.ins @@ -0,0 +1,86 @@ +%% +%% This is file `mylatexformat.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mylatexformat.dtx (with options: `install') +%% +%% 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 +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% +%% This work consists of the main source file mylatexformat.dtx +%% and the derived files +%% mylatexformat.ltx, mylatexformat.pdf, mylatexformat.ins +%% +%% mylatexformat - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +\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{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\let\MetaPrefix\relax +\preamble + +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 + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 of this license or (at your option) any later +version. The latest version of this license is in + http://www.latex-project.org/lppl.txt + +This work consists of the main source file mylatexformat.dtx +and the derived files + mylatexformat.ltx, mylatexformat.pdf, mylatexformat.ins + +mylatexformat - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file +Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> + +\endpreamble +\let\MetaPrefix\DoubleperCent + +\generate{% + \file{mylatexformat.ins}{\from{mylatexformat.dtx}{install}}% + \file{mylatexformat.ltx}{\from{mylatexformat.dtx}{package}}% +} + +%%\askforoverwritetrue +\generate{% + \file{mylatexformat.drv}{\from{mylatexformat.dtx}{driver}}% +} + +\obeyspaces +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* mylatexformat.ltx} +\Msg{*} +\Msg{* To produce the documentation run the file `mylatexformat.dtx'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +\endinput +%% +%% End of file `mylatexformat.ins'. diff --git a/Master/texmf-dist/tex/latex/mylatexformat/mylatexformat.ltx b/Master/texmf-dist/tex/latex/mylatexformat/mylatexformat.ltx new file mode 100644 index 00000000000..02454aaeec3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/mylatexformat/mylatexformat.ltx @@ -0,0 +1,284 @@ +%% +%% This is file `mylatexformat.ltx', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% mylatexformat.dtx (with options: `package') +%% +%% 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 +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3 of this license or (at your option) any later +%% version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% +%% This work consists of the main source file mylatexformat.dtx +%% and the derived files +%% mylatexformat.ltx, mylatexformat.pdf, mylatexformat.ins +%% +%% mylatexformat - Use mylatexformat.ltx to make a format based on the preamble of any LaTeX file +%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr> +%% +%%% _____________________________________________________________________ +%%% mylatexformat.ltx +%%% ^^^^^^^^^^^^^^^^^ +%%% From an original idea by David Carlisle - mylatex.ltx 1994/09/27 +%%% © lppl 2010 - F Chervet - 2010/04/25 +%%% _____________________________________________________________________ +%%% +%%% Use this file to make a format based on the preamble of any LaTeX +%%% file. +%%% +%%% The format is made from the very beginning of the file up to either: +%%% i) the command : \endofdump +%%% placed in the preamble +%%% ii) the command : \csname endofdump\endcsname +%%% placed in the preamble +%%% iii) \begin{document} +%%% if \endofdump nor \csname endofdump\endcsname +%%% haven't been found in the preamble. +%%% +%%% A format helps to speed up compilations, packages which have been +%%% dumped in the format are loaded at very high speed. +%%% -------------------------------------------------------------------- +%%% There are no restrictions on the distribution or modification of +%%% this file, except that other people should not attempt to alter +%%% the master copy on the ctan archives. +%%% +%%% Making the format -------------------------------------------------- +%%% ^^^^^^^^^^^^^^^^^ USING MikTeX +%%% * With preloaded pdflatex format (pdf output) : +%%% etex -initialize [opts] "&pdflatex" mylatexformat.ltx """abc.tex""" +%%% => compile your document using : +%%% pdflatex +%%% or texify --tex-option=-output-format=pdf +%%% +%%% * With preloaded latex format (dvi output) : +%%% etex -initialize [opts] "&latex" mylatexformat.ltx """abc.tex""" +%%% => compile your document using +%%% latex +%%% or texify --tex-option=-output-format=dvi +%%% +%%% * With preloaded format xelatex (pdf output) : +%%% xetex -initialize [opts] "&xelatex" mylatexformat.ltx """abc.tex""" +%%% => compile your document using xelatex +%%% +%%% NOTA BENE: Please, notice the 3 quotes ! +%%% ^^^^^^^^^^ +%%% +%%% In fact, 3 quotes are necessary only if you "file name.tex" contains a space ! +%%% +%%% -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +%%% Exemple of a command line for making format using pdfTeX : +%%% +%%% etex -initialize -interaction=nonstopmode +%%% -save-size=20000 -stack-size=20000 +%%% -jobname="Mon Beau Format Perso" +%%% "&pdflatex" mylatexformat.ltx "Mon Fichier TeX.tex" +%%% +%%% "Mon Beau Format Perso.fmt" (en Français dans le texte) will be created +%%% (or overwritten) in the current working directory. +%%% +%%% Using the format --------------------------------------------------- +%%% ^^^^^^^^^^^^^^^^^ USING MikTeX +%%% Add the format to the very first line of your LaTeX file : +%%% --> first line : %&"format file name" +%%% without the .fmt extension. +%%% [You may use the option : -dont-parse-first-line option +%%% to avoid loading the format] +%%% -------------------------------------------------------------------- +%% ____________________________________________________________________ +%% The following informations come from mylatex.ltx from David Carlisle: +%% Given a LaTeX file `abc.tex', use initex as follows: +%% +%% initex &latex mylatexformat.ltx abc (Generic TeX) +%% initex \&latex mylatexformat.ltx abc (unix and other TeX's) +%% tex /i &latex mylatexformat.ltx abc (emtex) +%% +%% If you are on a Mac or using some shell that makes it inconvenient +%% to use a command line such as the above examples then you may +%% make a file `mylatex.tex' with the single line +%% \input mylatex.ltx abc +%% and then pass the file mylatex.tex to your (ini)tex shell to produce +%% the format, ie something equivalent to initex &latex mylatex.tex. +%% +%% If you are using OzTeX, see the separate instructions below. +%% +%% This should make a format file mylatex.fmt which you can then use +%% as follows +%% +%% Using the new format +%% ^^^^^^^^^^^^^^^^^^^^ +%% +%% tex &mylatex abc (generic TeX) +%% virtex \&mylatex abc (Unix TeX) +%% +%% This will process your document, abc.tex, just as LaTeX does, but +%% quicker as the contents of the preamble will be stored in the +%% format file and will not need to be run each time. +%% +%% If (vir)tex fails to find your mylatex.fmt then it is not searching +%% in the current directory, either modify your TEXFORMATS path (or +%% equivalent) to search `.' or (on unix/dos) use ./ as in: +%% virtex \&./mylatex abc +%% +%% Making and using the format with OzTeX +%% ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +%% +%% Given a LaTeX file `abc.tex', do this: select `TeX...' from OzTeX's +%% TeX menu, and go to the folder containing the file `abc.tex' as if you +%% were selecting the file `abc.tex'. Then hit the Cancel button - this +%% procedure sets OzTeX's working folder to the one containing abc.tex. +%% Next, select iniTeX from the TeX menu, and type: +%% +%% &latex mylatex.ltx abc +%% +%% This should make a format file mylatex.fmt which you can save in the +%% same folder as the file you're working on. +%% +%% To use the new format, put this at the very start of the very first +%% line of your document: +%% +%% %&mylatex +%% +%% Further Notes +%% +%% The file abc.tex must contain a line *just* with +%% \begin{document} +%% Everything up to (but not including) the \begin{document} will +%% be saved in the format and not executed in subsequent runs. +%% +%% If you are modifying the document (or working on a similar document) +%% you may wish to add new commands to your document preamble. +%% The `mylatex' format normally skips the whole preamble (believing +%% it to be pre-loaded) and so such new commands do not take effect. +%% You could re-make the format, preloading the new preamble, but that +%% might be inconvenient to do every time, and so an alternative scheme +%% has been introduced. +%% If the preamble contains a comment mylatex (ie a line just +%% containing a % white space and the word mylatex) then the mylatex +%% format will start reading the preable at that point so any new +%% commands can be placed after such a comment and they will be +%% executed. +%% -------------------------------------------------------------------- +%%\RequirePackage{etex}% RequirePackage may be used before the class +%% In principle \openout stream= filename need not be space terminated, +%% and need not be immediate, but this covers \makeindex \makeglossary +%% and index package's \newindex which are all the cases of \openout +%% that occur before \begin{document} that I could see. +%% Thanks to Ross Moore for pointing out \AtBeginDocument is too late +%% eg changebar package *closes* the stream in \AtBeginDocument, so need +%% to make sure it is opened before that. Make a special purpose hook. +%% +%% 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 +%% \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 +%% \document is changed or patched by some classes or packages +%% (auxhook, etoolbox etc.) +\let\MYLATEX@latex@begin\begin +\def\begin#1{% + \expandafter\ifx\csname#1\endcsname\document + \expandafter\expandafter\expandafter\endofdump\expandafter\@gobble + \else\expandafter\MYLATEX@latex@begin + \fi{#1}} +%% The version of \document to use on the initex run. +%% Just preloads some fonts, puts back \document and \openout, +%% sets up the banner to display the file list of files preloaded, +%% then sets up some special catcodes so the preamble will be +%% skipped on normal runs with the new format. +\def\endofdump{% +%% Force some font preloading. + {\setbox\z@\hbox{% + $$% math (not bold, some setups don't have \boldmath) + \normalfont% normal + {\bfseries\itshape}{\itshape}\ttfamily\sffamily + \ifdefined\large\large\fi + \ifdefined\Large\Large\fi + \ifdefined\LARGE\LARGE\fi + \ifdefined\Huge\Huge\fi + \ifdefined\small\small\fi + \ifdefined\footnotesize\footnotesize\fi + \ifdefined\tiny\tiny\fi + }}% + \let\openout\etex@primitive@openout + \let\etex@primitive@openout\@undefined + \let\begin\MYLATEX@latex@begin + \let\MYLATEX@latex@begin\@undefined + \makeatother + \everyjob\expandafter{\the\everyjob + \begingroup + \listfiles + \expandafter\MYLATEXcustomised\@dofilelist + \endgroup}% + \catcode`\\=13\relax% + \let\endofdump\relax + \dump + } +\edef\MYLATEXcustomised#1#2#3\typeout#4{% + \noexpand\typeout{==============================================================================}% + \noexpand\typeout{JOB NAME\noexpand\@spaces\noexpand\@spaces\noexpand\space\noexpand\space:% + \string"\noexpand\jobname\string"}% + \noexpand\typeout{CUSTOMISED FORMAT :\string"\jobname\string"}% + \noexpand\typeout{PRELOADED FILES:}% + #3% + \noexpand\typeout{==============================================================================}% + \noexpand\typeout{(mylatexformat)Info: starting reading document% + \string"\noexpand\jobname\string"}% +} +%% While the preamble is being skipped (inside a group) +%% the EOL is active and defined to grab each line and +%% inspect it looking for : +%% \endofdump +%% or \csname endofdump\endcsname +%% or \begin{document}. +%% +%% The special catcodes required are not enabled until after the +%% first TeX command in the file, so as to avoid problems with +%% the special processing that TeX does on the first line, choosing +%% the format, or the file name etc. +{% Entering simple groupe (level 1) => skip the preamble +\catcode`\^^M=\active% + \catcode`\/=0 % + /catcode`\\=13 % + /catcode`/& 8 % + /gdef\{/catcode`/\=0 /catcode`/^^M=13 ^^M}% /catcode`/%=9 ^^M}% +%% + /long/gdef^^M{/begingroup% + /long/def/MYLATEX@endofdump##1/endofdump##2##3&##4##5##6/MYLATEX{##5}% + /long/def/MYLATEX@endofdump@cs##1/csname endofdump/endcsname##2##3&##4##5##6/MYLATEX{##5}% + /long/def/MYLATEX@document ##1document##2##3&##4##5##6/MYLATEX{##5}% + /long/def/MYLATEX@begindocument##1/begin##2##3/MYLATEX##4{% + /MYLATEX@document ##2document&&{/MYLATEX@start1{##4}}{^^M}/MYLATEX}% + /long/def/MYLATEX@start##1##2{% + /typeout{(mylatexformat)/@spaces/space/on@line./space(% + /ifcase##1 /string/endofdump/else/string/begin{document}/fi)}% + /typeout{==============================================================================}% + /endgroup% + /catcode`/^^M=5/relax% + /let^^M/par% + /MYLATEXopens##2}% + /long/gdef^^M##1^^M{% + /MYLATEX@endofdump##1/endofdump&&% + {/MYLATEX@start0{##1}}% + {/MYLATEX@endofdump@cs##1/csname endofdump/endcsname&&% + {/MYLATEX@start0{##1}}% + {/MYLATEX@begindocument##1/begin/relax/MYLATEX{##1}}% + /MYLATEX}% + /MYLATEX}% + ^^M}% +}% Leaving simple groupe (level 1) => start reading document +%% 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% +\endinput +%% +%% End of file `mylatexformat.ltx'. diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 38b36e1c350..858ed3b834e 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -206,6 +206,7 @@ my @TLP_working = qw( moreverb movie15 mp3d mparhack mpman-ru ms msc msg mslapa mtgreek multibib multicap multirow multibox multido multiobjective munich muthesis mwcls mxd mxedruli + mylatexformat nag namespc natbib nath nature ncclatex ncctools needspace newfile newlfm newverbs nextpage nfssext-cfr niceframe nicetext nih nkarta noitcrul diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 751497beab0..70d414b0078 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -809,7 +809,7 @@ $standardfmt='latex'; # packages which need special .tex/.sty files installed $standardtex='\.(.bx|cfg|sty|clo|ldf|cls|def|fd|cmap|4ht)$'; -%specialtex= ( +%specialtex = ( 'FAQ-en', 'NULL', 'abbr', '\.tex', 'abstyles', 'apreambl.tex', # not a4c.sty @@ -914,6 +914,7 @@ $standardtex='\.(.bx|cfg|sty|clo|ldf|cls|def|fd|cmap|4ht)$'; 'mpman-ru', 'NULL', # doc package 'msg', "-msg\.tex|" . $standardtex, 'multirow', '^..[^s].*\.sty', # not miscdoc.sty + 'mylatexformat', '.*\.ltx', 'nag', '\.nag|' . $standardtex, 'nddiss', '\.sty|\.clo|\.ldf|\.cls|\.def|\.fd$', 'notes', '[^s]\.(eps|pdf|png)|' . $standardtex, # not notes.pdf diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index 851cb77a5a2..79c1c9f3857 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -391,6 +391,7 @@ depend multibox depend multibbl depend multicap depend multirow +depend mylatexformat depend nag depend namespc depend ncclatex diff --git a/Master/tlpkg/tlpsrc/mylatexformat.tlpsrc b/Master/tlpkg/tlpsrc/mylatexformat.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/mylatexformat.tlpsrc |