17

I'm using this resume template: https://github.com/deedydas/Deedy-Resume Example Resume

This template uses minipage to build a layout like :

+-----------------+
|      Header     |
+------+----------+
|      |          |
|      |          |
| side |   Body   |
| bar  |          |
|      |          |
|      |          |
|      |          |
+------+----------+

Using:

\documentclass{article}  
\begin{document}
\begin{minipage}[t]{0.33\textwidth} 
Sidebar
\end{minipage}
\begin{minipage}[t]{0.66\textwidth} 
Body
\end{minipage}
\end{document}

However, if the body gets too long I end up with something like this:

+-----------------+
|      Header     |
+-----------------+
~pagebreak~        
+------+----------+
|      |          |
| side |   Body   |
| bar  |          |
|      |          |
|      |          |
|      |          |
+-----------------+
       | Overflow |
       |          |
       |          |
       +----------+

Instead of this:

+-----------------+
|      Header     |
+------+----------+
|      |          |
|      |          |
| side |   Body   |
| bar  |          |
|      |          |
|      |          |
|      |          |
+------+----------+
       ~pagebreak~ 
       +----------+
       |          |
       |          |
       |          |
       |          |
       +----------+

I understand that minipages aren't designed to span multiple page but is there a way to make this template work using another environment ?

Thanks !

PiX
  • 171
  • 3
    Breakable boxes like tcolorbox environment or mdframed. By the way, I like your avatar ;-) Most impressive ;-) –  Oct 06 '15 at 10:52

3 Answers3

14

The following attempt uses tcolorbox to create a breakable box to contain the body minipage. The side bar is added as an overlay for the first box part.

This gives the following code:

\documentclass{article}
\usepackage[skins,breakable]{tcolorbox}
\usepackage{lipsum}% example texts
\begin{document}

\textcolor{red}{Header} %  <------------------------
\lipsum[1]

\begin{tcolorbox}[
  blanker,
  width=0.64\textwidth,enlarge left by=0.36\textwidth,
  before skip=6pt,
  breakable,
  overlay unbroken and first={%
    \node[inner sep=0pt,outer sep=0pt,text width=0.33\textwidth,
      align=none,
      below right]
      at ([xshift=-0.36\textwidth]frame.north west)
  {%
    \textcolor{red}{Sidebar} %  <------------------------
    \lipsum[2]
  };}]
\textcolor{red}{Body}: %  <------------------------
\lipsum[3-7]
\textcolor{red}{End of body}
\end{tcolorbox}

\end{document}

I marked the spots for header, side bar and body. The output is:

enter image description here

If needed, everything could be put into a macro or environment for a nicer interface.

4

An easy fix would be to start a second minipage right after the first.

%----------------------------------------------------------------------------------------
%   SECOND PAGE (EXAMPLE)
%----------------------------------------------------------------------------------------

%\newpage % Start a new page

%\begin{minipage}[t]{0.33\textwidth} % The left column takes up 33% of the text width of the page

%\section{Example Section}

%\end{minipage} % The end of the left column
%\hfill
%\begin{minipage}[t]{0.66\textwidth} % The right column takes up 66% of the text width of the page

%\section{Example Section 2}

%\end{minipage} % The end of the right column

%----------------------------------------------------------------------------------------
buttercookie
  • 141
  • 3
3

flowfram can also help in such overflow situations:

enter image description here

\documentclass{article}

\usepackage[margin=.5in]{geometry}

\usepackage{flowfram,lipsum}

\newstaticframe[1]{\textwidth}{.25\textheight}{0pt}{.75\textheight}[top]
\newstaticframe[1]{.3\textwidth}{.72\textheight}{0pt}{0pt}[left]
\setallstaticframes{valign=t}

\newflowframe[1]{.65\textwidth}{.72\textheight}{.35\textwidth}{0pt}
\newflowframe[2]{.65\textwidth}{\textheight}{.35\textwidth}{0pt}

\pagestyle{empty}

\begin{document}

\begin{staticcontents*}{top}
\lipsum[1-2]
\end{staticcontents*}

\begin{staticcontents*}{left}
\raggedright\lipsum[3-4]
\end{staticcontents*}

\lipsum[1-10]% right column the can overflow

\end{document}

The additional frames shown in the above output stems from using the starred version \newstaticframe* and \newflowframe*.

Werner
  • 603,163