diff options
author | Karl Berry <karl@freefriends.org> | 2016-09-20 21:18:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-09-20 21:18:47 +0000 |
commit | 61a904cd1a5937bb93de96ec42b8fcfddeadf8fa (patch) | |
tree | e41cd7c486ed1458bff006cb0f1cc7c9e99b2aa2 /Master/texmf-dist/tex/latex/filecontentsdef | |
parent | d37cc0c40375e871a7a084f033c6075a99957853 (diff) |
filecontentsdef (20sep16)
git-svn-id: svn://tug.org/texlive/trunk@42107 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/filecontentsdef')
-rw-r--r-- | Master/texmf-dist/tex/latex/filecontentsdef/filecontentsdef.sty | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/filecontentsdef/filecontentsdef.sty b/Master/texmf-dist/tex/latex/filecontentsdef/filecontentsdef.sty new file mode 100644 index 00000000000..f921673cfb1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/filecontentsdef/filecontentsdef.sty @@ -0,0 +1,136 @@ +%% +%% This is file `filecontentsdef.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% filecontentsdef.dtx (with options: `package') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from filecontentsdef.sty. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file filecontentsdef.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{filecontentsdef} + [2016/09/19 v1.2 filecontents + macro + verbatim (JFB)] +%% +%% Package: filecontentsdef +%% Version: 1.2 (2016/09/19) +%% License: LPPL 1.3c +%% Copyright (C) 2016 Jean-Francois Burnol <jfbu at free dot fr> +%% +\begingroup +\catcode`\^^M\active% +\catcode`\^^L\active\let^^L\relax% +\catcode`\^^I\active% +\gdef\filec@ntentsdef#1#2{% + \let#2\@empty% + \openin\@inputcheck#1 % + \ifeof\@inputcheck% + \@latex@warning@no@line% + {Writing file `\@currdir#1'}% + \else% + \@latex@warning@no@line% + {Overwriting file `\@currdir#1'}% + \fi% + \closein\@inputcheck% + \chardef\reserved@c15 % + \ch@ck7\reserved@c\write% + \immediate\openout\reserved@c#1\relax% + \if@tempswa% + \immediate\write\reserved@c{% + \@percentchar\@percentchar\space% + \expandafter\@gobble\string\LaTeX2e file `#1'^^J% + \@percentchar\@percentchar\space generated by the % + `\@currenvir' \expandafter\@gobblefour\string\newenvironment^^J% + \@percentchar\@percentchar\space from source `\jobname' on % + \number\year/\two@digits\month/\two@digits\day.^^J% + \@percentchar\@percentchar}% + \fi% + \let\do\@makeother\dospecials% + \count@=128\relax% + \loop% + \ifnum\catcode\count@=\active% + \lccode`~\count@% + \lowercase{\def~{\noexpand~}}% + \else% + \catcode\count@=11 % + \fi% + \advance\count@ by \@ne% + \ifnum\count@<\@cclvi% + \repeat% + \let^^L\relax% + \edef\E{\@backslashchar end\string{\@currenvir\string}}% + \edef\reserved@b{\def\noexpand\reserved@b####1\E####2\E####3\relax}% + \reserved@b{% + \ifx\relax##3\relax% + \immediate\write\reserved@c{##1}% + \toks@\expandafter{#2}% + {\def^^L{\noexpand^^M\noexpand^^M}\lowercase{\let^^I~}% + \xdef#2{\the\toks@##1\noexpand^^M}}% + \else% + \edef^^M{\noexpand\end{\@currenvir}}% + \ifx\relax##1\relax% + \else% + \@latex@warning{Writing text `##1' before % + \string\end{\@currenvir}\MessageBreak as last line of #1}% + \immediate\write\reserved@c{##1}% + \toks@\expandafter{#2}% + {\def^^L{\noexpand^^M\noexpand^^M}\lowercase{\let^^I~}% + \xdef#2{\the\toks@##1\noexpand^^M}}% + \fi% + \ifx\relax##2\relax% + \else% + \@latex@warning{% + Ignoring text `##2' after \string\end{\@currenvir}}% + \fi% + \fi% + ^^M}% + \catcode`\^^L\active% + \let\L\@undefined% + \def^^L{\@ifundefined L^^J^^J^^J}% + \catcode`\^^I\active% + \let\I\@undefined% + \def^^I{\@ifundefined I\space\space}% + \catcode`\^^M\active% + \edef^^M##1^^M{\noexpand\reserved@b##1\E\E\relax}% + \catcode32\active\lccode`~32 \lowercase{\def~{\noexpand~}}% +}% +\endgroup +\begingroup +\catcode`\*=11 +\gdef\filecontentsdef {\@tempswatrue\filec@ntentsdef}% +\gdef\filecontentsdef*{\@tempswafalse\filec@ntentsdef}% +\global\let\endfilecontentsdef \endfilecontents +\global\let\endfilecontentsdef*\endfilecontents +\gdef\filecontentshere #1{\@tempswatrue + \filec@ntentsdef{#1}\filecontentsheremacro}% +\gdef\filecontentshere*#1{\@tempswafalse + \filec@ntentsdef{#1}\filecontentsheremacro}% +\gdef\endfilecontentshere{\endfilecontentsdef\aftergroup\filecontents@verbatim}% +\global\let\endfilecontentshere*\endfilecontentshere +\catcode`\^^M\active% +\gdef\filecontentsprint #1{\let\filecontentsprint@EOL^^M\let^^M\relax% + \begingroup\toks@\expandafter{#1}\edef\x{\endgroup% + \noexpand\begin{verbatim}^^M% + \the\toks@\@backslashchar end\string{verbatim\string}}\x^^M% + \filecontentsprint@resetEOL}% +\gdef\filecontentsprint@resetEOL{\let^^M\filecontentsprint@EOL}% +\endgroup +\def\filecontents@verbatim {\filecontentsprint\filecontentsheremacro}% +\def\filecontentsexec #1{\newlinechar13 + \scantokens\expandafter{#1}\newlinechar10\relax}% +\endinput +%% +%% End of file `filecontentsdef.sty'. |