1

Consider example1:

hello%
world
\bye

In example2 a space is added between o and w, in comparison with example 1:

hello%
\magnification\magstep0
world
\bye

(It seems that space (which appeared from ^M), is not gobbled after a macro argument. Is it a general rule?)

In example3 a small kern is added between o and w, in comparison with example1:

hello%
\magnification\magstep0%
world
\bye

Why those unwanted spaces appear and how to remove them?

5
  • \magstep0 does not mean no space. The natural size of a font is its \magstep0 size. – R. Schumacher Sep 10 '15 at 5:24
  • @R.Schumacher: 0 is just an example. Try, e.g., \magstep1 and you will see. – Igor Liferenko Sep 10 '15 at 5:26
  • Of course, it makes no sense setting \mag in horizontal mode, does it? – egreg Sep 10 '15 at 10:31
  • @egreg: I occasionally stumbled upon it. I just thought that spaces are always gobbled after a number. – Igor Liferenko Sep 10 '15 at 11:21
  • 1
    @IgorLiferenko Not after a number: after a constant required by the syntax. As Heiko explains, at the point 0 is absorbed it is not yet a constant required by the syntax. If you say \magnification1200, then a space would be gobbled. – egreg Sep 10 '15 at 11:52
6

\magstep is a macro, which takes one argument. Thus \magstep0 or \magstep{0} uses 0 as argument. A space afterwards remains, because it is not touched by \magstep0 at all.

There is an implicit kern between ow. They are moved a little together. Example 3 breaks this implicit kerning, because it inserts unexpandable stuff (assignment of \magnification) inbetween. Therefore this should be avoided in the middle of words.

4
  • Are spaces removed at the beginning of a document? (if we begin a document with \magnification=\magstepN a space is introduced) – Igor Liferenko Sep 10 '15 at 5:38
  • @IgorLiferenko An assignment does not introduce a space. – Heiko Oberdiek Sep 10 '15 at 6:35
  • \magnification=\magstepN is the same as \magnification\magstepN, isn't it? I mean the space which I'm talking about in the question: the one which appeared from ^M. Anyway, I found the explanation: TeXbook, page 112, second paragraph. – Igor Liferenko Sep 10 '15 at 6:59
  • 2
    @IgorLiferenko Spaces in vertical mode are ignored. – wipet Sep 10 '15 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.