# Difference between one glue and two glues after each other

Is there a difference between

``````A\hskip 1pt \hskip 0pt plus 1fil B
``````

and

``````A\hskip 1pt plus 1fil B
``````

?

Are these two glues the same in terms of spacing and (line-)breaking? Or do they just add up, as I assume?

-
Thanks for both answers! –  topskip Aug 30 '10 at 12:23
add comment

## 2 Answers

For spacing and line breaking rules, two glue nodes are exactly the same as one glue except that the algorithms run a little slower. So, the distinction only matters if

• you do node processing with `\unskip` (or using luatex)
• when the absolute of one of the combined parts would be larger than `\maxdimen` (in which case you cannot specify the single glue without an error)
• when you parse the output of `\showbox` somehow.
-
That's a much better answer than mine. I didn't even think about points two and three. Thanks! –  TH. Aug 30 '10 at 12:14
sorry for the necrology, but would infinite glues change the situation? (i.e. is `\hskip 1fil \hskip 1pt Text \hskip -1fil` different from `\hskip 1fil Text \hskip -1fil`?) –  Bruno Le Floch Feb 2 '11 at 19:23
@Bruno: that is illegal input. Reverting to valid input, `\hskip 0pt plus 1fil \hskip 1pt` and `\hskip 1pt plus 1fil` are indeed treated identical. –  Taco Hoekwater Feb 3 '11 at 10:26
thank you for the clarification (I only really know the expansion processor). –  Bruno Le Floch Feb 3 '11 at 12:08
add comment

They are mostly the same. The difference comes if you put a `\unskip` before `B`. In the first case, there will be `1pt` of space between the A and B. In the second case, there will be no space.

-
I am not putting unskip there :) The source is exactly as above. (Well almost, as I create the nodes by hand in LuaTeX) –  topskip Aug 30 '10 at 11:40
add comment