## LaTeX forum ⇒ Text Formatting ⇒ Ovefull hbox created by em-dash

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Aaliyah
Posts: 3
Joined: Mon May 06, 2013 3:30 pm

### Ovefull hbox created by em-dash

Hello everyone!
There is one problem that currently seems insolvable to me. I am typesetting a book in Russian language and I noticed that, in some cases, an overfull box appears which cannot be solved via manual hyphenation or linebreak or even emergencystretch, because an em-dash is causing it. Due to the typesetting rules, the em-dash MUST stay at the end of the line if the line is about to break at this point, which is why moving it to the beginning of the next line cannot be considered.
I tried applying microtype, but it seems not being able to condense the em-dash ONLY in case it is positioned at the end of the line AND is causing an overfull. Or to condense it at all, to be honest. If I re-define the width of the em-dash-symbol, the same problem will occur at other positions in the book.
Changing the width of the text body didn't bring the desired effect either, because same situation came up as described above.
Here comes the MWE:


Oh, and I'm using TeXstudio 2.5.2.

If you take a closer look at the screenshot you'll see that sometimes even the hyphenation symbol is protruding into the margin, which also causes an overfull vbox:

http://imageshack.us/photo/my-images/12/96357038.jpg/

I'd like to know how to handle these overfull boxes. Is there a way to narrow those symbols depending on their position in text or something like this?
Last edited by Aaliyah on Tue May 07, 2013 11:42 am, edited 1 time in total.

Tags:

cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
Hi Aaliyah,

Welcome to the LaTeX community!

I'd like to mention the fact that you've also asked this question on TeX.sx as a reference to users who like to try to answer your question so that they are aware of possibly existing solutions.

Regards
site moderator & package author

Aaliyah
Posts: 3
Joined: Mon May 06, 2013 3:30 pm
Oh, hi, I just didn't expect to get an answer so soon, but it seems that the problem was already solved, not as I'd want it, but still
I'd like to close the discussion both there and here, but have to go to work. If it can wait until several hours later?

cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
It can wait as long as you want.

It would be nice if you could post the solution you're using here (when you have the time again) so future visitors of this thread can see what the answer was/is.

Regards
site moderator & package author

Aaliyah
Posts: 3
Joined: Mon May 06, 2013 3:30 pm
To summarize what I have learned at tex.sx so far, I have to:

1. Remove all the microtype-options from my preamble. It has to look like \usepackage{microtype}. This action alone has reduced the number of overfull hboxes to a tenth of the previous amount.

2. Handle the remaining cases manually, after the whole document is put together and the page layout has been set and won't be changed.

2a. Place a manual hyphenation in the word preceding the em-dash - sometimes Latex will break it there. If the paragraph with the sentence in question stretches over more than one line - try to add some manual hyphenation above, thus, added up, the hyphenations may provide the desired effect.

2b. Use thin unbreakable space \, instead of ~ where possible, it additionally reduces the overfull hbox, and if it's below 1pt, then it's acceptable.

2c. If thin space doesn't bring the desired effect and neither does manual hyphenation, but the protrusion is still too big, then apply hyphenation, enclose the last syllable together with the em-dash and following word into \mbox and check whether the result looks better than before.

If anyone can come up with another suggestion how to solve this (preferably automatically) - I'd love to hear and test it.
Last edited by Aaliyah on Tue May 07, 2013 10:51 am, edited 2 times in total.

cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
Thanks!
site moderator & package author