4

Taking an idea from this question, what if I want to make a vertical dashed line in PlainTex or (preferably) Optex? I know I can use \dotfill in the text (horizontally), but how can I use it vertically in the text or in a table? One solution for running text would be to do the following (modifying Udi Fogiel's suggestion from here)

\def\dotvfill{\par\leaders\hbox{$\cdot$}\vfill}

\vbox to 3cm{\dotvfill}

\bye

But what about tables? For example, if I want to change the vertical rules in this table to vertical dots?

\table{|ll|}{ \crl
   data & data \crl
   data & data \crl
   data & data \crl
   data & data \crl
   data & data \crl
}
user574859
  • 867
  • 3
  • 11

1 Answers1

5

If the height of all lines in the table are equal, you can set \vodotfil for the vertical lines by a \vbox with given height. For example

\newdimen\bskip  \bskip=\baselineskip
\def\vdotfil{\lower.4\bskip\vbox to1.2\bskip{\leaders\vbox{\kern.5pt\hbox{.}\kern.5pt}\vfil}}

\table{(\vdotfil)ll(\vdotfil)}{ \crl data & data \crl data & data \crl data & data \crl data & data \crl data & data \crl }

\bye

But if the height of table lines aren't equal then the solution will be more complicated, because the expandable \vrule inside the \hbox cannot be simply replaced by \ledares.

wipet
  • 74,238
  • It's great, but if I don't use horizontal lines (that is, if I only use \cr instead of \crl), the first and last dots in each line overlap. – user574859 Sep 16 '23 at 22:28
  • @user574859 replace the height of the vbox in the definition of \vdotfill to 1.1\bskip, i.e. \def\vdotfil{\lower.4\bskip\vbox to1.1\bskip{\leaders\vbox{\kern.5pt\hbox{.}\kern.5pt}\vfil}} – Udi Fogiel Sep 17 '23 at 00:10
  • @UdiFogiel, thank you. Almost there. Although there is a weird vertical skip that I cannot remove even with \thistable{\tablinespace=0pt}. Depending on how I change X\bskip, there are weird clusters of balls. In this particular instance, I resolved it with \vbox to 1.4\bskip. – user574859 Sep 17 '23 at 00:19