summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/autotab
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex209/contrib/autotab
Initial commit
Diffstat (limited to 'macros/latex209/contrib/autotab')
-rw-r--r--macros/latex209/contrib/autotab/autotab.sty45
-rw-r--r--macros/latex209/contrib/autotab/autotab.tex113
2 files changed, 158 insertions, 0 deletions
diff --git a/macros/latex209/contrib/autotab/autotab.sty b/macros/latex209/contrib/autotab/autotab.sty
new file mode 100644
index 0000000000..840acfc734
--- /dev/null
+++ b/macros/latex209/contrib/autotab/autotab.sty
@@ -0,0 +1,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=\\}
diff --git a/macros/latex209/contrib/autotab/autotab.tex b/macros/latex209/contrib/autotab/autotab.tex
new file mode 100644
index 0000000000..92c94bff57
--- /dev/null
+++ b/macros/latex209/contrib/autotab/autotab.tex
@@ -0,0 +1,113 @@
+%format latex
+%documentstyle[german,11pt,supertab,autotab]{darticle}
+\documentstyle[german,11pt,supertab,autotab]{artdaf} %02.02.91
+
+\textheight 24cm
+\textwidth 17cm
+\topmargin -2cm
+\oddsidemargin -1cm
+\parskip 6pt
+
+\begin{document}
+\begin{center}
+\Large\bf Generating tabulars using the \\
+ {\tt autotab} Style \\[.5cm]
+\normalsize Gabriele Kruljac \\
+ 5. Oktober 1989
+\end{center}
+This is the description of the {\tt autotab} style. It offers some
+new commands to generate tabulars nearly automatically.
+
+The style itself is called as \verb|\documenstyle| option
+\verb|\documentstyle[...,autotab,...]{darticle}|. The tabular
+creating commands are called inside a {\tt tabular} or
+{\tt supertabular} environment. Syntax:
+\begin{center}
+\begin{tabular}{l p{10cm}}
+\verb|\readtabline{...}| & reads from data file and generates
+ the tabular entries; argument is
+ the number of columns = number of records
+ which bild one tabular line \\
+\verb|\autotabline| & is the built tabular entry, inserts it's
+ into the tabular at the specified point
+\end{tabular}
+\end{center}
+
+Every time \verb|\readtabline| is called it asks for the name of
+the input data file and starts reading. The style reads as much records
+as specified by the argument of the \verb|\readtabline| command,
+puts them into \verb|\autotabline| connected with ampersands (\verb|&|)
+and adds \verb|\\| to the last of these records.
+This algorithm is repeated until end-of-file is found.
+
+Using {\tt autotab} in conjunction with the {\tt supertabular}
+environment offers the possibility to generate tabulars without regard
+to necessary pagebreaks, because they will be inserted automatically
+by {\tt supertabular} (see separate description).
+
+\subsection*{Example}
+The data is stored in file {\tt sonderdr.dat}. \verb|\readtabline|
+results in an online dialog question:
+\begin{center}
+\begin{tabular}{l}
+\tt Please type the name of the tabular input data file:\\
+\verb|\inputfile=|
+\end{tabular}
+\end{center}
+The user types:\hfill{\tt sonderdr.dat}.\hspace*{\fill}
+
+\noindent The data look like:
+\begin{verbatim}
+ 265/89
+ Study of Plasma Potential Effects in a 40 MHz ...
+ Spectrochim. Acta
+ 1989
+ 44B
+ 219-228
+ ww
+ 264/89
+ Atomic Emission and Atomic Absorption Spectrometric ...
+ .
+ .
+ .
+ .
+ .
+ 263/89
+ Comparative Surface and Bulk Analysis of Oxygen in Si3N4 ...
+ Fresenius Z.Anal.Chem.
+ 1989
+ 333
+ 502-506
+ WW
+ 262/89
+\end{verbatim}
+Seven records build one tabular line. There must be a blank record for each empty entry (marked by . in the above example).
+
+\noindent Here is the definition of the tabular:
+\begin{verbatim}
+ \small\renewcommand{\arraystretch}{.8}
+ \tablehead{\hline Publ-Nr. & \multicolumn{1}{c|}{Titel}
+ & ersch. & Jahr & Bd. & Seite & Institut \\
+ \hline}
+ \tabletail{\hline}
+ \begin{center}
+ \begin{supertabular}{|l|p{5cm}|p{3cm}|l|l|l|l|}
+ \noalign{\readtabline{7}}
+ \autotabline
+ \end{supertabular}
+ \end{center}
+\end{verbatim}
+
+\noindent And here is the result:
+\small\renewcommand{\arraystretch}{.8}
+\tablehead{\hline
+ Publ-Nr. & \multicolumn{1}{c|}{Titel}
+ & ersch. & Jahr & Bd. & Seite & Institut \\ \hline}
+\tabletail{\hline}
+\begin{center}
+\begin{supertabular}{|l|p{5cm}|p{3cm}|l|l|l|l|}
+\noalign{\readtabline{7}}
+\autotabline
+\end{supertabular}
+\end{center}
+\end{document}