# [texhax] overfull lines, hyphenation - setup for automatic processing

Pierre MacKay pierre.mackay at comcast.net
Mon Jul 6 17:36:10 CEST 2009

```james mourton wrote:

> Hi,
>
> I'd like to generate documentation from various XML sources
> and create a PDF output using TeX (preferably ConTeXt, possibly LaTeX).
> I need the system to run automatically, without user interaction.
>
> By default, if TeX does not know how to hyphenate words and break lines
> nicely, it leaves it to the user.
>
That is a remarkable claim.  In any case, what you need is proper
settings of \lefthyphenmin, \righthyphenmin and \hyphenpenalty
It is easy enough to make TeX like hyphenation so much that it will
hyphenate every word no matter how long the line is.
\watch what happens when you set a negative \hyphenpenalty.

> Could you please advise, how to tell TeX not to be so fussy
> and rather work reliably -- no overfulls or other errors, even if the
> result
> is not "perfect"? (the "manuscript" is generated, so I don't care
> how complicated or unreadable it is)
>
Huge amounts of \hfuzz  \hfuzz=10pc
Do you really want to shut off all error reporting?  You can get much of
that effect by running in nonstopmode.

>
> 1) Making larger gaps
> How can I set it up, shall I redefine
> \tolerance and \emergencystretch ? To what values? What is the scope
> of the settings?
> Is there any other important option?

Do you mean interword spacing?  That can be set by changing the
\fontdimens of your font.  You can make the basic space as long as you
want to, and you can also increase the added (or subtracted) values.
\fontdimen2, \fontdimen3 and \fontdimen4 are the operative values

>
> 2) Hyphenation
> Is there any way how to fall-back to more aggressive hyphenation rules
> if the default algorithm fails?
> If the word is unbreakable, could TeX just tear off the extra letters
> it and put them to the next line?

Not likely.  Pattern hyphenation either works or it doesn't.  If you are
satisfied with ragged right margins, then the thing to do
is set \rightskip to something like 3pc minus 3pc, and that will usually
cut down on hyphenation a great deal.

> (I could theoretically put \discretionary to every word, but I'd
> prefer TeX to use its own algorithms first)
>
>
> 3) Error reporting
> Another issue is, that texexec
> creates very ugly table (\bTABLE) with overlapping text in the cells,
> but does not report any problem.
> Is there any way how to make it fail loudly, so the problems can
> be detected?

Not if you have shut off error reporting.  \vtop, with an explicit
\hsize = <some dimen> inside the argument braces is a very effectife way
of staying inside the alotted tab box.  Otherwise \tabe are very
explicitly designed to overrun if you put too much there.

You do have a copy of the TeXbook?

>
>
>
> I'm using: ConTeXt
>    TeXExec version 6.2.1
>    pdfTeX 3.1415926-1.40.10-2.2 (Web2C 7.5.7)
>    Linux i386 Centos-5
>
> Kind Regards
>
> James
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>TeX FAQ: http://www.tex.ac.uk/faq
>Mailing list archives: http://tug.org/pipermail/texhax/