Page LayoutControlling the Formatting of the last Page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
adfohs
Posts: 2
Joined: Sun Jan 29, 2012 9:04 pm

Controlling the Formatting of the last Page

Post by adfohs »

Hello,

I have searched the forums for an answer to my problem, and I haven't come across a solution as of yet, so I apologize in advance if this matter has been resolved.

I am wanting to control the formatting of the last page of a document whose number of pages will be unknown. In particular, I want to change the margins and background image of the final page. Both I know how to control when being applied to the entire document, but I want to be able to redefine each.

Is there a way to do this? Any help anyone can offer is appreciated.

Recommended reading 2024:

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

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

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Controlling the Formatting of the last Page

Post by Frits »

Create a separate .tex file, let's call it last.tex, in which the formatting of the final page is done. Then, in you main document use the \AtEndDocument{} macro, e.g.:

Code: Select all

Code, edit and compile here:
\documentclass{article}
\AtEndDocument{\include{last}}
\begin{document}
First page
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
adfohs
Posts: 2
Joined: Sun Jan 29, 2012 9:04 pm

Controlling the Formatting of the last Page

Post by adfohs »

Hey Frits,

Thanks for the response. I've tried what you've suggested, but it doesn't seem to be working. Using the concept of the \AtEndDocument command, here is the basic idea of what I'm trying to accomplish:

Code: Select all

Code, edit and compile here:
\documentclass{article}
\usepackage{wallpaper}
\usepackage{geometry}
\AtEndDocument{
\ClearWallPaper\CenterWallPaper{1}{Last_Page_Background_Image}\newgeometry{Final_Page_Margins}
}
\begin{document}
\newgeometry{Initial margins}
\CenterWallPaper{1}{Background_Image}
Code...
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Ideally, the code would build the document with a different set of margins for the last page and a different background image.

Any thoughts on why this isn't working?
Post Reply