0

With command \raggedbottom lines on pages are aligned. I need it, \flushbottom generate quite ugly book spread, but in result some pages have different height of text block. I tried play agound with "glue" \spaceskip=\fontdimen2\font plus 5\fontdimen2\font minus 0.3pt and \emergencystretch = 2em, but it don't have an effect on all book pages. Is there any good solution, or i need to check every page and play with glue there directly? \defaultfontfeatures{Microtypography,Ligatures={TeX},Renderer=Basic} have no effect too. Example MWE is:

\documentclass{book}

\usepackage{polyglossia}

\usepackage[hyphenation,parindent,lastparline,nosingleletter]{impnattypo}

\usepackage[defaultlines=2,all]{nowidow}

\usepackage{lipsum}

\usepackage[
    paperheight=215mm,
    paperwidth=145mm,
    top=2cm, 
    bottom=2.5cm,
    inner=2cm,
    outer=2cm
]{geometry}

\setmainlanguage{english}

\defaultfontfeatures{Microtypography,Ligatures={TeX},Renderer=Basic}

\protrudechars=2 % or \pdfprotrudechars=2 and
\adjustspacing=2 %    \pdfadjustspacing=2 with luatex < v0.85
\newfontfeature{Microtypography}{protrusion=default;expansion=default}
\directlua{fonts.protrusions.setups.default.factor=1}

\setmainfont{Arial}

\frenchspacing
\raggedbottom

\begin{document}

\lipsum[1-150]

\end{document}
7
  • Search the .log file for all Underfull \vbox warnings and manually fix them in order. Operation to be done when the text is final. You can use \enlargethispage, \looseness and other "tricks" to get the best page fill
    – Ivan
    Feb 25, 2021 at 12:50
  • It is hard make accurate advices without see directly the problem and having to guess what you have not told us about your document. With the lipsum package and the images supplied by the mwe is a child play to reproduce any problem in a fake document that anybody can see and test for some fix, and show you the exact result.
    – Fran
    Feb 25, 2021 at 13:12
  • The only purpose of \raggedbottom is to allow the space that you have marked in red so if you don't want that then use \flushbottom you then need to control (or remove) other stretchy space on the page, see any questions/answers with grid-typesetting Feb 25, 2021 at 17:21
  • Yea, grid works... mostly same as \raggedbottom... I need to align lines on pages, not in columns.
    – Faktor
    Feb 25, 2021 at 18:57
  • If you need to have matching baselines across pages, and simultaneously wish to avoid widow and club lines, you should look into adjusting susceptible paragraphs using \looseness. See this question for ideas. (By the way, I changed your tag "align" to "vertical alignment". "align" is specific to a particular math structure.) Feb 25, 2021 at 20:13

1 Answer 1

1

The marked white space (or at least equivalent space in the test document) at the bottom of the page was occuring as you were explicitly allowing it via the \raggedbottom declaration, and then forcing the break there by disallowing one line of the next paragraph to be placed on that page.

Using \flushbottom tells tex not to allow space in that position

Soecifying heightrounded to geometry ensures that it is possible to fit in continuos text and achieve the required bottom baseline, by forcing the text height is an integer multiple of \baselineskip plus \topskip.

Replacing the no-widow package by widows-and-orphans allows the pages to be filled but warns of widows and orphans in the log:

Package widows-and-orphans Warning: Orphan on page 6
Package widows-and-orphans Warning: Widow on page 13
Package widows-and-orphans Warning: Orphan on page 17
Package widows-and-orphans Warning: Widow on page 23
Package widows-and-orphans Warning: Orphan on page 31
Package widows-and-orphans Warning: Orphan on page 32

You can then adjust each in turn re-wording or using \enlargethispage or here I just used \looseness to force some paragraphs to take a line less or a line more than they would otherwise, resulting in 36 pages all full with no widows or orphans

enter image description here

\documentclass{book}

\usepackage{polyglossia}

\usepackage[hyphenation,parindent,lastparline,nosingleletter]{impnattypo}

%\usepackage[defaultlines=2,all]{nowidow}
\usepackage{widows-and-orphans}

\usepackage{lipsum}

\usepackage[
    paperheight=215mm,
    paperwidth=145mm,
    top=2cm, 
    bottom=2.5cm,
    inner=2cm,
    outer=2cm,
    heightrounded
]{geometry}

\setmainlanguage{english}

\defaultfontfeatures{Microtypography,Ligatures={TeX},Renderer=Basic}

\protrudechars=2 % or \pdfprotrudechars=2 and
\adjustspacing=2 %    \pdfadjustspacing=2 with luatex < v0.85
\newfontfeature{Microtypography}{protrusion=default;expansion=default}
\directlua{fonts.protrusions.setups.default.factor=1}

\setmainfont{Arial}

\frenchspacing
\flushbottom

\begin{document}

% just so I can see which para is which
\everypar{\stepcounter{enumi}\makebox[0pt][r]{\theenumi\ }}

\lipsum[1-24]

\looseness=1
\lipsum[25]

\lipsum[26-32]

\looseness=1
\lipsum[33]

\lipsum[34-71]

\looseness=1
\lipsum[72]

\lipsum[73-77]

\looseness=1
\lipsum[78]

\lipsum[79-80]

\looseness=1
\lipsum[81]

\lipsum[82]

\lipsum[83]

\looseness=1
\lipsum[84]

\lipsum[85-108]

\looseness=-1
\lipsum[109]

\lipsum[110-128]

\looseness=1
\lipsum[129]

\lipsum[130-150]

\end{document}
4
  • Thanks for example, but. "flushed" space between paragraphs extremely ruin main requirement. Lines on book spread must be aligned. I mean baselines on odd page must be aligned with baselines on even page. \raggedbottom prevent play with glue between paragraphs, and gives me mostly what I need. \looseness and \spaceskip. looks nice, but I thought it too much "manualy" solution.
    – Faktor
    Feb 26, 2021 at 0:49
  • @Faktor sorry that is completely the wrong approach, \raggedbottom as its name implies is explicitly designed to produce the space that you ask to avoid. No inter paragraph spaces are stretched in this answer, if you want to make sure they never stretch then as I mentioned in a comment under the question set them to a fixed length, \setlength\parskip{0pt} for example. Feb 26, 2021 at 0:57
  • 1
    @Faktor if you do not change the linebreakig with looseness or change the wording or give up on widows your constraints are not attainable, you have solid text with no white space so the number of lines per page is fixed, if that happens to be the first line of a paragraph and you do not allow breaking there you need to make something on the page a line longer as I do here or allow the page to be short or allow a page break after the first line. TeX never changes the line breaking to adjust the page breaking so it needs manual control or a multi-pass system or ... Feb 26, 2021 at 1:01
  • @Faktor -- \looseness really is the way to go here. Unless you have a lot of 3-line paragraphs, judicious use of \looseness is your dependable friend. Learn to use it well, and you'll never look back. Jul 26, 2021 at 0:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .