To suppress overflows, on one extreme, we have ragged layouts which suppress justification :
\usepackage{ragged2e} % https://tex.stackexchange.com/questions/168480/why-does-tex-prefer-an-overfull-box-to-hyphenating-here
\RaggedRight
On the other extreme, we have standard justified text and one can use \sloppy which does not solve every problem anyway.
Both leads to ugly things for me.
At this point, I have come to:
\usepackage{hyphenat}
\hyphenpenalty=750
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[babel=true,kerning=french,protrusion=true,expansion=auto,spacing,tracking]{microtype}
\pretolerance=1500
\tolerance=2000
\setlength{\emergencystretch}{2em}
Which is the best solution I could come to, for my usage (French has compound words and apostrophes which deal badly with hyphenation - for compound words, I use \BreakableHyphen{}). Good discussion here and here.
But ideally, I would like standard tolerance and in some exceptional cases, relax the justification and replace it with a left alignment. But I want that parameterized in the preamble because I want the users to parameterize the format of the eBooks they will get, and want them to fit right without control. So local solutions are prohibited here.
What I imagine would be something like:
% previous lines identical
\pretolerance=300
\tolerance=500
\setlength{\emergencystretch}{2em}
pseudo-code: if (overflow) then underflow the current line by moving the last word to the next line
Any idea please?
\documentclassand ending with\end{document}to demonstrate some of the current issues you routinely face. – Steven B. Segletes May 16 '14 at 15:04