<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
(Tento dotaz jsem postnul na tex.stackexchange.com, ale s dovolením
se zeptám i zde.)<br>
<br>
Dobrý den,<br>
<br>
pracuji teď na větším projektu s textem, jejž naprosto nemohu měnit,
takže občas narážím na problémy se zlomem. Vytvořil jsem si tedy
následující makro pro plain i LaTeX (jehož užití samozřejmě
předpokládá, že už je nastaveno hyphenation atp.):<br>
<br>
<blockquote><tt>\def\emergency #1 #2\par{%</tt><tt><br>
</tt><tt>\begingroup</tt><tt><br>
</tt><tt> \ifcase #1</tt><tt><br>
</tt><tt> \message{Emergency level 0 does nothing at all.}%</tt><tt><br>
</tt><tt> \or</tt><tt><br>
</tt><tt> \tolerance = 250</tt><tt><br>
</tt><tt> \message{Emergency level 1: increasing
\string\tolerance\space to \the\tolerance.}%</tt><tt><br>
</tt><tt> \or</tt><tt><br>
</tt><tt> \tolerance = 300</tt><tt><br>
</tt><tt> \message{Emergency level 2: increasing
\string\tolerance\space to \the\tolerance.}%</tt><tt><br>
</tt><tt> \or</tt><tt><br>
</tt><tt> \tolerance = 300</tt><tt><br>
</tt><tt> \righthyphenmin = 2</tt><tt><br>
</tt><tt> \message{Emergency level 3: increasing
\string\tolerance\space to \the\tolerance,</tt><tt><br>
</tt><tt> decreasing \string\righthyphenmin\space
to \the\righthyphenmin.}%</tt><tt><br>
</tt><tt> \message{You might need to set hyphenation
properly for this emergency level to work.}%</tt><tt><br>
</tt><tt> \or</tt><tt><br>
</tt><tt> \righthyphenmin = 2</tt><tt><br>
</tt><tt> \emergencystretch = 5pt</tt><tt><br>
</tt><tt> \message{Emergency level 4: increasing
\string\emergencystretch\space to \the\emergencystretch,</tt><tt><br>
</tt><tt> decreasing \string\righthyphenmin\space
to \the\righthyphenmin.}%</tt><tt><br>
</tt><tt> \message{You might need to set hyphenation
properly for this emergency level to work.}%</tt><tt><br>
</tt><tt> \or</tt><tt><br>
</tt><tt> \righthyphenmin = 2</tt><tt><br>
</tt><tt> \emergencystretch = 8pt</tt><tt><br>
</tt><tt> \message{Emergency level 5: increasing
\string\emergencystretch\space to \the\emergencystretch,</tt><tt><br>
</tt><tt> decreasing \string\righthyphenmin\space
to \the\righthyphenmin.}%</tt><tt><br>
</tt><tt> \message{You might need to set hyphenation
properly for this emergency level to work.}%</tt><tt><br>
</tt><tt> \else</tt><tt><br>
</tt><tt> \errmessage{Emergency level #1 not supported!}%</tt><tt><br>
</tt><tt> \fi</tt><tt><br>
</tt><tt> #2</tt><tt><br>
</tt><tt> \par</tt><tt><br>
</tt><tt>\endgroup</tt><tt><br>
</tt><tt>}</tt><tt><br>
</tt></blockquote>
<br>
Předpoklad je takový, že makro umístím na začátek odstavce, jenž
dělá problémy, a vyzkouším postupně hodnoty od jedné do pěti.<br>
<br>
<blockquote><tt>...předchozí odstavec.<br>
<br>
\emergency 1 % nebo 2, 3 až 5<br>
Text odstavce, jenž se chová nehezky a odmítá se pěkně zlomit...<br>
<br>
</tt></blockquote>
Nejsem ale v nastavování těchto parametrů příliš zkušený (načrtl
jsem to narychlo po nahlédnutí do TBN) a jsem trochu v časovém
stresu, proto bych byl vděčný, kdyby se kdokoli zkušenější na to
případně podíval a posoudil, zda jsou ty kroky přiměřeně rovnoměrné
nebo naopak možná je některý příliš hrubý, zda by to nešlo někde
lépe atd. apod.<br>
<br>
Děkuji a zdravím<br>
Marcel Svitalský<br>
<br>
<div class="moz-signature">-- <br>
Marcel Svitalský<i> </i>
</div>
</body>
</html>