3

I would often like to use a \hfil equivalent inside a normal display math without using some align like environment or leaving math mode. Is this possible and if yes how? Is this the wrong approach? If yes is there a better one?

The Texbook and TexByTopic are silent on the issue other than that all lengths used by mskip have to be in terms of mu which i guess fill can't be expressed in.

4
  • can you describe a particular situation in which you'd like to use this? you can, of course, try \mskip 0mu plus 10000mu, which should be enough to overpower any "ordinary" page width. – barbara beeton Apr 30 '13 at 13:43
  • @barbarabeeton I don't know if that's a totally fair alternative. The analogous technique in horizontal mode was edited out of TeX in 1982! – Ryan Reich Apr 30 '13 at 14:40
  • Can you please show an example where you would use this infinite \mskip? – egreg Apr 30 '13 at 15:41
  • @barbarabeeton I think that anywhere where a finite mu stretch has any effect, 1fill would work as intended. – David Carlisle Apr 30 '13 at 17:59
2

Yes

$a \mskip 0mu plus 1 fill b$ 

Is perfectly legal and produces:

enter image description here

However your issue is probably that most display environments and the primitive display math suppress stretching as a side effect of boxing and measuring things. For one alternative see an answer from yesterday:

`\hfill`-like spacing in math mode without using `align`

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.