Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!tut.cis.ohio-state.edu!ucbvax!TRIPLES.MATH.MCGILL.CA!barr From: barr@TRIPLES.MATH.MCGILL.CA (Michael Barr) Newsgroups: comp.text.tex Subject: \the \baselineskip Message-ID: <9102172148.AA04807@triples.math.mcgill.ca> Date: 17 Feb 91 21:48:31 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 57 Indeed if you run the code: \the\baselineskip \baselineskip=2.0\baselineskip \the\baselineskip \bye through tex, the output is 12.0pt12.0pt If you run the code \the\baselineskip \baselineskip=2.0\baselineskip{} \the\baselineskip \bye through tex, the output is 12.0pt 24.0pt If you run \the\baselineskip \baselineskip=2.0\baselineskip\relax \the\baselineskip \bye the output 12.0pt24.0pt What is going on here is one of the most pernicious gotcha's in tex. The fact is that when tex reads a numerical quantity (and dimensions are also stored as numbers, in terms of sp's), tex has to read far enough to ascertain that the number has actually finished. If it discovers that the number actually finished a while back, it does not go back and reread what has already been read. In the first case, it read the \baselineskip=2.0\baselineskip and then continued past the carriage return (which was swallowed by the control sequence) to read the second \the, which apparently caused it to read the \baselineskip and then executed the code that it had absorbed. At that point, the value of \baselineskip was indeed 24.0pt, but what printed was the value when it was read. For some reason, it doesn't do this if instead of \the you execute \showthe\baselineskip. I don't understand why the two behave differently; I can only assume one takes place in the stomach and the other in the esophagous, or something like that. TeX's digestive tract is something of a black hole, at least to me. The remaining two contain a pair of braces or a \relax, both of which signal TeX that the dimension it is examining has ended and so it doesn't continue to read on. LaTeX has \relax inserted at various dates in strategic places, almost surely to forestall unexpected occurrences like this when a macro appears in a place not anticipated at the time it was originally coded. If you insert the pair of braces, the carriage return isn't swallowed and you get a space in there; with relax, you don't get the space. Michael Barr