1

It is easy to justify horizontally a text in Latex. Is there a way to justify vertically a text?

For the time being I am using the command \begin{spacing}--\end{spacing} for predefined paragraphs, but it is laborious, and there is certainly a more clever way to do it.

Edit: Following Sveinung's comment, I precise that I am considering a multi-page text.

6
  • 3
    It is several different way to do this, depending on the text and number of pages. To centre a one page text within the textheight, you may set the command \vspace{fill} before and after the text. For multi page text, and centring within on the physical page, you need other strategies. Or are you referring to filling the whole textheight between top and bottom margin? This is done by the command \flushbottom, which you place in the preamble of the document.
    – Sveinung
    Commented Aug 10, 2019 at 8:57
  • Thanks @Sveinug for your comments. Could you please elaborate on the other strategies you mention for multi-page text. This is what I need, I think. (I tried with \flushbottom, but what it seems doing is to increase the space between paragraphs only, which does not look good.
    – Beginner
    Commented Aug 10, 2019 at 12:50
  • \addtolength{\baselineskip}{0pt plus 1fil} ;-) Commented Aug 10, 2019 at 13:22
  • Thanks @John for your comment. It works just fine with the command \flushbottom, except that the last page is also vertically justified, which remains a problem because it should not be. Would you know how to fix this last issue?
    – Beginner
    Commented Aug 10, 2019 at 14:24
  • Actually, 1fil is overkill. Even 0pt plus 1pt should be enough glue. 0pt plus 0.01fil will give way to \vfil (automatic on last page). Commented Aug 11, 2019 at 15:45

1 Answer 1

1

NB! If you have footnotes, see last paragraph.

First of all, to ensure that all pages in a document to the maximum extent is fill with textlines, is the absolute final step in production of a document, except for ensuring that you have loaded microtype and babel, which should do as standard (even if you write US English). The next you should ensure, is that you are using a modern, scalable font, not the standard bitmapped.

Write you text to the finished stage, proofread it as many times as necessary. Only when your work as author is finished, you should start your work as typographer. Do not waste your time trying to make a perfect document before you have finished editing the text.

Load the package widows-and-orphans. It will help you by setting sensible penalty values to avoid some typographical errors.

Take a printout of the document. It is much easier to see errors and decide actions when you have a printout. Look for bad page breaks. Is it many, or few?

Work backward from the bad page break and look for bad hyphenation. Help babel with some \- soft hyphens.

Still not good? Look for heading spanning two or more lines. Decide if you may rewrite to shorter, one line heading. Look at the title, too. Look for paragraphs, which have very short or long last line. Is it possible to rewrite one or two sentences to occupy one line more or less?

Still empty lines at the bottom of more than one page? If possible for you (no external restriction), see what you can achieve by decreasing or increasing the top- or bottom margin with one baselineskip.

If you still have an offending page, decide if you can accept a page with one line more or less than other pages. You can then use the command \enlargethispage[<value>]. You give a negative value to decrease the page size. If you shall print the paper on both side of paper, ensure that both pages in a spread has the same number of lines.

If you have lot of tables, pictures etc., you you have to identify if some of them gives you trouble. Check if all is set as floats, because none-floating objects is often a problem with respect to page breaks.

Even LaTeX needs lot of manual work to create a near perfect document, but significant less than a well known word processors (which nevertheless creates bad typography). And remember: This is the final touch up. You should not focus on page breaks before you have finalised you creative writing, that will kill you creativity.

Footnotes: If you have footnote in your document, \raggedbottom unfortunately typeset the footnotes in relative to the text. If you have footnotes on a page where only half the page with text, the footnotes are printed high up on the page. \flushbottom remedies this problem, but has, as you have observed, some other side. If you use KOMA-script or the package footmisc with the option [bottom] the footnote will be typeset at bottom of the page (where they belong),even with \raggedbottom.

3
  • Thanks @Sveinung for your answer which is good advice. Yet, how do I kill the flushbottom in the last page of my document?
    – Beginner
    Commented Aug 10, 2019 at 18:03
  • When I tried and MWE \documentclass{article} \usepackage{blindtext} \flushbottom \begin{document} \blinddocument \blindtext[3] \end{document} I did not get flushbuttom last page. Look at your document, and see if you have a flushbuttom in the text. If you follow the strategy I describe, you will not get any excess with space at the bottom of pages, so flushbottom is in principle unnecessary.
    – Sveinung
    Commented Aug 11, 2019 at 14:06
  • Problem solved (see my last comment above). Thanks.
    – Beginner
    Commented Aug 11, 2019 at 17:49

You must log in to answer this question.

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