[texhax] Adapting Malcolm Clark's methods to example in Seroul and Levy

Suresh Govindachar sgovindachar at yahoo.com
Tue Feb 17 04:17:55 CET 2015


% plain TeX with pdftex
%
% Goal:  to create a table which contains not only horizontally
%        combined cells but also vertically combined cells
%
% Used the library and looked at about 10 books on plain TeX -- only
% one, Malcolm Clark's ``A Plain TeX Primer'' addresses creation of
% such tables (refer Figures 15.3 and 16.3 of this book).
%
% Below is my attempt at modifying the table from Section 9.10 of
% Seroul and Levy's ``A Beginner's Book of TeX'' by using Clark's
% ideas to add both horizontally and vertically combined cells;  but
% this attempt fails with the issues of (a) vertical centering,
% (b) excess vertical space,  and (c) vertical "barbs".
%
% The \def\foovrule and \def\foohrulefill in the code are my
% attempts to resolve the issues by controlling the height and
% depth (of vrule and hrulefill) -- but these attempts failed.
%

$$\vbox{\offinterlineskip
      \def\foovrule{\vrule}
     %\def\foovrule{\vrule height 0pt depth 0pt}
     %\def\foovrule{}

      \def\foohrulefill{\hrulefill}
     %\def\foohrulefill{\leaders\hrule height 0pt depth 0pt \hfill}

      \def\mr{\omit&height 2pt&&&&&&\cr}
      \def\vspan#1#2{\parindent0pt\setbox0
          \vbox to#1\normalbaselineskip
                {\null\vfill#2\vfill\null}%
                \ht0\ht\strutbox
                \dp0\dp\strutbox
                \setbox1\hbox{#2}\wd0\wd1\box0}
      \halign{\strut#&\vrule#\quad&
              \hfil$#$\hfil&
              \quad\vrule#\quad&
              \it#\hfil&\quad\vrule#\quad&
              \hfil#&\quad\vrule#\cr
              \noalign{\hrule} \mr
              &&\omit\bf name&&
                     \bf type&&
                     \bf value&\cr
              \mr \noalign{\hrule} \mr
              &&x&& integer&&   1987&     \cr
              \mr \noalign{\hrule} \mr
              &&y&& real&&      3.14159&  \cr
              \mr \noalign{\hrule} \mr
              &&\vspan2{entry needs lowering}&& excess space below&& 
excess space below& \cr
              &&&\omit\quad\foovrule\foohrulefill&
 
\omit\foohrulefill&\omit\foohrulefill\foovrule\foohrulefill&
                 \omit\foohrulefill&
                 \omit\foohrulefill\foovrule  \cr
              &&&& \multispan3  small vertical barbs from column 
divider& \cr
              \mr \noalign{\hrule} \mr
              &&z&& boolean&&   false&    \cr
              \mr \noalign{\hrule}
      }}$$

\bye

% Would appreciate insights into what's going on.
%
% Thanks,
%
% --Suresh
%



-------------- next part --------------
A non-text attachment was scrubbed...
Name: vertical_issues_on_attempt_to_adapt_Clark_to_Seroul_and_Levy.png
Type: image/png
Size: 29082 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20150216/385995d7/attachment-0001.png>


More information about the texhax mailing list