1

Is there any way I can tell LaTeX to try to do the normal full-justification if at all possible, but in worst case (if the h-box would otherwise be overfull), to just line-break early and leave a ragged right?

Noldorin
  • 890
  • 1
    In the worst case \raggedright, indeed. In less serious cases, it comes to my mind: not use big fonts in narrow columns, allow hyphenation whenever possible (set hyphenpenalty, \exhyphenpenalty, \pretolerance, \tolerance, \righthyphenmin, \lefthyphenmin, use \hyphenation or \- for unknown words), use the microtype package, rewrite the text, set \emergencystretch, set \fontdimen3, \fontdimen4 and \fontdimen7 and ... Have I said already rewrite the text? – Fran Jan 21 '21 at 07:33
  • @Fran That's a less than ideal solution, especially because this is text generated by biblatex. I would think TeX should be able to automate this. – Noldorin Jan 21 '21 at 17:03
  • An overfull \hbox mean that LaTeX already tried to do the normal full-justification automatically, but for some reason it not possible. So you must change something to make it possible. For a bibliography, the problem is the same, and the solutions too, (obviously except the rewrite of the text). – Fran Jan 23 '21 at 01:05
  • @Fran But there is non (hypothetical) reason that LaTeX could not simply fall back on leaving a ragged right instead of complaining about an overfull hbox. Is it possible to implement such behaviour? – Noldorin Jan 23 '21 at 02:38
  • Of course, except when some word is longer that a line width, LaTeX always can justify, even without hyphens, and avoid any overfull \hbox making a line break whenever needed. This is exactly what \raggedright does. If you want some less drastic ragged margin, allow some hyphenation (e.g. \raggedright\hyphenpenalty50) and/or allow more stretching and shrinking of the space between words (for instance, playing with \fontdimen). – Fran Jan 23 '21 at 10:48
  • Anyway, without see the true problem, the question is too general for a reasonably precise and concrete answer. Let us see a minimal working example with bibliography (MWEB) showing how the overfull \hbox are really disturbing you. – Fran Jan 23 '21 at 11:00
  • But that's the point: I want a general solution. This seems like a basic task. You can probably get an MWE just by doing a long line with \mbox{...} around a lot of the letters. – Noldorin Jan 23 '21 at 19:16
  • The general solution is what I tried to explain before. – Fran Jan 24 '21 at 00:13
  • That's not a general solution, because it involves having direct access to / control of the text that gets output. – Noldorin Jan 24 '21 at 00:16
  • Does anyone have any ideas? I'll set a bounty on this in a few days if not, maybe. – Noldorin Jan 29 '21 at 17:55

0 Answers0