Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Thanks for both answers! –  topskip Aug 30 '10 at 12:23
add comment

2 Answers

up vote 14 down vote accepted

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.
share|improve this answer
    
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.

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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