[comp.sys.atari.st] Question about PD TeX Previewer

franco@iuvax.cs.indiana.edu (09/03/87)

I tried the public domain "dvist" on the tex file below but the output was
not what I expected.  The tex file is a figure that contains diagonal lines.
Unfortunately the diagonal lines come out as horizontal lines using "dvist".
The output is ok coming off the imagen printer, though.  Any ideas on what
might be wrong and whether or not the problem is easily fixable would be
appreciated.  Thanks in advance.

\input design.tex
\input lines.tex
\def\chaphead{2}
\booksize

\def\lswarrow{\vswarrow{.40}}
\def\vswarrow#1{\hbox to 0pt{$\swarrow$\kern-.028in\raise.08in
\hbox{\slant{#1in}{#1in}{.01in}}\hss}}
\def\lsearrow{\vsearrow{.40}}
\def\vsearrow#1{\hbox to 0pt{\hss\raise.08in
\hbox{\slant{#1in}{-#1in}{.01in}}\kern-.008in$\searrow$}}


\centerline{\vbox{\nointerlineskip\mathsurround=0pt
\hbox{\hskip1.285in{\twelvepoint$a$}}
\hbox{\hskip.645in{\twelvepoint$x_1$}\hskip-.07in\raise.1in\lswarrow
\hskip-.1in\hbox{$\vcenter{\hbox to1.24in{\hss Local\hss}\vskip2pt
\hbox to1.24in{\hss Confluence\hss}}$}
\raise.1in\lsearrow{\twelvepoint$y_1$}}\vskip-.17in
\vbox to0pt{\vskip.2in
\hbox{\hskip.285in$*$\hskip.65in$*$\hskip.475in$*$\hskip.66in$*$}\vss}
\hbox{{\twelvepoint$x$}\raise.1in\lswarrow
\hskip-.1in\hbox to 1.27in{\hss Induction\hss}\raise.1in\vsearrow{.37}%
 {\twelvepoint$u$}\raise.1in\lswarrow\hskip1.19in\raise.1in\vsearrow{.37}%
 {\twelvepoint$y$}}
\vskip-.17in
\vbox to0pt{\vskip.2in
\hbox{\hskip.385in$*$\hskip.465in$*$}\vss}
\hbox{\hskip.64in\raise.1in\lsearrow{\twelvepoint$v$}\raise.1in
\lswarrow\hskip.1in\raise.2in\hbox to 1.27in{\hss Induction\hss}}
\vskip-.17in
\vbox to0pt{\vskip.2in
\hbox{\hskip1.02in$*$\hskip.46in$*$}\vss}
\hbox{\hskip1.27in\raise.1in\lsearrow{\twelvepoint$z$}\raise.1in
\vbox to0in{\vss\vswarrow{1.03}}}}}
\vskip.2in
\vbox{\ninepoint\fig1. Since the relation is Noetherian and the relation is
locally confluent, the elements $x$ and $y$, which have a common ancestor
must have a common descendant.}
\bye


----Here is lines.tex

%slanting lines
\newdimen\pxl
\dimen\pxl=.0033333in
% slant draws a line from the current position (x,y) to (x+#2,y+#1).
% #1 and #2 can have any sign.
% The line has vertical thickness #3, thickness goes from x to x+#3.
% #3 should be positive if you want to see the line.
% The line is in a box of no width, but with full height and depth; i.e,
%  if #1>0  then height is #1+#3, depth is 0, otherwise
%  if #1<=0 then height is #3 and depth is -#1.
% The line ends are vertical.
\def\slant#1#2#3{{%Draw a sloping line.
%Not recommended for lines near veritical
\dimen8=#1\dimen2=#2\dimen4=#3%
\dimen0=\dimen\pxl% the resolution of the printer.
\ifnum\dimen8<0 \dimen0=-\dimen0 \fi
\count255=\dimen8 \divide\count255 by\dimen0 %the number of segments.
 \ifnum\dimen2<0
   % to avoid going left, we start at (x+#2,y_#1) which is left of (x,y).
   \dimen2=-\dimen2 \dimen0=-\dimen0
   \dimen6=\dimen2
   \ifnum\count255>0\divide\dimen6 by\count255 \else \dimen6=0pt\fi
   %the horizontal increment, vertical increment is \dimen0
   \advance\dimen4 by\dimen8
   %\dimen8 is the bottom of the line, \dimen4 is now the top
   \hbox to0pt{\hss\drawline}%
 \else
   % we start at (x,y) and go right.
   \dimen6=\dimen2
   \ifnum\count255>0\divide\dimen6 by\count255 \else \dimen6=0pt\fi
   %the horizontal increment, vertical increment is \dimen0
   \dimen8=0pt%the bottom of the line, \dimen4 is now the top
   \hbox to0pt{\drawline\hss}%
 \fi}}
% \count255 has the number of segments.
% \dimen6 has the width of a segment.
% \dimen4 has the height to the top of the segment.
% \dimen8 has the heigth to the bottom of the segment.
% \dimen0 has the vertical increment between segments.
% \dimen2 has the width of the entire line.
\def\drawline{\loop \vrule width\dimen6 height\dimen4 depth-\dimen8
 \advance\count255 by-1\ifnum\count255>0\advance\dimen8 by\dimen0
 \advance\dimen4 by\dimen0 \advance\dimen2 by-\dimen6 \repeat
 \vrule width\dimen2 height\dimen4 depth-\dimen8 %one last segment
 }

A figure much like the one drawn by the above files can be found in
Purdom, P. W., "The Analysis of Algorithms," Holt, Rinehart and Winston,
New York (1985), page 57.

please email to franco@iuvax.cs.indiana.edu or pwp@iuvax....