Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Open a new document in OpenOffice, ensure that the default font is size 12 Times New Roman and set the alignment to justify. Now, paste or type the following (all on one line, ignore the reformatting here).

I will ping the servers: stash.ronald.mcdonalds.com and secretstuff.steveballmersdesktop.microsoft.com.

Notice how the first line has untenably large spaces between the words in order to reach the far edge of the screen since the last domain is huge and has to wrap to the next line. (I suspect that the same might happen in MS Word, but I don't have a copy to test with.)

How can I make justify "smarter" and let it know that in this case it would be ok to split the domains on the "." as well as on spaces? Is there an alternate solution to this problem that renders a document that's a bit more appealing to the eye? Assume that the document as a whole needs to be justified, and just switching to left-align is not an option.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Another option is to use automatic hyphenation. Even without long domains in your text, it generally makes justified text look better. Unfortunately, your domain names won't break at the period, but have hyphens inserted instead.

To enable automatic hyphenation, select Paragraph from the Format menu, and select the Text Flow tab. Under Hyphenation, check Automatically. Note that OpenOffice's automatic hypehnation behavior is configurable so you can adjust the look if necessary:

OpenOffice Hyphenation

share|improve this answer
    
In this example, it actually hyphenates it at secretstuff.steve-ballmersdesktop... which is unfortunate because that's not an obviously inserted hyphen. But I think this is as close as I'm going to get without having to do the whole thing manually. –  Greg Jul 3 '11 at 4:27

I suppose you will have to manage such a situation manually, for example by inserting optional breaks. Besides optional hyphens, there are no-width optional breaks available: Ctrl+/ or Menu Insert -> Formatting Mark -> No-width optional break. This way, you could insert the optional breaks "preemptively".

In any case, there seems to be no "smart" solution for those cases. It's the same with long paths, maybe in combination with domains. If you can't use formatting features, for example enumerations:

I will ping the servers:

  • stash.ronald.mcdonalds.com and
  • secretstuff.steveballmersdesktop.microsoft.com.

you will have to hyphenate the domain. Even with no-width breaks, there's no ideal solution: placing the break after a separating dot looks as if the sentence is finished at the end of the line, placing it before the dot makes the next line start with a dot:

I will ping the servers: stash.ronald.mcdonalds.
com and secretstuff.steveballmersdesktop.microsoft.com.

I will ping the servers: stash.ronald.mcdonalds
.com and secretstuff.steveballmersdesktop.microsoft.com.`

In certain cases, it may be required to clarify the domain and/or path explicitly, using a comment in footnotes or parentheses.

share|improve this answer

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.