Document ClassesVertical alignment of a4pages

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
smal1
Posts: 2
Joined: Tue May 27, 2008 12:13 pm

Vertical alignment of a4pages

Post by smal1 »

Hi..

As a last resort, after reading an endless number of LaTeX guides, i must turn to a helping hand. I am current conducting a report, in relations to my study, and using the following documentclass:
\documentclass[a4paper,10pt,english,openright,twoside]{report}
My problem is, the output has some sort of vertical alignment within chapters, meaning that if a chapter takes up more than one page, the full pages gets vertical aligned. This means that, if a figure is inseted in the specific chapter, the spacing between sections, \\, paragraphs and such are various. I am having a hard time preventing this, as I se it, my only solution is to make the documentclass a oneside, which would be a shame IMO.

But if anyone knows how to curcumvent this, sharing is welcome and well-seen :-)

/Smal

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Vertical alignment of a4pages

Post by Stefan Kottwitz »

Hi Smal,

we had a similar question today. Here I would also suggest to try \raggedbottom.

I want to explain my suggestion. Here is some code of the report class you are using:

Code: Select all

\if@twoside
\else
  \raggedbottom
\fi
\if@twocolumn
  \twocolumn
  \sloppy
  \flushbottom
\else
  \onecolumn
\fi
As you can see if the oneside option is set then \raggedbottom is used. Else it should be \flushbottom and extra vertical space is added to fill the page.
You can test what is set in the document by \show and a look into the logfile.

Code: Select all

\show\@textbottom
gives the output \@textbottom=\relax when twoside, else it gives \@textbottom=macro: ->\vskip \z@ \@plus .0001fil.
\raggedbottom and \flushbottom are defined this way:

Code: Select all

\def\raggedbottom{%
  \def\@textbottom{\vskip \z@ \@plus.0001fil}\let\@texttop\relax}
\def\flushbottom{%
  \let\@textbottom\relax \let\@texttop\relax}
Stefan
LaTeX.org admin
smal1
Posts: 2
Joined: Tue May 27, 2008 12:13 pm

Re: Vertical alignment of a4pages

Post by smal1 »

Perfect Stefan, it worked like a charm. It is though quite annoying that it actually was that easy :D Yesterday I would have considered my self as LaTeX capable, but I must admit that today I'm having my doubts :-P

But thank you for the quick help, 15 hours before the projects due time :)

sincerly...
Post Reply