[scribus] Paragraph Justification

john Culleton John at wexfordpress.com
Thu Nov 17 15:25:04 UTC 2011

On Wed, 16 Nov 2011 17:49:59 -0800 Ted Powell <ted at psg.com>

> AFAICR (as far as I can remember), if the last line of a
> justified paragraph was not justified, it simply had the
> default spacing between words.
> If when building a non-final line a word that overflowed was
> always moved (in full or in part, considering hard/soft
> hyphens) to the next line, and the word spacing increased, this
> would mean that the average text density of the non-final lines
> would generally be less than that of the final line.
> So I had three values for the spacing between words: min,
> default, max. A word (or hyphen-delimited partial word) would
> be moved to the next line or squeezed into the current line,
> depending on which had the lesser effect on the word spacing.
> AFAICR, min was 0.75 or 0.8 of the default. Max was something
> large; exceeding it meant that the line would be just
> left-aligned even though it wasn't final.
> This may have been overkill, but I had fun doing it (even
> though it was all in PL/I) and did production work with the
> result.

Very commendable. I once battled with PL/I and lost. I retreated
back to COBOL.

As far as I know TeX is still the gold standard for typesetting
decisions. It is heavily parameter driven via a series of user
adjustable "penalties" and the like. The program makes two passes
over the paragraph. The first attempts to justify the paragraph
without violating any rules and without hyphenation. If that
doesn't work the second pass uses hyphenation. If that doesn't
work there is an optional third pass which allows for greater
word spacing. I have never used this optional third pass. Each of
the three passes has its own limit, called a tolerance. which
indicates how much TeX can vary from an exactly set line of type:

\pretolerance 100 
\tolerance 200 
\emergencystretch 0

If TeX can't justify a paragraph within the rules as set one or
more lines will be tagged with a black rectangle at the end to
indicate an overflow line. Some adjustment must be made by the

The margins of the lines of a justified paragraph need not be
mathematically identical.  A tolerance can be set in fractions of
a point that helps with justification.  The default is: 
\hfuzz 0.1pt

There are several parameters that are set to control hyphenation.

And of course there is hanging punctuation AKA optical alignment.
There is microtypography where the glyphs themselves can be
stretched or shrunken by tiny amounts to put the interword spaces
closer to the norm. Scribus  has glyph stretch or shrink
capabilities but they are not automatically applied if and when
needed for justification. 

The space at the end of the last line usually varies from 0 to
the maximum length  of a line. But one can fiddle with that space
for special purposes, often to ensure that the last line of a
paragraph overlaps the indentation of the next, or that a vary
short hyphenated word fragment doesn't occur there. Of course the
length of a hyphenated word fragment in characters in general is set 
with these defaults:
\lefthyphenmin 2
\righthyphenmin 3 

Enough. With the possible exception of InDesign no available
desktop typesetting system takes the formation of paragraphs more
seriously than TeX. So Scribus can:
1. Attempt to match TeX feature for feature with independently
created code, 
2. Rewrite some or all of TeX into Scribus code, or 
3. Just call TeX to render paragraphs.

I suggest the last as the most cost-effective course.  But the
form of TeX used should be both the most recent (luatex or xetex)
and the most primitive. We are not asking TeX to typeset an
entire page or adorn it with running heads etc. In other words we
are not trying to do what Lyx does.  So any form of LaTeX or
Context is not optimal. LaTeX & Context are too verbose and too confining.
Primitive commands are more appropriate for this appplication. 
We need to pass to TeX the decisions already made in Scribus in
terms of font selection, font size, line length etc. and let TeX
set the paragraph. Some other parameters such as tolerance etc.
could be selected from a menu in Scribus and passed on to TeX in
the form of global tags TeX understands. The idea is to use TeX to set
the paragraph and nothing more. The output can be reimported as a
tiny pdf file.   

-- John Culleton Free list of books for self-publishers:

"Create Book Covers with Scribus"

More information about the scribus mailing list