I'm writing a thesis for which the very first page (or 2 if it's long enough) is the abstract. I have two formatting requirements that I can't figure out, when the abstract continues onto the second page:
- how do I prevent the page number from showing up on page 2? I can suppress it on page 1 with
\thispagestyle{empty}
, but I don't know how to do that for page 2 since I don't know where page 2 starts - how do I add a header that only applies to page 2? Again, I don't know where to put this header declaration since I don't know where page 2 starts
Here are the actual instructions:
If the abstract extends onto a second page, that page should be headed as follows:
Jane Mary Doe – [University], [year of graduation]
The abstract is not paginated.
If the abstract fits on 1 page, then there shouldn't be a second abstract page. Can anybody help me understand this problem?
Best Answer
Since there is no example to work on here, this answer involves some guesswork, and is indebted to the suggestion from @cfr in the comments. I've included some comments in the code to explain it a bit. The crucial (and rather clever) idea given by @cfr is to turn on a special page style for the abstract, but suppress it on the first page only.
Explanations
Page styles in LaTeX are defined and switched on in two stages: to define a style
abc
, you define a new command\ps@abc
that re-defines the four header & footer commands shown above. You then switch to that style using\pagestyle{abc}
. If you want a page style to apply the current page only, then you can use\thispagestyle{abc}
; the previous page style will resume on the following pages.The standard styles are
empty
,plain
(the default inarticle
class),headings
, andmyheadings
. The page layout section on Wikibooks has some useful reference material. There are several packages available that simplify and extend these basic LaTeX mechanisms. You might like to tryfancyhdr
for example.Page styles are applied when TeX gets to the end of a page, so if you switch headings half-way through a page the new style applies to the current page not the next one. So it's usually a good idea to make sure that you have started a new page, before you switch heading styles. The
\clearpage
command does that for you (and also ensures that any pending floats, such asfigure
ortable
environments, are placed before the new page starts).