4

I have heard that LaTeX is not necessarily suited to make panels. That even two-column is difficult to get the text to align. I would like to draw stuff like this:

---------------------------
|________________|________|
|________|________________|

Using rectangles of appropriate dimension. Here is a better example.

I was thinking of trying with Tikz and using their nodes... I don't know if that's possible or if there is even easier way.

Here is what I tried. The rectangles don't align properly.

\begin{tikzpicture}[xshift=-0.5in]

\node[draw,thick,rectangle,fill=blue!20, text width=3in, align=left] at (0,0){ \begin{minipage} [t][3in]{3in}  $\int$  $\partial$.  \end{minipage}};

\node[draw,thick,rectangle,fill=blue!20, text width=3in, align=left] at (3.25in,0.25in) { \begin{minipage} [t][3in]{2in}  $\int$  $\partial$.  \end{minipage}};

\node[draw,thick,rectangle,fill=blue!20, text width=3in, align=left] at (0,3.25in) { \begin{minipage} [t][3in]{3in}  $\int$  $\partial$.  \end{minipage}};

\node[draw,thick,rectangle,fill=blue!20, text width=3in, align=left] at (3.25in,3.25in) { \begin{minipage} [t][3in]{2in}  $\int$  $\partial$.  \end{minipage}};

\end{tikzpicture}

2 Answers2

8

Here's an example which makes simple use of flowfram. The package also supports non-rectangular frames but you cannot have the text automatically flow into and out of such frames. See the documentation for details.

\documentclass[a4paper]{article}
\usepackage{xcolor}
\usepackage{flowfram}
\pagestyle{empty}
\newflowframe{.475\textwidth}{.3\textheight}{0pt}{.7\textheight}[topleftsquare]
\newflowframe{.475\textwidth}{.3\textheight}{.525\textwidth}{.7\textheight}[toprightsquare]
\newflowframe{\textwidth}{.3\textheight}{0pt}{.35\textheight}[middlerect]
\newflowframe{.475\textwidth}{.3\textheight}{0pt}{0pt}[leftsquare]
\newflowframe{.475\textwidth}{.3\textheight}{.525\textwidth}{0pt}[rightsquare]
\setallflowframes{border=plain, bordercolor=blue!50!black, backcolor=blue!25, textcolor=blue!25!black}
\setflowframe*{topleftsquare}{backcolor=green!25, bordercolor=green!50!black, textcolor=green!25!black}
\begin{document}
This will go in the first flow frame.
If I keep typing, I'll eventually get to the next one.
Instead, I could\newpage
break the frame early, moving to the next frame at once.
\end{document}

text flow through 5 frames

cfr
  • 198,882
  • how would you create the pages independently to have different flow frames? Eg. I might only want 3 boxes on a particular page? how can it be set up each time from scratch in each page? – Vass Jun 20 '17 at 17:12
  • @Vass Yes, you can do that. Take a look at the manual. – cfr Jun 20 '17 at 23:16
  • 1
    @Vass But TeX is not a great choice if you want a different layout for every page of your document. Then you have all the disadvantages and none of the advantages. Also, just using boxes or something is probably simpler then. Or TikZ nodes. You don't want the flow of text in those kinds of cases, so there's not much point in using this kind of approach. – cfr Jun 20 '17 at 23:19
3

Here's a rather clumsy solution using TiKZ nodes

\begin{tikzpicture}[xshift=-0.5in]

\node[draw,thick,rectangle,fill=blue!20, text width=3in, align=left] at (0,0) { \begin{minipage} [t][2.5in]{3in}  $\int$ this is 
a test of the emergency $\partial$.  \end{minipage}};

\node[draw,thick,rectangle,fill=blue!20, text width=3in, align=left] at (3.25in,0in) { \begin{minipage} [t][2.5in]{2in}  $\int$ this is 
a test of the emergency $\partial$.  \end{minipage}};

\node[draw,thick,rectangle,fill=blue!20, text width=6.25in, align=left] at (1.625in,2.75in) { \begin{minipage} [t][2.5in]{6in}  $\int$ this is 
a test of the emergency $\partial$.  \end{minipage}};

\node[draw,thick,rectangle,fill=blue!20, text width=3in, align=left] at (0,5.5in) { \begin{minipage} [t][2.5in]{3in}  $\int$ this is 
a test of the emergency $\partial$.  \end{minipage}};

\node[draw,thick,rectangle,fill=blue!20, text width=3in, align=left] at (3.25in,5.5in) { \begin{minipage} [t][2.5in]{2in}  $\int$ this is 
a test of the emergency $\partial$.  \end{minipage}};

\end{tikzpicture}