diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/dialogl/grabhedr.stp')
-rw-r--r-- | Master/texmf-dist/source/latex/dialogl/grabhedr.stp | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/dialogl/grabhedr.stp b/Master/texmf-dist/source/latex/dialogl/grabhedr.stp new file mode 100644 index 00000000000..868ba5da462 --- /dev/null +++ b/Master/texmf-dist/source/latex/dialogl/grabhedr.stp @@ -0,0 +1,144 @@ +%%% ==================================================================== +%%% @LaTeX-style-file{ +%%% filename = "grabhedr.sty", +%%% version = "0.9j", +%%% date = "1994/11/08", +%%% time = "16:15:00 EST", +%%% author = "Michael Downes", +%%% email = "mjd@math.ams.org (Internet)", +%%% keywords = "TeX, file header, +%%% supported = "yes", +%%% abstract = "This file defines a function \inputfwh +%%% to be used instead of \input, to allow TeX to grab +%%% information from standardized file headers in the form +%%% proposed by Nelson Beebe during his term as president of the +%%% TeX Users Group. Of which all this here is an example.", +%%% checksum = "60397 519 2589 19482", +%%% docstring = "The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the equivalent of +%%% the standard UNIX wc (word count) utility output of lines, +%%% words, and characters. This is produced by Robert Solovay's +%%% checksum utility.", +%%% } +%%% ==================================================================== +\begingroup +\catcode96 12 % left quote +\catcode`\= 12 +\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 +\catcode`\$=3 \catcode`\~=13 \catcode`\^=7 +\catcode`\_=8 \catcode`\^^M=5 \catcode`\"=12 +\catcode`\@=11 +\gdef\@empty{} +\long\gdef\@gobble#1{} +\long\gdef\@gobbletwo#1#2{} +\long\gdef\@gobblethree#1#2#3{} +\long\gdef\@car#1#2\@nil{#1} +\ifx\UndEFiNed\@@input % LaTeX not loaded. + \edef\0{\meaning\input}\edef\1{\string\input}% + \ifx\0\1% + \global\let\@@input\input + \else + \errhelp{% +Grabhedr.sty needs to know the name of the +\input primitive in order to define \inputfwh +properly. Consult a TeXnician for help.} + \errmessage{% + Non-primitive \noexpand\input detected}% + \fi +\fi +\global\toksdef\toks@=0 +\long\gdef\afterfi#1\fi{\fi#1} +\global\let\nx@\noexpand +\global\let\xp@\expandafter +\begingroup \lccode`\.=`\%% +\lowercase{\gdef\@percentchar{.}}% +\endgroup +\gdef\fileversiondate#1#2#3{% + \xp@\xdef\csname#1\endcsname{#2 (#3)}% + \def\filename{#1}\def\fileversion{#2}% + \def\filedate{#3}% + \message{#1 \csname#1\endcsname}% +} +\fileversiondate{grabhedr.sty}{0.9j}{1994/11/08} +\xdef\@filehdrstart{% + \@percentchar\@percentchar\@percentchar\space + ==================================% + ==================================} +\gdef\@scanfileheader#1@#2#{\@xscanfileheader} +\long\gdef\@xscanfileheader#1{% + \@yscanfileheader#1{} version = "??", + date = "??",\@yscanfileheader} +\long\gdef\@yscanfileheader + #1 filename = "#2",#3 version = "#4",% + #5 date = "#6",#7\@yscanfileheader{% + \endgroup + \csname fileversiondate\endcsname{#2}{#4}{#6}% +} +\begingroup +\lccode`\$=`\^^M +\lowercase{\gdef\@readfirstheaderline#1$}{% + \toks@{#1}% + \edef\@tempa{\@percentchar\the\toks@}% + \ifx\@tempa\@filehdrstart + \endgroup \begingroup + \catcode`\%=9 \catcode`\^^M=5 \catcode`\@=11 + \catcode`\ =10 \catcode`\==12 \catcode`\"=12 + \xp@\@scanfileheader + \else + \message{(* Missing file header? *)}% + \afterfi\endgroup + \fi} +\endgroup +\gdef\@xinputfwh{% + \ifx\next\@readfirstheaderline + \catcode`\%=12 \catcode`\{=12 \catcode`\}=12 + \catcode`\\=12 \catcode`\^^L=12 + \catcode`\^=12 + \catcode`\^^M=3\relax + \else \endgroup\fi +} +\gdef\@inputfwh{\futurelet\next\@xinputfwh} +\gdef\inputfwh#1{% + \begingroup\catcode`\%=\active + \endlinechar`\^^M\relax + \lccode`\~=`\%\relax + \lowercase{\let~}\@readfirstheaderline + \xp@\@inputfwh\@@input #1\relax +} +\gdef\localcatcodes#1{% + \ifx\@empty\@catcodestack + \gdef\@catcodestack{{}}% + \fi + \def\do##1##2{% + \ifnum##2>\z@ + \catcode\number`##1 \space + \number\catcode`##1\relax + \expandafter\do\fi}% + \xdef\@catcodestack{{\do#1\relax\m@ne}% + \@catcodestack}% + \def\do##1##2{\catcode`##1 ##2\relax\do}% + \do#1\ {\catcode32\let\do}% +} +\gdef\@catcodestack{{}} +\gdef\restorecatcodes{% + \begingroup + \ifx\@empty\@catcodestack + \errmessage{Can't pop catcodes; + \nx@\@catcodestack = empty}% + \endgroup + \else + \def\do##1##2\do{% + \gdef\@catcodestack{##2}% + \endgroup##1}% + \xp@\do\@catcodestack\do + \fi +} +\expandafter\gdef\csname trap.input\endcsname + \input#1 \relax{% + \expandafter\ifx\csname#1\endcsname\relax + \afterfi\inputfwh{#1}\relax + \fi} +\endgroup +\endinput +%% +%% End of file `grabhedr.sty'. |