When adding a background image by TikZ
on a custom page, it leaves an empty space where the TikZ
code is incorporated into the document. For example,
\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{calc}
\title{Test Title}
\author{A name}
\begin{document}
\maketitle
\tikz[overlay,remember picture]{%
\node [rotate=45] at ($(current page.north west)+(7,-7)$) {\Huge\textcolor{gray}{TikZ}};
}
\section{First}
\lipsum[1]
\section{Second}
\subsection{This is not nice}
\lipsum[1]
\subsection{This is fine}
\lipsum[1]
\end{document}
As you can see in the below examples, the TikZ
code leaves a footprint on the document (an empty space after \maketitle
before the first section). This is not where the TikZ image is drawn (which is in the margin), but this is where the TikZ code is incorporated into the TeX
document.
How do we treat the TikZ
code to avoid its footprint on the actual document?
Figure 1: Without TikZ
code (no extra space before the first section)
Figure 2: With TikZ
code (an extra space added before the first section)
\maketitle
. Compare the space before the first ssection in both cases (with and without TikZ).