I am trying to create a special box for tables/pictures/text that spans the while width of the page, where the page's geometry is set to provide a margin (left/right alternating with odd/even). I would like to be able to customize the looks of the box frame and fill, so I opted for the tikz package because it lets me draw quite anything so far. To get an overall idea of what I am trying to accomplish have a look at POB1. There 'BOX 3.2' is such an framed environment that has many complex children like figures and text etc.
The many stack-exchange posts regarding similar questions could not provide a working solution to my problem (or I am just to stupid to integrate it).
For starters, I would love the 'figure' in my MWE (see below) to occupy the full width (minus the 1.5cm thin margin) effectively ignoring the margin defaults of 5cm set with 'geometry'. Also, this should work anywhere (even and odd pages).
\documentclass[twoside,openany]{book}
\usepackage[paper=a4paper,margin=1in]{geometry}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{kantlipsum}
\definecolor{LightOcean}{RGB}{81, 147, 229 }
\definecolor{DeepOcean}{RGB}{51, 131, 229}
\begin{document}
\newgeometry{top=3cm,bottom=3cm,left=1.5cm,right=5cm,headsep=10pt}
\lipsum[1-6]
\begin{figure}
\begin{tikzpicture}
\draw (0,0) node[fill=LightOcean!10, text width=\textwidth, text justified, rectangle, draw=DeepOcean, thick, rounded corners=8pt, minimum height=6em]
{\kant[2]};
\end{tikzpicture}
\caption{\kant[1]}
\end{figure}
\lipsum[3-10]
\end{document}
I was thinking of a minipage to encapsulate ... sub-minipages? But how would one tell tikzpicture where to draw the frames?
Many thanks in advance.
changepage
is the package wanted here.changepage
had code for odd/even. However, I have not used it terribly often, so I'm not sure about this. But you are using afigure
so page breaks aren't relevant here anyway.changepage
does have code for odd/even but remember that TeX sets paragraph by paragraph. If a pagebreak comes in the middle of a paragraph then the settings for that paragraph on the two pages will be the same.tikzpicture
, a box doesn't allow a page break ....