Often enough, I run into the problem of a tikzpicture being too large to fit on the page where I would like it to be.
Consider the MWE (compiled with pdfLatex):
\documentclass[a5paper,12pt,openany]{book}
\usepackage[paperwidth=5.5in,paperheight=6.25in]{geometry}
\textwidth=4in \textheight=3.15in \voffset -7pt \evensidemargin=-10pt
\usepackage[tracking=true]{microtype}
\usepackage{tikz,lipsum}
\usepackage{mathptmx}
\definecolor{Italiangreen}{RGB}{0,140,69}
\definecolor{Italianred}{RGB}{205,33,42}
\begin{document}
\thispagestyle{empty}
\lipsum[1]
\begin{center}
\begin{tikzpicture}[pencildraw/.style={ %
decorate,
decoration={random steps,segment length=4pt,amplitude=2.5pt}
} %
]
\node[preaction={fill=black,opacity=.7,transform canvas={xshift=1mm,yshift=-1mm}},
%pencildraw,
draw,fill=Italiangreen,text width=0.85\textwidth,inner sep=4mm]
{\begin{minipage}{3.42in} \small
\selectfont \textbf{\lipsum[16]} \vspace{5pt} \hfill \textbf{\emph{---L. Iipsum}} \end{minipage}};
\end{tikzpicture}
\end{center}
\end{document}
with the output:
QUESTION: Aesthetically speaking, what should be done here? Is it possible to have LaTeX "split" the picture so that it displays over two pages—thus eliminating the unsightly large gap on the first page? In cases where the picture is slightly oversized, enlarging the first page a little with the \enlargethispage
command seems to work fine. So, I would like to know the optimal thing to do when the tikzpicture is quite large relative to the space available on the first page. Suggestions?
Thank you.
Best Answer
You could use a
tcolorbox
instead of atikzpicture
. Tcolorboxes have an option to allow page breaks.Here an easy example to get you started: