GeneralChange top margin on just the title page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
phalkone
Posts: 4
Joined: Fri Mar 30, 2007 5:20 pm

Change top margin on just the title page

Post by phalkone »

For my title page I use \thispagestyle{empty}. The rest of my pages have fancy headers. The weird thing is that indeed the headers and page numbers are not showing up, but there is still a blank vertical space. I know how to change the text height on the fly (just for the title page), but how do I resize the top margin? I searched everywhere, but I still don't have an answer. How do I change the top margin of just one page?

Recommended reading 2024:

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

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

balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Top Margin

Post by balfonsi »

Use the 'geometry' package. The different lengths used in a layout are interdependent and you can't usually modify one of them without having to modify others. 'Geometry' computes everything for you.

B.A.
phalkone
Posts: 4
Joined: Fri Mar 30, 2007 5:20 pm

Change top margin on just the title page

Post by phalkone »

balfonsi wrote: Use the 'geometry' package. The different lengths used in a layout are interdependent and you can't usually modify one of them without having to modify others. 'Geometry' computes everything for you.

B.A.


How does this work for just a single page of my document (title page)? The geometry package sets margins in the preamble of my document in the form of \usepackage[options]{geometry}.
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Top Margin

Post by balfonsi »

If you have a title page on its own ('\begin{titlepage} ... \end{titlepage}'), eg in the report or article classes, use the titling package. It has a \pretitle and a \posttitle command, in which you can specify something like \vspace*{-n\baselineskip}.

If it's the first page of a chapter (in the book class), use titlesec. It has a \titleformat and a \titlespacing command to redefine the appearance and spacing of \chapter, \section, etc.

Regards,
B.A.
phalkone
Posts: 4
Joined: Fri Mar 30, 2007 5:20 pm

Change top margin on just the title page

Post by phalkone »

Sorry still doesn't work. Maybe it is simpler with the code. I get a blank page with headers before the title page.

Framework page:

Code: Select all

\documentclass[a4paper,12pt]{article}

\usepackage[dutch]{babel}
\usepackage{fancyhdr}
\usepackage[pdftex]{color,graphicx}
\usepackage{setspace}
\onehalfspacing

\newcommand{\pretitle{\vspace*{-2\baselineskip}}}


\usepackage{anysize}
\marginsize{3cm}{2.5cm}{2.5cm}{2.5cm}

\def\quote{\list{}{\rightmargin\leftmargin\topmargin}\item[]}
 \let\endquote=\endlist 

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
 \let\endchangemargin=\endlist 

\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{\scshape Title}
\lfoot{\scshape Author}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\begin{document}

\include{titlepage}
\include{body}
	
\end{document}
Title page code (I made my own title page):

Code: Select all

\begin{titlepage}
\thispagestyle{empty} 
\pretitle
\begin{changemargin}{-1cm}{-1cm}
%\enlargethispage{2.5cm}
 \noindent
 \begin{minipage}{3cm}
 \raggedright
   \includegraphics*{images/logo}
 \end{minipage}
 \begin{minipage}{14cm}
 \raggedleft
  \vspace{0.1cm}
 \Large\textsc{School}\\
 \large\textsc{Department number\\
Department name}
 \end{minipage}

\vfill

\bigskip
   \begin{center}
     \Huge \textsc{Title}\\
   \end{center}
 \bigskip

\vfill

 \noindent
  \begin{minipage}{17cm}
 \raggedleft
 	\large \textsc{Author} \\
	$3^{\textrm{de}}$ \textsc{Year}
  \end{minipage}
\end{changemargin}
\end{titlepage}
Thanks a lot for all your help.
balfonsi
Posts: 93
Joined: Wed Mar 14, 2007 12:05 am

Re: Top Margin

Post by balfonsi »

The problem seems to come from your \pretitle command.
Suppress it and write \vspace*{...} just after \begin{titlepage}: everything works as you wish.

It also works with
\def\pretitle{\vspace*{-2\baselineskip} in the preamble, instead of \newcommand{...}, and the command \pretitle just after \begin{titlepage}.

Btw, \thispagestyle{empty} after \begin{titlepage} is useless: it is implicit in a titlepage environment.

Best regards,
B.A.
phalkone
Posts: 4
Joined: Fri Mar 30, 2007 5:20 pm

Re: Top Margin

Post by phalkone »

Thanks a lot for all your help. It works perfectly now.
Post Reply