I am working on an agenda in knitr (using XeLaTeX). I use tikz
for rounded edges around a tabular
environment in the monthly overview. This is the first of several pages of the overview:
As you can see, there is a small white space at the top of the page. I believe that this white space corresponds to the location of the tikz code (As discussed here: How to avoid empty space caused by TikZ).
My question is: is there a way to remove this white space?
- I am looking for a solution that does not require an increase in page margins or decrease in figure size.
- The questions How to avoid empty space caused by TikZ and Centering full-page Tikz image on page without margins with xelatex? seem to ask exactly what I want, but either the answers are not applicable to my case or I could not figure out how to apply the answers to my case.
Here is a MWE (with a single cell and no rounded edges; highlight added manually):
\documentclass{book}
\usepackage[showframe]{geometry}
\setlength{\parindent}{0pt} %no indenting of first line
\usepackage{tikz} %for rounded corners (not in mwe)
\usepackage{adjustbox} %for scaling table to fill page
\begin{document}
\raisebox{-\height}[0pt][0pt]{%
\begin{adjustbox}{totalheight=\textheight, width = \linewidth}
\begin{tikzpicture}
\node(table){%
\begin{tabular}{c}
tabular \\
\end{tabular}
};
\draw (table.north west) rectangle (table.south east);
\end{tikzpicture}
\end{adjustbox}
}
\end{document}
Some extra info about the MWE:
I used
adjustbox
to scale the table to fill the entire page. The resulting tikz image is too big, which would have pushed the image on the next page after an empty page.I therefore followed Gonzola Medina's suggestion to hide the dimensions of the tikz image. This successfully removed the blank pages, but resulted in the unwanted white space at the top of each page.