Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!ucbvax!TAMVM1.BITNET!X066TR From: X066TR@TAMVM1.BITNET ("Thomas J. Reid") Newsgroups: comp.text.tex Subject: Re: \the \baselineskip Message-ID: <97DCDB12A000E084@post-office.uh.edu> Date: 17 Feb 91 09:36:03 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: Texas A&M University Computing Services Center Lines: 38 On Sun, 17 Feb 91 03:05:17 EST xiaofei@acsu.buffalo.edu said: >If I say >`` >\the\baselineskip >\baselineskip=2.0\baselineskip >\the\baselineskip >'' > >I expect the first \the\baselineskip gives me a ``12.0pt'' and the >second one goves me a ``24.0pt''. But it is not the case, they both >give me ``12.0pt'' which I find it difficult to understand. The point which you are not understanding is the difference between TeX's parsing tokens, and executing commands. TeX processes the sequence by first expanding "\the\baselineskip" into its current value of "12.0pt". It then begins parsing the tokens "\baselineskip", "=", "2", ".", "0", "\baselineskip". At this point, TeX does not yet realize that it has a complete command which it can execute, so it continues parsing. It then finds "\the" which causes it to immediately expand the "\baselineskip" which follows it. This generates a new set of tokens: "1", "2", ".", "0", "p", and "t" which TeX stacks. Finally, TeX executes the assignment command and changes the value of \baselineskip to 24pt. Thus, it is the look-ahead action of the token parser which is causing your problem. To work around this problem, it is merely necessary to insert a token between the assignment and the second expansion of \the\baselineskip to cause TeX to actually make the assignment. Your test of inserting \par at this point would do the trick; however, if you didn't want a paragraph break there, it would have a bad side-effect. The best thing to do is to insert \relax after the assignment. The processing of dimensional arguments is one of the more confused aspects of TeX but is better understood when one realizes the two phases of parsing tokens and actually processing the commands. Regards, Tom Reid