2

The answer to this exercise is:

$$\vbox{\tabskip=0pt \offinterlineskip
\halign to 36em{\tabskip=0pt plus1em#&
#\hfil&#&#\hfil&#&#\hfil&#\tabskip=0pt\cr
&&&&&\strut J. H. B\"ohning, 1838&\cr
&&&&\multispan3\hrulefill\cr
&&&\strut M. J. H. B\"ohning, 1882&\vrule\cr
&&\multispan3\hrulefill\cr
&&\vrule&&\vrule&\strut M. D. Blase, 1840&\cr
&&\vrule&&\multispan3\hrulefill\cr
&\strut L. M. Bohning, 1912&\vrule\cr
\multispan3\hrulefill\cr
&&\vrule&&&\strut E. F. Ehlert, 1845&\cr
&&\vrule&&\multispan3\hrulefill\cr
&&\vrule&\strut P. A. M. Ehlert, 1884&\vrule\cr
&&\multispan3\hrulefill\cr
&&&&\vrule&\strut C. L. Wischmeyer, 1850&\cr
&&&&\multispan3\hrulefill\cr}}$$
\end

However, if we change the line

\multispan3\hrulefill\cr

into

\multispan3\hrulefill\vrule\cr

the result is different (and more correct). Why?

2
  • 3
    Visually the outcome is the same with or without your change. Why do you think that adding \vrule makes the result 'more correct' (and what does that mean)? Jan 17, 2020 at 6:56
  • 1
    I tried typesetting the \vbox inside \rlap and then typesetting the same \halign with \multispan3\hrulefill\vrule\cr replacing \multispan3\hrulefill\cr. I can see no difference whatsoever.
    – egreg
    Jan 17, 2020 at 8:49

2 Answers 2

3

Let me add some colors to show the difference between the cases without and with \vrule added. The code:

\input miniltx
\input color.sty

$$\vbox{\tabskip=0pt \offinterlineskip
\halign to 36em{\tabskip=0pt plus1em#&
#\hfil&#&#\hfil&#&#\hfil&#\tabskip=0pt\cr
&&&&&\strut J. H. B\"ohning, 1838&\cr
&&&&\multispan3{\color{blue}\hrulefill}\cr
&&&\strut M. J. H. B\"ohning, 1882&\vrule\cr
&&\multispan3{\color{blue}\hrulefill}\cr
&&\vrule&&\vrule&\strut M. D. Blase, 1840&\cr
&&\vrule&&\multispan3{\color{blue}\hrulefill}\cr
&\strut L. M. Bohning, 1912&\vrule\cr
\multispan3\hrulefill\vrule\cr
&&\vrule&&&\strut E. F. Ehlert, 1845&\cr
&&\vrule&&\multispan3{\color{blue}\hrulefill\color{red}\vrule}\cr
&&\vrule&\strut P. A. M. Ehlert, 1884&\vrule\cr
&&\multispan3{\color{blue}\hrulefill\color{red}\vrule}\cr
&&&&\vrule&\strut C. L. Wischmeyer, 1850&\cr
&&&&\multispan3{\color{blue}\hrulefill\color{red}\vrule}\cr}}$$
\end

I've added red \vrules to the lower branch, but used the original code (except for the blue color) for the upper branch. Here are the two forks magnified:

  • The upper one: enter image description here
  • The lower one: enter image description here

As you can see, the \hrulefill happily uses all three columns width and fills the gap between two black vertical lines at the first image. At the second image there's an additional \vrule (tiny red square) which doesn't do any harm but seems unnecessary.

Similar effect can be observed at the very end of the branches:

  • The upper one: enter image description here
  • The lower one: enter image description here

The total length of the rules are the same, so visually there would be no difference if the rules were rendered black. (Their length seem to differ at the image because I've cropped the pictures by hands.)

So since the results are the same, I'd prefer the shorter solution from the TeXbook.

1
  • @egreg I tried with dvips - .ps files differ slightly (I guess you tried pdftex - with it I have identical output too). What is more curious is why the \hbox for this rule has zero width, although glue set ... is present for it: \hbox(0.4+0.0)x0.0, glue set 110.77058fill. Is it typical for all \hrulefills and/or other boxes? (that glue is set but width is zero) Jan 20, 2020 at 1:36
2

Here is the difference of first and second version, obtained via dv2dt:

@@ -124 +124,2 @@
-sr 26214 7285673
+sr 26214 7259459
+sr 26214 26214

We see that 7285673 is exactly equal to 7259459+26214. So, where is the problem?

If we compare the output of dvitype, we get this:

@@ -249,3 +249,5 @@
-439: setrule height 26214, width 7285673 (4x923 pixels) 
- h:=3596434+7285673=10882107, hh:=1379 
-448: pop 
+439: setrule height 26214, width 7259459 (4x920 pixels) 
+ h:=3596434+7259459=10855893, hh:=1376 
+448: setrule height 26214, width 26214 (4x4 pixels) 
+ h:=10855893+26214=10882107, hh:=1380 
+457: pop 

So we see that although widths in DVI file are equivalent, the resulting pixel output differs by one pixel (923 vs. 920+4).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .