5
votes
3answers
101 views

Adding a hrule between hboxes decreases their vertical distance

Using pdftex. Given two sample programs test0.tex \vbox{ \hbox{X} \hbox{Y} } \bye test1.tex \vbox{ \hbox{X} \hrule \hbox{Y} } \bye gives the following outputs. test0.png test1.png So, ...
16
votes
1answer
270 views

Semantics of negative glues

This question is about the semantics of glues like 0pt plus -1fill, where the coefficient in front of the fill is negative. The following minimal example shows my attempt to figure this out ...
26
votes
3answers
1k views

Mathematical description of TeX's infinite numbers?

TeX has things like infinitely stretchable spaces and infinitely bad penalties. Since Knuth is Knuth, I assume these are a carefully thought-out implementation of some well defined non-Archimedean ...
17
votes
4answers
684 views

Which commands consisting of a non-letter eat spaces afterwards?

Command names consist of a sequence of letters (until and excluding the first non-letter) or of a single non-letter. Command names ending in a letter (including of course those consisting of a single ...
12
votes
1answer
72 views

Tight connection of \vbox es

I don't understand why TeX put a thin whitespace between my two vertical boxes: \documentclass{article} \begin{document} \vbox to 1cm {\rule{1cm}{1cm}} \vbox to 1cm {\rule{1cm}{1cm}} ...
10
votes
3answers
387 views

Why is tex designed to render spaces around brackets?

When I wrote following lines: \section{Introduction}{ Content in introduction ... } Unwanted space comes before Content as warned. I understand it's due to some technical decision in tex. But I ...
11
votes
4answers
108 views

A question about macro matching

Consider the following macro definition, and subsequent invocation: \def\foo #1 #2 \bar{stuff with #1 and #2 goes here} \foo arg1 arg2 \bar The \bar simply acts as the terminator for \foo. This all ...
18
votes
1answer
300 views

Drawbacks of redefining math accents with extra leading {}?

As I discovered through the non-bug latex/4253, TeX has a (mis)feature whereby it ignores braces around a \mathaccent construction: ${a_b}_c$ works, but ${\tilde a_b}_c$ fails with a "Double ...
7
votes
1answer
589 views

TeX ignores \vskip at the beginning of document

Here is a simple Plain TeX snippet for demonstration \vskip 3in Aaaaa \vskip 3in Bbbbb \end When I compile this with pdftex, I expect to see a 3-inch-high blank space, then Aaaaa, followed by ...
15
votes
3answers
1k views

Difference between \mskip and \mkern

What are the differences between \mskip and \mkern? The TeXbook writes the following (ch. 18): You can insert math glue into any formula just by giving the command ‘\mskip⟨muglue⟩’. [...] ...
16
votes
2answers
1k views

When is it good practice to use \unskip

One sees in source2e the command \unskip used in various places. My understanding in general terms is that the macro is the equivalent of \ignorespacesbehind. Where would it be recommended to use ...
4
votes
3answers
231 views

How are space tokens and empty lines processed by long commands (as their potential arguments)?

How are spaces and empty lines processed by long commands (i.e., those that do not accept paragraph breaks inside)? Are there different space tokens aside from " " and an empty line? It appears that ...
13
votes
2answers
603 views

The revenge of the vboxes

Yes, they're back. With a vengeance. Those pesky little buggers we call \vboxes which I've fought against previously. (And Bruno, too.) \parskip=0pt \def\unquo{\unvbox0\smallskip} ...
5
votes
1answer
93 views

Preventing atoms from changing kind

In the example below, the presence of \mycommand changes the first minus sign into a binary operation atom, so that the spacing between - and 1 is increased. \documentclass{article} ...
4
votes
1answer
123 views

How can I remove a vertical skip added by splittopskip?

The following example splits a box with the setting \splittopskip=2cm. Everything works as expected. However I want to remove the vertical skip add by \splittopskip=2cm some steps later. Is there an ...
11
votes
1answer
644 views

How to prevent extra spaces between two specific words when justification occurs?

My document contains many short, justified lines, so the lines often appear with many spaces between words, e.g.: These words have a space so that they can fit nicely into the available ...
8
votes
2answers
239 views

Practical uses for skips with negative stretch or shrink components

I am currently looking somewhat carefully at how TeX manipulates skips, and I am having trouble finding practical use cases for skips with a negative stretch or shrink component, such as \Askip and ...
4
votes
1answer
362 views

Why doesn't math \fontdimen's work with XeTeX?

Why doesn't the \fontdimen-command change anything with XeTeX? \input pgffor \def\chfndims#1{\foreach\dim in{13,...,19}{\fontdimen\dim#1=20pt}} \font\mymathfn="XITS Math:script=math" at 10pt ...
6
votes
2answers
333 views

Vertical Equivalent of \hfill

Is there an equivalent of \hfill for vertical spacing?
9
votes
2answers
225 views

Which spaces exactly are ignored by \halign?

Some spaces seem ignored by the \halign primitive. For instance, \setbox0=\vbox{\halign{ # \cr \space b \cr}} \showbox0 indicates that there is no glue before b, but that there are two spaces ...
66
votes
3answers
58k views

\vspace vs. \vskip

What is the difference between \vspace{-1em} and \vskip -1em, for example? I guess the first is LaTeX, and the latter is TeX. When is the proper time to use one and not the other, and why?