Joe(theWordy)Philbrook <jtw...@...> writes:

> However what I don't understand why, whether LaTeX can properly
> justify typewriter font or not, surely such a powerful typesetting
> system could detect that the line was going to exceed the intended
> margin, and at least adjust "word wrap" to move the offending word
> down to the next line. (of course then the next line would have to be
> readjusted, then the next ad infinum...) It would still fail true
> justification, but at least the text would remain inside the margins.

LaTeX has internal algorithms to measure the "badness" of a block of text,
and it makes spacing and line-wrapping decisions to minimize badness given
some constraints. Violating a margin is allowed with some penalties; putting
large amounts of space between words is allowed with some penalties. Under
most circumstance, hyphenation is allowed with some penalties. In your
case, there were apparently places where violating the margin was "cheaper".

I suspect that a TeXpert could find and adjust the weights assigned to
various forms of typographical malfeasance such that you'd be very unlikely
to get a margin violation. (That's beyond my level of expertise.) I also 
suspect that if you did that, it would end up either looking like a ragged
right paragraph (if you used small violations for short lines and somewhat
large violations for chasms between words) or the first solution I mentioned
(ERT to adjust inter-word spacing) if you continued to enforce justification
and allowed funky inter-word spacing. Your comment about moving the offending
word is essentially the latter case.

> 
> And if there is a reason I don't understand, why, LaTeX can't do this,

I suspect the authors did not want to make the decision above (which remedy
to adopt) for you.

> Then perhaps LyX itself {could/should?} in the spirit of letting it's
> users focus on content, detect the known problem and make the
> evidently complex coding adjustments necessary to alter the right
> margin {I gather with LaTeX this is controlled by line length settings,
> which I don't think a LyX user should need to know how to override in
> such a way that the override only affects the typewriter font
> paragraph(s)} 

The ERT fix is not complex, just a bit obscure. I suspect one could create
a module to implement it as a LaTeX environment, although I'm not positive.
It's possible the user would need to futz with the values used in the spacing
adjustment (meaning that larger tolerances might be needed in some situations,
and smaller tolerances might produce nicer looking output in others).

/Paul


Reply via email to