summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/latex-tipps-und-tricks/m2verb.sty
blob: 366302c2d552db2dfb76efe7b4fae8e6aaa96091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
% M2VERB.STY
\RequirePackage{verbatim}

%  Oeffnet/schliesst das Ausgabefile
\newcommand*{\openfile}[2]
 {\expandafter\newwrite\csname verb@#2\endcsname
  \immediate\openout\csname verb@#2\endcsname #1}
\newcommand*{\closefile}[1]
  {\immediate\closeout\csname verb@#1\endcsname}

% Addiert den Inhalt dieser Umgebung zum File dazu
\newenvironment{writefile}[1]
 {\@bsphack
  \let\do\@makeother\dospecials
  \catcode`\^^M\active \catcode`\^^I=12
  \def\verbatim@processline{%
    \immediate\write\csname verb@#1\endcsname
      {\the\verbatim@line}}%
  \verbatim@start}
 {\@esphack}