Page LayoutHow to add a proper glue between lines of text?

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
kornaros
Posts: 40
Joined: Wed Nov 30, 2011 12:11 am

How to add a proper glue between lines of text?

Post by kornaros »

Dear members of LC! I have a silly problem. I tried to make an extreme minimal example to expain it. If you run the following piece of code you will notice that the last line of each page does not go to the buttom!

Code: Select all

\documentclass[letterpaper, 12pt]{article}
\usepackage[no-math]{fontspec}
\usepackage{showframe} 
\usepackage{lineno}
\linenumbers
\setmainfont[ Mapping=tex-tex, Scale=3.7]{Arial}
\begin{document}
\fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} \fbox{A} %etc. ...please write \fbox{A} many times for example 400 to take tree-four pages output
\end{document}
My question is: How one could force (Xe)LaTeX to add a proper glue between text lines so that there is no blank space between the last line of each page and the bottom of the textfield and for any possible font height ?(by textfield I mean the square of the page with dimensions textwidth and textheight where the lines are inserted)

Thank you in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to add a proper glue between lines of text?

Post by Johannes_B »

LaTeX inserts some glue between paragraphs of text, but not between lines within them. That would look silly.

All you have to add is \flushbottom in your preamble.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
kornaros
Posts: 40
Joined: Wed Nov 30, 2011 12:11 am

Re: How to add a proper glue between lines of text?

Post by kornaros »

\flushbottom does not solve the problem in my opinion. Maybe this is done using [cmd]\usepackage{setspace}[/cmd] Then I used a big setstretch like [cmd]\setstretch{2.5}[/cmd] This worked well for me for the given size of the letter A but I do not know how this value (2.5) should set properly for best results and for any possible font size!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: How to add a proper glue between lines of text?

Post by Johannes_B »

Now iam even more confused. What are you trying to achieve?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
kornaros
Posts: 40
Joined: Wed Nov 30, 2011 12:11 am

Re: How to add a proper glue between lines of text?

Post by kornaros »

Johannes_B Sorry! I try to eliminate the blank space at the bottom of each page(after the last line) for the case of a font of big size! Setstretch reduces the space between lines (and increases the number of them reducing this gap) . I do not know how to enlarge the space between succesive lines by a small amount to achieve the same effect (to eliminate the gap)!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to add a proper glue between lines of text?

Post by Johannes_B »

Are you looking for \vfill?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
kornaros
Posts: 40
Joined: Wed Nov 30, 2011 12:11 am

Re: How to add a proper glue between lines of text?

Post by kornaros »

Yes! Something like that in each page in other words : I try to find a trick to keep the bottom of facing pages aligned!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to add a proper glue between lines of text?

Post by Johannes_B »

Well, that really would be \flushbottom. Can you maybe show a more realistic example?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
kornaros
Posts: 40
Joined: Wed Nov 30, 2011 12:11 am

Re: How to add a proper glue between lines of text?

Post by kornaros »

Dear Johannes_B I don't know how to place\flushbottom to each page of the text! This command affects only the currebt page.. Am I right? Could you please work with my MWE?
Also I found another command \enlargethispage{\baselineskip}

but I have the same problem! I do not know how to insert this command to avery page, that is for the whole document!
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to add a proper glue between lines of text?

Post by Johannes_B »

enlargethispage really just affects this page, i.e. the page that is currently typeset. flushbottom should work on all pages if put in the document preamble.

But you need a bit of stretchy stuff, which is only inserted between paragraphs.

Packages blindtext and lipsum provide some dummy text, try to reproduce your situation with this text, if you don't want to share the real deal. Package blindtext also knows dummy text in different languages, which might have a different length. I think i have an idea where this might lead to.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply