Page LayoutPosition of the page number & the margins

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
oddisle
Posts: 4
Joined: Sun Mar 15, 2015 3:51 am

Position of the page number & the margins

Post by oddisle »

I would like to make my margins (for the non-cover pages) a bit narrower at the base of the pages because there's a huge white space between my page number and the edge of the page, but when I change the geometry settings, nothing happens. What's wrong?

Problem #2 is that the margins of the back cover are behaving weird as well. Everything should be at the positions from the code, but it's moving a bit to the right of the page out of view.

Minimal working exemple:

Main document

Code: Select all

    \RequirePackage{fix-cm}
    \documentclass[12pt,a4paper,oneside]{book}

    \usepackage{graphicx,xcolor,textpos}
    \usepackage{caption}
    \usepackage{float}
    \usepackage{subcaption}
    \usepackage{helvet}
    \usepackage[utf8]{inputenc}
    \usepackage[greek, dutch]{babel}
    \usepackage[vmargin=5cm,hmargin=5cm]{geometry}
    \usepackage[pagestyles, explicit]{titlesec}
    \usepackage{lipsum}
    \usepackage{epigraph}

    \titleformat{\chapter}[display]
      {\normalfont\Large\raggedleft}
      {\MakeUppercase{\chaptertitlename}%
        \rlap{ \resizebox{!}{1.5cm}{\thechapter} \rule{5cm}{1.5cm}}}
      {10pt}{\Huge#1}

    \titleformat{name = \chapter, numberless}[block]
     {\normalfont\Large\filleft}
     {\MakeUppercase{\chaptertitle}
    }%
     {10pt}{\Huge#1\rlap{\hskip0.5em\color{lightgray!50!}\rule[-0.5cm]{6cm}{1.5cm}}}

    \titlespacing*{\chapter}{0pt}{30pt}{20pt}

    \newgeometry{
    \topmargin -10mm
    \textwidth 160truemm
    \textheight 240truemm
    \oddsidemargin 0mm
    \evensidemargin 0mm
    }

    \definecolor{green}{RGB}{172,196,0}
    \definecolor{bluetitle}{RGB}{29,141,176}
    \definecolor{blueaff}{RGB}{0,0,128}
    \definecolor{blueline}{RGB}{82,189,236}
    \setlength{\TPHorizModule}{1mm}
    \setlength{\TPVertModule}{1mm}


    \usepackage[style=verbose-inote, autocite=footnote, backend=biber]{biblatex}

    \DeclareAutoCiteCommand{footnote}[f]{\footcite}{\footcites}
    \renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}

   % \usepackage{filecontents}

    \begin{filecontents}{\references.bib}
    @article{pollard,
	Author = {Foo Bar},
	Date-Added = {2015-03-06 11:58:42 +0000},
	Date-Modified = {2015-03-06 11:59:44 +0000},
	Journal = {The Journal},
	Pages = {147-162},
	Title = {The Title},
	Volume = {35},
	Year = {2015}}
    \end{filecontents}

    \addbibresource{\jobname.bib}

    \begin{document}

    \thispagestyle{empty}
    \newcommand{\form}[1]{\scalebox{1.087}{\boldmath{#1}}}
    \sffamily
    %
    \begin{textblock}{191}(-24,-11)
    \colorbox{bluetitle}{\hspace{123mm}\ \parbox[c][18truemm]{68mm}{\textcolor{white}        {FACULTY}}}
    \end{textblock}
    %
    \begin{textblock}{70}(-18,-19)
    \textblockcolour{}
    \includegraphics*[height=19.8truemm]{UniversityLogo}
    \end{textblock}
    %
    \begin{textblock}{160}(-6,63)
    \textblockcolour{}
    \vspace{-\parskip}
    \flushleft
    \fontsize{30}{32}\selectfont \textcolor{bluetitle}{Thesis title}\\[1.5mm]
    \fontsize{20}{22}\selectfont With a subtitle}
    \end{textblock}
    %
    \begin{textblock}{160}(8,153)
    \textblockcolour{}
    \vspace{-\parskip}
    \flushright
    \fontsize{14}{16}\selectfont \textbf{My Name}
    \end{textblock}
  
    %
    \begin{textblock}{160}(8,191)
    \textblockcolour{}
    \vspace{-\parskip}
    \flushright
    More information\\[4.5pt]
    on my dissertation\\[4.5pt]
    And my supervisor
    \end{textblock}
       %
    \begin{textblock}{160}(8,232)
    \textblockcolour{}
    \vspace{-\parskip}
    \flushright
    2014-2015
    \end{textblock}
    %
    \begin{textblock}{191}(-24,248)
    {\color{blueline}\rule{550pt}{5.5pt}}
    \end{textblock}
    %
    \vfill
    \newpage

    \rmfamily
    \setcounter{page}{0}
    \pagenumbering{roman}

    \tableofcontents
    \thispagestyle{empty}
    %
    \newpage
    %
    \setcounter{page}{0}
    \pagenumbering{arabic}
    \setlength{\parindent}{4em}
    \setlength{\parskip}{1em}
    %
    \input{introduction}
    \input{methodology}
    \input{chapter1}
    \input{chapter2}
    \input{chapter3}
    \input{chapter4}
    %
    \printbibliography
    %
    \newpage

    \thispagestyle{empty}
    \sffamily
    %
    \begin{textblock}{191}(113,-11)
    {\color{blueline}\rule{160pt}{5.5pt}}
    \end{textblock}
    %
    \begin{textblock}{191}(168,-11)
    {\color{blueline}\rule{5.5pt}{59pt}}
    \end{textblock}
    %
    \begin{textblock}{183}(-24,-11)
    \textblockcolour{}
    \flushright
    \fontsize{7}{7.5}\selectfont
    \textbf{Faculty name}\\
    adress\\
    city and country\\
    tel. number\\
    http://www.website.edu\\
    \end{textblock}
    %
    \begin{textblock}{191}(154,-7)
    \textblockcolour{}
    \includegraphics*[height=16.5truemm]{sedes}
    \end{textblock}
    %
    \begin{textblock}{191}(-20,235)
    {\color{bluetitle}\rule{544pt}{55pt}}
    \end{textblock}
    \end{document}
Introduction

Code: Select all

  \restoregeometry
    \titleformat{\chapter}[display]
      {\normalfont\Large\raggedleft}
      {\MakeUppercase*{\chaptertitlename}%
        \rlap{ \resizebox{!}{1.5cm}{\thechapter} \rule{5cm}{1.5cm}}}
      {10pt}{\Huge#1}
    \titlespacing*{\chapter}{0pt}{30pt}{20pt}

    \setcounter{chapter}{0}

    \addto\captionsdutch{\renewcommand{\chaptername}{Introduction}}

    \chapter*{Introduction}
    \addcontentsline{toc}{chapter}{Introduction}

    \pagestyle{plain}

    \section*{First section}

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor  incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.[/MWE]
Methodology (& next chapters)

Code: Select all

  [MWE]

    \chapter{Methodology}
    \section{First section of this chapter}
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

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

Position of the page number & the margins

Post by Johannes_B »

Hi,
a minimal working example consists of just one file. I had trouble putting everything together last time, so now a short link Creating a LaTeX minimal example.

Usually, the title of a document has the exact same margins as the rest of the book/report. If you want to make a cover, which is the outer part of a book and not belonging to the real document, consider a complete extra file that you introduce using package graphicx or pdfpages.

There should be no need to use restoregeometry within a normal document. Set the margins for the document globally using \geometry{top=3cm,bottom=6cm} or whatever you need.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
oddisle
Posts: 4
Joined: Sun Mar 15, 2015 3:51 am

Re: Position of the page number & the margins

Post by oddisle »

I modified the template of my university because I don't like it and the cover is the only thing I really have to use, that's why I had these combinations of geometry settings. Inserting pdf's of the cover made it work. Thanks again!
Post Reply