summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/autotab/autotab.sty
blob: 840acfc7346d732c952e06bdbe9649ff61172f17 (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
34
35
36
37
38
39
40
41
42
43
44
45
% This is autotab.sty as of 5. October 1989
% written by Gabriele Kruljac
%            Max-Planck-Institute Stuttgart
%            kruljac@ds0mpi11
% this style generates tabular lines from data files
% see autotab.tex for a description
%
% notice that the input data has to be written in valid TeX syntax
% (i.e. \_, \% and so on)
%
% The name of the input data file will be read from the terminal
% everytime the command \readtabline{...} is used
 
\typeout{Document substyle `autotab' by MPI FKF, Version 1.0 as of 5. October 1989}
 
\newif\ifnoteof
\newcount\reccount
\def\testeof{\ifeof10\global\noteoffalse\else\global\noteoftrue\fi}
 
\long\def\readtabline#1{%
\global\def\autotabline{}
\let\septabline={\noexpand\septabline}
\let\septabcol={\noexpand\septabcol}
\let\savenu=\"
\let\"=u
\noteoftrue
\message{Please type the name of the tabular input data file:}
\read16 to\inputfile
\openin10=\inputfile
\loop
     \read10 to\inrec
     \testeof
\ifnoteof
     \advance\reccount by 1
     \ifnum\reccount=#1
           \global\edef\autotabline{\autotabline\inrec\septabline}
           \reccount=0
     \else
           \global\edef\autotabline{\autotabline\inrec\septabcol}
     \fi
\repeat
\closein10
\let\"=\savenu
\global\let\septabcol=&
\global\let\septabline=\\}