Ceci est une ancienne révision du document !
Comment désactiver complètement la coupure des mots?
Cela peut sembler une drôle d'idée (après tout, la qualité de son algorithme de césure est l'une des forces de TeX) mais c'est parfois nécessaire.
TeX offre quatre façons différentes de supprimer la césure (il n'y en avait que deux jusqu'à la version 3 de TeX).
Par les pénalités de coupure de mots
Tout d'abord, on peut donner aux pénalités de césure \hyphenpenalty
et \exhyphenpenalty
des valeurs « infinies » (c'est-à-dire 10000, pour TeX). Cela signifie que toute césure pénalisera
suffisamment la ligne qui la contiendrait pour qu'elle n'ait pas lieu.
L'inconvénient de cette méthode est que le moteur TeX recalculera tout paragraphe
pour lequel les césures pourraient être utiles, ce qui le ralentira.
En utilisant une langue sans motifs de césure
Second, one can select a language for which no hyphenation patterns
exist. Some distributions create a language nohyphenation
,
and the hyphenat package uses this technique for its
\nohyphens
command which sets its argument without any
hyphenation. You can load hyphenat with the command
\usepackage[none]{hyphenat}
to prevent any hyphenation in a single-language document. The technique cannot work in a document in which babel controls language selection, since babel incorporates hyphenation change into its language change facilities.
En jouant sur les longueurs minimales des fragments coupés
Les variables \lefthyphenmin
et \righthyphenmin
définissent
la longueur minimale des fragments à gauche et à droite (respectivement)
d'une coupure de mot, en nombre de caractères.
Les valeurs standard en français et anglais sont:
\lefthyphenmin=2 \righthyphenmin=3
Si vous leur donnez une valeur plus grande que la longueur du plus long mot existant,
vous désactiverez de fait la césure.
La valeur généralement conseillée est 62
.
Les trois exemples ci-dessous n'utilisent pas babel, pour un résultat plus illustratif.
\left-
et \righthyphenmin
reprennent leurs valeurs par défaut à chaque changement de langue.
Par la méthode utilisée par LaTeX en interne
Fourth, one can suppress hyphenation for all text using the current font by the command
\hyphenchar\font=-1
This isn't a particularly practical way for users to suppress
hyphenation — the command has to be issued for every font the
document uses — but it's how LaTeX itself suppresses hyphenation
in tt
and other fixed-width fonts.
Comment choisir?
Which of the techniques you should use depends on what you actually want to do. If the text whose hyphenation is to be suppressed runs for less than a paragraph, your only choice is the no-hyphens language: the language value is preserved along with the text (in the same way that the current font is); the values for penalties and hyphen minima active at the end of a paragraph are used when hyphenation is calculated.
Contrariwise, if you are writing a multilanguage document using the babel package, you cannot suppress hyphenation throughout using either the no-hyphens language or the hyphen minima: all those values get changed at a babel language switch: use the penalties instead.
If you simply switch off hyphenation for a good bit of text, the output will have a jagged edge (with many lines seriously overfull), and your (La)TeX run will bombard you with warnings about overfull and underfull boxes (that is, really, lines). To avoid this you have two options.
The simplest route is to use \sloppy
(or its environment version
sloppypar
), and have TeX stretch what would otherwise
be underfull lines to fill the space offered, while prematurely
wrapping overfull lines and stretching the remainder.
The better bet is to set the text ragged right, and at least get rid of the overfull lines; this technique is “traditional” (in the sense that typists have always done it) and may be expected to appeal to the specifiers of eccentric document layouts (such as those for dissertations), but for once their sense conforms with typographic style. (Or at least, style constrained in this curious way.)
Sources: