# Text out of margins

I don't know why, but a line in my text is out of margins.

How can I avoid this issue?

I'm using classicthesis in TeXworks.

Edit: with the command

\overfullrule=5pt


I can see a black square where this issue appear.

\documentclass{scrreprt}

\usepackage[english]{babel}

\usepackage{myclassicthesis-preamble}
\usepackage{classicthesis}
\usepackage{microtype}

\renewcommand{\descriptionlabel}[1]{\hspace*{\labelsep}\small\textsc{#1}}

\overfullrule=5pt

\begin{document}

\begin{description}
\item[Service Delivery Framework] The infrastructure to create, publish, manage and consume FI services across their life cycle, addressing all technical and business aspects.
\item[Interface to the Network and Devices] The open interfaces to networks and devices, harmonizing the connectivity needs of services built on top of the platform.
\end{description}

Lastly, on the \emph{political dimension}, legal and legislative barriers presently hinder the efficient cross-border establishment of new innovative solutions due to complex or incompatible ICT policies in Europe.

\end{document}


Two possible problems: this line

\renewcommand{\descriptionlabel}[1]{\hspace*{\labelsep}\small\textsc{#1}}


and the modification in myclassicthesis-preamble(lines 63-70)

\PassOptionsToPackage{
eulerchapternumbers,
beramono,
eulermath,
pdfspacing,
floatperchapter
}
{classicthesis}


in particular the option pdfspacing.

-
Can you try replacing the word presently with present\-lyor put \hyphenation{pre-sent-ly} in the preamble? Probably LaTeX doesn't know how to hyphen that word. –  percusse Dec 4 '11 at 0:53
While code snippets are useful in explanations, it is always best to compose a fully compilable MWE with the paragraph that illustrates the problem.. –  Peter Grill Dec 4 '11 at 1:12
@percusse with pre\-sent\-ly works. But now I realized that there are a lot of these "out of margins". I must to redefine all the english words? =| –  Baduel Dec 4 '11 at 1:15
@PeterGrill I have added the MWE in my updated question. –  Baduel Dec 4 '11 at 1:34
That is certainly not very _minimal_. You need to reduce your preamble and eliminate things that are not related, and then post the code here. –  Peter Grill Dec 4 '11 at 1:52

TeX doesn't hyphenate presently because of two concurring factors:

1. the word present cannot be hyphenated automatically, because it changes its syllables when it's a verb or a noun (just like record);

2. the right hyphenation minimum for English is set to three, that is, TeX is not allowed to leave less than three characters of a hyphenated word on the new line.

If we set \righthyphenmin=2, then \showhyphens{presently} gives present-ly as expected. Loading ushyphenmax via hyphsubst will not hyphenate presently, for the same reason, as \righthyphenmin=3. Saying \hyphenation{pres-ent-ly} in the preamble would allow hyphenation as pres-ently (but not present-ly, because two letters are too few.).

In an emergency situation one can allow hyphenation by typing present\-ly that will override the default minimum.

The format set up by classicthesis is quite strict and your text shows the problems that can arise with long description labels. There's not very much to do apart modifying, if possible, the text. I would avoid \sloppy as much as possible, since it allows producing badly spaced paragraphs.

A better strategy is to use \emergencystretch: with the following modifications

\begingroup\emergencystretch=.3em
\begin{description}

\item[Service Delivery Framework] The infrastructure to create, publish, manage and consume
FI services across their life cycle, addressing all technical and business aspects.

\item[Interface to the Network and Devices] The open interfaces to networks and devices,
harmonizing the connectivity needs of services built on top of the platform.

\end{description}

\endgroup

Lastly, on the \emph{political dimension}, legal and legislative barriers present\-ly hinder
the efficient cross-border establishment of new innovative solutions due to complex or
incompatible ICT policies in Europe.


the text will be typeset without any overfull box and not overly bad spacing.

One should also note that microtype is loaded automatically by classicthesis (line 219 in classicthesis.sty says \RequirePackage{microtype).

-
While present has two possible hyphenations, presently has only one, "pres-ent-ly" (at least according to my dictionaries). Splitting up "-ly" probably wouldn't help much anyway in this situation because the complete "ly" is right of the border, and thus the hyphen would be, too. However "pres-ently" would not violate the three-letter-limit, so why would \hyphenation{pres-ent-ly} not help? –  celtschk Dec 4 '11 at 13:37
With .4em it works. I would also avoid \sloppy as much as possible. Anyway I realized that I have really too much overfull box, most of which are resolved if I don't use the option pdfspacing in myclassicthesis-preamble. What are the issues that I could find in the future if I decide to not load it? –  Baduel Dec 4 '11 at 13:41
From the classicthesis documentation pag. 6: pdfspacing makes use of pdftex’ letter spacing capabilities via the microtype package. This ﬁxes some serious issues regarding math formulæ etc. (e. g., “ß”) in headers. I'm afraid about serious issues. –  Baduel Dec 4 '11 at 13:46
@Baduel The option pdfspacing is relative to letter spacing; if it's active the letter spacing is done via microtype, otherwise via soul. I'd recommend the former. –  egreg Dec 4 '11 at 13:46
@celtschk \hyphenation{pres-ent-ly} would give a hyphenation point pres-ently, but not present-ly because of \righthyphenmin=3. Good point, anyway. –  egreg Dec 4 '11 at 13:49

Edit: It seems like you have a few particularly unlucky places in your document, where only a \sloppy will help. Nonetheless, here is some information that might help understanding hyphenation a bit better and getting fewer of these places. Note that the following only applies to American hyphenation patterns, which is the default loaded by (La)TeX and loaded by babel's options english, american and usenglish, which are all the same.

As has been mentioned, TeX doesn't know how to hyphenate presently. This can be seen by compiling a document containing \showhyphens{presently}; subsequently, the hyphenation points of presently will be put in the .log file -- turns out, there are none. As @percusse noted, adding \hyphenation{pre-sent-ly} to your preamble will solve the problem for this word, but you noted that there are more. So here's what else you could do:

### Load the latest hyphenation patterns

Insert

\RequirePackage[english=usenglishmax]{hyphsubst}


even before your \documentclass{...} to load updated hyphenation patterns for \usepackage[english]{babel} (American patterns).

### Include the known hyphenation exceptions by hand

The Hyphenation Exception Log (Nov 2010) is "the periodic update of the list of words that TeX fails to hyphenate properly" (ibid., p. 1001). On page 1005, it confirms that TeX doesn't know how to hyphenate presently, and lists the desired hyphenation pres-ent-ly.

Here's the relevant paragaph on how to use this list of hyphenation exceptions:

Converting this list into machine-usable hyphenation exceptions

Werner Lemberg has created a script that will convert this article into a real \hyphenation block that can be incorporated into a document either directly or by inputting a file. His work has necessitated some changes to the macros used to format the list, but the appearance of the list will not change. Many inflected forms will be included automatically, some evident in the printed version, but many included silently. The script, hyphenex.sh, is a straightforward shell script and is posted on CTAN, in tex-archive/info/digests/tugboat/hyphenex/ The output of the script is posted in the same area as ushyphex.tex.

(ibid., p. 1001)

Besides that, I second Peter's suggestion of using the microtype package, which improves hyphenation in general and gives your document a more even grayness factor.

-
This solution can be used for hyphenation problem. However I also have the overfull problem in words not hyphenated (see my example). The microtype package is, in any case, loaded by the classicthesis package. Finally, is english=ukenglish the right option for hyphsubst for uk english? –  Baduel Dec 4 '11 at 12:12
With the unhyphenated words, I'm afraid \sloppy (and a timely \fussy) will be your only help. The hyphsubst is only available for english, which equals usenglish; afaik there aren't any updated hyphenation patterns for British hyphenation. –  doncherry Dec 4 '11 at 12:33

Without a MWE it is difficult to know for sure.

The usual reason this occurrs is that TeX was not able to meet all the rules for spacing as per the Overfull \hbox messages. One way to fix this is to add \sloppy which relaxes the rules for inter word spacing. See the answers to Why is text being placed beyond the specified line width? for a more detailed explanation.

Or you could add \usepackage{microtype} to the preamble. See the microtype package documentation for more details.

-
I have added the MWE in my updated question. –  Baduel Dec 4 '11 at 1:33
I was just about to suggest microtype. –  Ryan Reich Dec 4 '11 at 3:08
Maybe LaTeX doesn't know how to hyphenate "presently"? In that case you can just tell it how to do so by writing it as pres\-ent\-ly.
I think that the right hypernation is pre\-sent\-ly (and it works). Now the question is: why I have a lot of these "out of margins" in my document? Is it possible that the default package for the hypernation doesn't spell english in a good way? –  Baduel Dec 4 '11 at 1:13
In fact TeX doesn't know how to hyphenate presently, \showhyphens{presently} puts presently in the .log file, and it's listed in mirrors.ctan.org/info/digests/tugboat/hyphenex/tb0hyf.pdf (cf. tex.stackexchange.com/questions/22867/…), where it says the correct form would be pres-ent-ly. –  doncherry Dec 4 '11 at 11:23
@doncherry Ok I will use pres\-ent\-ly to avoid this issue. However I found other overfull problem in my text, probably related to myclassicthesis-preamble or the \newcommand specified. –  Baduel Dec 4 '11 at 11:50