I am trying to establish one geometry for my first page (not a title page), and use another for the rest of the document. However, because I am trying to make a template, and thus do not want to rely on a user to put in \newgeometry or \restoregeometry in the text of the document, I would like to establish these geometries in the preamble. Is there any way to do this?
A minimum working example
\documentclass{article}
\usepackage{lecturenotes}
\usepackage{afterpage}
\thispagestyle{plain}
\begin{lecture}{01}{Sample Lecture Notes}{John Sam}{01/01/2000}{Mark John}{PHYSICS 124: Physics of Energy}
\afterpage{\newgeometry{top=2cm, bottom=2.5cm, outer=5.5cm, inner=2cm, heightrounded, marginparwidth=3.5cm, marginparsep=0.4cm, includeheadfoot}}
\end{lecture}
\theend
The style 'lecturenotes'
\def\fileversion{1.0}
\def\filedate{2014/02/05}
\NeedsTeXFormat{LaTeX2e}
\usepackage{graphicx}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage[top=0.5cm, bottom=2.5cm, outer=5.5cm, inner=2cm, heightrounded, marginparwidth=3.5cm, marginparsep=0.4cm, includeheadfoot]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\newcommand{\handout}{
\noindent
\begin{center}
\framebox{ \vbox{ \hbox to 13.5cm { {\bf {\course}} \hfill {Lecture \lecturenum\ -- \lecturedate} }
\vspace{4mm}
\hbox to 13.5cm { {\Large \hfill {\lecturetitle} \hfill} }
\vspace{2mm}
\hbox to 13.5cm { {\it {Lecturer: \lecturer} \hfill {Notes by: \lecturescribe}} }
}
}
\end{center}
\vspace*{4mm}
}
\newenvironment{lecture}[6]{
\begin{document}
\global \def \lecturenum {#1}
\global \def \lecturetitle {#2}
\global \def \lecturescribe {#3}
\global \def \lecturedate {#4}
\global \def \lecturer {#5}
\global \def \course {#6}
\handout
}
\lhead{\lecturedate}
\chead{\lecturetitle}
\rhead{Lecture \lecturenum}
\lfoot{}
\cfoot{\thepage}
\rfoot{}
\newcommand{\theend}{\end{document}}
Best Answer
If all you want to do is change the top margin on the first page, you're doing it the hard way. Just use a negative
\vspace
to move the text up to wherever you want it. The use ofhandout
andlecture
makes me wonder if this is not part of an even more elaborate set-up, but, in principle, you could do something like this:Then plug
\toplen
intogeometry
and\vspace*{\fpgap}
into your\handout
command. Note: this is really designed to give you only 0.5 cm between the top of the physical page and the top of theframebox
. Your originalgeometry
command would leave significantly more space.Here's a complete example, slightly changed from yours above. (Mainly with respect to the not-advised hiding of
\begin{document}
and\end{document}
; but I also made\lecture
[a command] from the environmentlecture
.)