# How can I define a breakable box with resized width after the first page?

I want to define a side-by-side layout with two columns for a—potentially multiple page—resume.

The left column is supposed to contain some static information on the first page (e.g. personal and contact data) and then should be resized for the following pages (e.g. containing only the name or page).

The right column needs to be breakable to accomodate potential multiple pages of content (e.g. for education, work experience, ...).

I was trying to implement this using tcolorbox with breakable parameter to implement the right column and overlays for the left column. I'm using overlay first/overlay middle and last hooks to resize the left column.

The problem is that only the left column is resized correctly. Additionally, the breakable box is not correctly aligned and the text content overflows.

Is there a way to align the boxes and resize the text width for all pages after the first page with tcolorbox? If it's not possible with tcolorbox, what would a better solution look like?

MWE

\documentclass[a4paper, 12pt]{article}

%
%! Dependencies
%
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{geometry}
\usepackage{titleps}
\usepackage{tikz}
\usepackage{tcolorbox}

\usepackage{blindtext}

%
%! Settings
%
\usetikzlibrary{positioning}
\tcbuselibrary{skins, breakable}

%! blank page style
\newpagestyle{blank}{%
\setfootrule{0pt}%
\setfoot{}{}{}%
}

%! blank page geometry
\newgeometry{%
%! ignore header, footer, margin par
, nomarginpar%
, ignoreall%
, width=\paperwidth%
, height=\paperheight%
}
\savegeometry{blank}

\pagestyle{blank}

%
%! Document
%
\begin{document}

\begin{tcolorbox}[%
show bounding box%
, colback=white%
, colframe=white
, borderline={0pt}{0pt}{white}%
, sharp corners%
, breakable%
, height fixed for=all%
, text width=0.65\paperwidth%
, overlay first={%
\tikz{%
\draw[use as bounding box, fill=black] rectangle (0.3\paperwidth, \paperheight);%
\node[text=white, below right=0pt and 0pt of current bounding box.north west] {%
\begin{tabular}{l}
0.3\textbackslash paperwidth\\
side\\
bar
\end{tabular}
};%
}%
}%
, overlay middle and last={%
\tikz{%
\draw[use as bounding box, fill=black] rectangle (0.15\paperwidth, \paperheight);%
\node[text=white, below right=0pt and 0pt of current bounding box.north west] {%
\begin{tabular}{l}
0.15\\
\textbackslash paperwidth\\
side\\
bar
\end{tabular}
};%
}%
}%
]%
\blindtext[10]
\end{tcolorbox}

\end{document}

• Resizing the right column will always cause problems if it breaks in the middle of a paragraph. There are ways to fix that, but all have side effects. Also, the flowfram package seems ideal for this application. – John Kormylo Jan 19 '17 at 23:08

The main difference with flowfram is that it fills the frame with text, whereas tcolorbox adds inner sep margins. You just have to remember to add the margins yourself, either by reducing the size of the frame or adding things like \leftskip and \rightskip.

Note the paragraph where the page was broken.

\documentclass[a4paper, 12pt]{article}

%
%! Dependencies
%
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}

\usepackage[margin=0pt]{geometry}% use entire page
\usepackage{flowfram}
\usepackage{tikz}
\usepackage{lipsum}

\AtBeginDocument{\pagestyle{empty}}

%
%! Settings
%
\newstaticframe[1]{0.3\paperwidth}{\paperheight}{0pt}{0pt}[first]
\newstaticframe[>1]{0.15\paperwidth}{\paperheight}{0pt}{0pt}[second]

\setstaticframe*{first,second}{backcolor=black,textcolor=white}

\begin{staticcontents*}{first}
\begin{center}
default is vertically centered
\end{center}
\end{staticcontents*}

\begin{staticcontents*}{second}
But you can use \verb$\vspace*{\fill}}$ to force text to the top or bottom.
\vspace*{\fill}
\end{staticcontents*}

\newflowframe[1]{0.65\paperwidth}{\paperheight}{.35\paperwidth}{0pt}
\newflowframe[>1]{0.8\paperwidth}{\paperheight}{.2\paperwidth}{0pt}
\begin{document}
\lipsum[1-12]
\end{document}

• Awesome! Any way to switch back out of a flowfram layout, e.g. back to blank page layout without frames? – FK82 Jan 20 '17 at 8:07
• The frames are limited to the pages specified in the page list. Without a flow frame, the default text area will be filled. – John Kormylo Jan 20 '17 at 15:11
• Actually, you can also dynamically enable and disable frames (see section 3.2 in the flowfram user guide). – FK82 Jan 20 '17 at 17:30