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}}
afterpage
package is a possibility. Please add a minimal working example (MWE) that illustrates your layout with the manual geometry commands. It will be much easier for us to reproduce your situation and find a solution beginning from compilable code, starting with\documentclass{...}
and ending with\end{document}
. BTW: Welcome to TeX.SX!\newgeometry
and\restoregeometry
under the hood as well? There's also the packagechangepage
(updated version ofchngpage
), which might work for your needs. But the same basic 'problem' of keeping things hidden seems to be the same. FYI:etoolbox
offers lots of environment hooks, which might help keep things hidden. An MWE would help clarify what might work for you.\restoregeometry
has to issue a\clearpage
command. A paragraph can't use two page geometries, because it's typeset before page breaks are considered.