I have recently falled into an error because I didn't use % when I was supposed to. My question is now: When do I have to use % at the end of the line and when should I leave it out?
Asked
Active
Viewed 215 times
1 Answers
8
An end of line is a space so your question is asking when to add a space.
foo
bar
is the same as
foo bar
but
foo%
bar
is the same as
foobar
so it just depends on the context. Sometimes a space is needed to separate words, or for TeX syntactic reasons, sometimes a space is not needed but ignored anyway, and sometimes a space is definitely wrong at that point.
David Carlisle
- 757,742
-
...except for things like
verbatim, where an EOL is not a space. – Steven B. Segletes Oct 13 '15 at 23:29 -
I also think it worth to explicitly mention that spaces (and thus
%) are ignored after\iffamily of conditionals, as well as after\elseand\fi...since they are used pervasively in macros. – Steven B. Segletes Oct 13 '15 at 23:32 -
-
Did I say that? Must have been my alter-ego. Need to adjust the meds. – Steven B. Segletes Oct 14 '15 at 10:00