Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've come to love TeX's \hfil and \vfil macros, which insert a rubber space (horizontal or vertical, respectively) that can be used to shove content around on a page with respect to the margins. For example,

Some text\hfil here


| Some text                                                               here |
|                                                                              |
.                                                                              .


Some text




| Some text                                                                    |
|                                                                              |
.                                                                              .
|                                                                              |
| here                                                                         |

In light of this, we all know we can't always use the tool we love the most, so I'm stuck with MS Word 2007. As I recall, the abuse of tabular environments always leads to tears, so I'd rather avoid them. Is there any actual Word analogy here?

Note that I do not mean to justify the text either vertically or horizontally (as Word understands the term 'justification') -- while the text will span the entire text area in either case, justification usually implies that the word spacing is still somewhat uniform. I need the text to maintain default spacing on either end.

share|improve this question
As someone who was forced to use MS Word over LaTeX in the past, I feel strongly for your plight. +1 :) – Breakthrough Jul 16 '13 at 14:49
@Breakthrough Weep with me. (Thanks for your condolences XD and for the +1 -- I think questions like this are important if there is ever to be any sort of compromise in the DTP world.) – Sean Allred Jul 16 '13 at 14:56
tab stops comment. – Raystafarian Jul 16 '13 at 14:57
Yeah, at least the equation editor is similar to LaTeX equation formats... As a bit of a thought experiment, I bet one could write some VBA code to effectively provide a LaTeX "console" in MS-Word, where you could simply enter commands like you outlined above, and some predefined VBA code would perform the action at the current cursor position. – Breakthrough Jul 16 '13 at 14:57
@Breakthrough I've attempted something similar, but I think I'm going to move it over to C# (I don't really like VB syntax). I don't know if it could be a console though, more like a simple document converter (thinking Word plugin). But that is certainly off the topic of this questions. ;) – Sean Allred Jul 16 '13 at 15:07

For \hfil you can use a right tab stop.

For \vfil, the only thing I can come up with is to change the line spacing preceding the text here, but I don't think that's what you're after since you want something "flexible."

share|improve this answer

It's a kludge; but you might be able to get what you want with the \hfil by creating a 2 column layout section with text in the left column aligned left and in the right column aligned right.

The main limitation would be if you needed some of left text on one line to go past right text on a different one. In that case you'd need to put the lines in different sets of columns. If you needed to switch back and forth the repeatedly it would get ugly fast.

| Some text with "||" to indicate the column split         ||             here |
| And some more text here would need     ||    this line and the next to be in |
| a separate set of columns from the     ||                         first line |
|                                                                              |
.                                                                              .
share|improve this answer
Nice idea. If you ever personally have the need to do this though, take a look at @Raystafarian's now-comment --- slight abuse of tab-stops does the trick rather well. – Sean Allred Jul 17 '13 at 20:41
Not sure why this was down-voted. It's not quite the same semantically as \hfil, but it solves some of the same problems, with the additional advantage that you can have a whole wrapped paragraph on both sides. – Dan Jul 23 '13 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .