Page LayoutTop margin on first page is bigger than I have set

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Mimi_Mikhail
Posts: 10
Joined: Sat May 02, 2015 11:22 am

Top margin on first page is bigger than I have set

Post by Mimi_Mikhail »

Hello!

Below is my MWE. I noticed that the top margin of the first page of every chapter is bigger than what I have set. It is 3cm and not 2cm which is what I want. What did I do wrong?

Code: Select all

\documentclass[a4paper,12pt]{report}

\usepackage{lipsum}

\usepackage[a4paper,lmargin=4.0cm,rmargin=2.0cm,tmargin=2.0cm,bmargin=2.0cm]{geometry}

\usepackage{titlesec}
\renewcommand{\chaptername}{CHAPTER}
\titleformat{\chapter}[hang]
{\normalfont\normalsize\bfseries\centering}{\chaptertitlename\ \thechapter:}{2mm}{\normalsize\uppercase}
\titlespacing{\chapter}{0pt}{0pt}{\baselineskip}

\usepackage{fancyhdr}
\pagestyle{fancy} 
\fancyhf{} 
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[R]{\footnotesize\thepage}

\fancypagestyle{plain}{\fancyhf{}\fancyfoot[R]{\footnotesize\thepage}}

\begin{document}
\chapter{Introduction}
\lipsum[1-10]
\chapter{Methodology}
\lipsum[11-20]
\end{document}
Regards,
Mimi

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Top margin on first page is bigger than I have set

Post by Johannes_B »

It seems like titlesec is introducing a new line there. You can use a negative space for the before skip. Package showframe can help you to show where the typearea is.

Code: Select all

\titlespacing{\chapter}{0pt}{-1\baselineskip}{\baselineskip}

In addition to the generic standard classes, memoir and the KOMA-classes are available. Both of them have very very good manuals; at the beginning of both a few notes about page layout and margins. You should definnitely look into that. Your document is barely readable from a typographic point of view.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Mimi_Mikhail
Posts: 10
Joined: Sat May 02, 2015 11:22 am

Re: Top margin on first page is bigger than I have set

Post by Mimi_Mikhail »

It works! Thank you! And thanks for the additional info Johannes. :D
Post Reply