summaryrefslogtreecommitdiff
path: root/info/maketexwork/ex-06-09
blob: 0852abdb0c93f16af814856f09b82c93292bee9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
% use any IBM OEM encoded fixed width font!
\font\screenfont=ncrr-ibm at 7pt 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% These macros are derived from The TeXbook pg 380-381
\def\uncatcodespecials{\def\do##1{\catcode`##1=12 }\dospecials}
\def\setupverbatim{\screenfont%
  \def\par{\leavevmode\endgraf\relax}%
  \obeylines\uncatcodespecials%
  \catcode`\\=0\catcode`\{=1\catcode`\}=2\obeyspaces}
{\obeyspaces\global\let =\ } % let active space be a control space
\def\screenlisting#1{\par\begingroup%
  \def\c##1{\char##1}\setupverbatim\input{#1}%
  \endgroup}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\screenbox#1{%
  \vbox{\offinterlineskip%
    \parskip=0pt\parindent=0pt%
    \screenlisting{#1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Input converted file '#1' and set it inside a box with '#2' padding
% space around the image.
\def\screendump#1#2{%
  \hbox{\vrule%
    \vbox{\hrule%
      \hbox{\hskip#2%
        \vbox{\vskip#2%
          \def\twentyxs{xxxxxxxxxxxxxxxxxxxx}%
    \setbox0=\hbox{\screenfont\twentyxs\twentyxs\twentyxs\twentyxs}%
          \hbox to \wd0{\screenbox{#1}\hss}%
        \vskip#2}%
      \hskip#2}%
    \hrule}%
  \vrule\hss}}