4

Currently I'm using the baposter document class and one of my figures would take exactly 3/4 of the given poster block. So, pretty much, there's a box,

\headerbox{options}{
    sketch goes here
}

and I want to fit a sketch like this

enter image description here

into it.

Numbers correspond to the text path. Please note that in both 1, 2, 3 there's might be figures, which I add simple doing \includegraphics and 5 is a huge figure (or set of figures going horizontally).

I've tried to do something with multicols but didn't find a way to achieve this layout. As well, I've thought about using table for 1-5, but the \multirow and \multicolumn commands don't work with adjusting the height of the table. Is there a way to achieve this?

3

This can be a situation on which the xcoffins package might be handy; in the example below I draw a frame around each coffin just for visual guidedance; I simply put an "a" on each coffin for the example, but you can place any material instead:

\documentclass{article}
\usepackage{xcoffins}

\newlength\Wi% width for 1,2,3,4
\newlength\Wii% width for 5
\newlength\Wiii% width for 6,7
\newlength\Hi% height for 1
\newlength\Hii% height for 6,7
\newlength\Hiii% height for 2,3,4,5
\newlength\gap% separation between coffins

\setlength\gap{4pt}

\setlength\Wi{\dimexpr0.25\textwidth-0.75\gap\relax}
\setlength\Wii{\dimexpr\textwidth-\gap-\Wi\relax}
\setlength\Wiii{\dimexpr0.5\textwidth-0.5\gap\relax}

\setlength\Hi{.2\textheight}
\setlength\Hii{.1\textheight}
\setlength\Hiii{\dimexpr0.5\Hi-0.5\gap\relax}

\begin{document}

\NewCoffin\result
\NewCoffin\aaa
\NewCoffin\bbb
\NewCoffin\ccc
\NewCoffin\ddd
\NewCoffin\eee
\NewCoffin\fff
\NewCoffin\ggg

\SetHorizontalCoffin\result{}

% Fill the coffins in
\SetHorizontalCoffin\aaa{\frame{%
  \begin{minipage}[t][\Hi][t]{\Wi}
  a % put contents here
  \end{minipage}}}
\SetHorizontalCoffin\bbb{\frame{%
  \begin{minipage}[t][\Hiii][t]{\Wi}
  a % put contents here
  \end{minipage}}}
\SetHorizontalCoffin\ccc{\frame{%
  \begin{minipage}[t][\Hiii][t]{\Wi}
  a % put contents here
  \end{minipage}}}
\SetHorizontalCoffin\ddd{\frame{%
  \begin{minipage}[t][\Hiii][t]{\Wi}
  a % put contents here
  \end{minipage}}}
\SetHorizontalCoffin\eee{\frame{%
  \begin{minipage}[t][\Hiii][t]{\Wii}
  a % put contents here
  \end{minipage}}}
\SetHorizontalCoffin\fff{\frame{%
  \begin{minipage}[t][\Hii][t]{\Wiii}
  a % put contents here
  \end{minipage}}}
\SetHorizontalCoffin\ggg{\frame{%
  \begin{minipage}[t][\Hii][t]{\Wiii}
  a % put contents here
  \end{minipage}}}

% put \aaa into \result
\JoinCoffins\result\aaa

% align all other of coffins
\JoinCoffins\result [\aaa-t,\aaa-r] \bbb [t,l](\gap,0pt)
\JoinCoffins\result [\bbb-t,\bbb-r] \ccc [t,l](\gap,0pt)
\JoinCoffins\result [\ccc-t,\ccc-r] \ddd [t,l](\gap,0pt)
\JoinCoffins\result [\aaa-b,\aaa-r] \eee [b,l](\gap,0pt)
\JoinCoffins\result [\aaa-b,\aaa-l] \fff [t,l](0pt,-\gap)
\JoinCoffins\result [\fff-t,\fff-r] \ggg [t,l](\gap,0pt)

% Typeset \result
\noindent\TypesetCoffin\result

\end{document}

enter image description here

Changing the third optional argument for the minipages you can control the vertical positioning of material inside the coffins; here's a more realistic example of filling for the coffins:

\documentclass{article}
\usepackage{graphicx}
\usepackage{xcoffins}

\newlength\Wi% width for 1,2,3,4
\newlength\Wii% width for 5
\newlength\Wiii% width for 6,7
\newlength\Hi% height for 1
\newlength\Hii% height for 6,7
\newlength\Hiii% height for 2,3,4,5
\newlength\gap% separation between coffins

\setlength\gap{4pt}

\setlength\Wi{\dimexpr0.25\textwidth-0.75\gap\relax}
\setlength\Wii{\dimexpr\textwidth-\gap-\Wi\relax}
\setlength\Wiii{\dimexpr0.5\textwidth-0.5\gap\relax}

\setlength\Hi{.2\textheight}
\setlength\Hii{.1\textheight}
\setlength\Hiii{\dimexpr0.5\Hi-0.5\gap\relax}

\begin{document}

\NewCoffin\result
\NewCoffin\aaa
\NewCoffin\bbb
\NewCoffin\ccc
\NewCoffin\ddd
\NewCoffin\eee
\NewCoffin\fff
\NewCoffin\ggg

\SetHorizontalCoffin\result{}

% Fill the coffins in
\SetHorizontalCoffin\aaa{%
  \begin{minipage}[t][\Hi][t]{\Wi}
  Some text here in the first coffin, just to illustrate a real example. Let's add some more text so we can see the real scenario.
  \end{minipage}}
\SetHorizontalCoffin\bbb{%
  \begin{minipage}[c][\Hiii][c]{\Wi}
  \centering
  Here we have a centered text.
  \end{minipage}}
\SetHorizontalCoffin\ccc{%
  \begin{minipage}[c][\Hiii][c]{\Wi}
  \centering
  Here we have a centered text.
  \end{minipage}}
\SetHorizontalCoffin\ddd{%
  \begin{minipage}[c][\Hiii][c]{\Wi}
  \centering
  Here we have a centered text.
  \end{minipage}}
\SetHorizontalCoffin\eee{\frame{%
  \begin{minipage}[c][\Hiii][c]{\Wii}
  \hfill\includegraphics[height=1.5cm]{example-image-a}\hfill
  \includegraphics[height=1.5cm]{example-image-b}\hfill
  \includegraphics[height=1.5cm]{example-image-c}\hfill\null
  \end{minipage}}}
\SetHorizontalCoffin\fff{%
  \begin{minipage}[t][\Hii][t]{\Wiii}
  Some text here in this coffin, it's vertically aligned at the top of the coffin.
  \end{minipage}}
\SetHorizontalCoffin\ggg{%
  \begin{minipage}[b][\Hii][b]{\Wiii}
  Some text here in this coffin, it's vertically aligned at the bottom of the coffin.
  \end{minipage}}

% put \aaa into \result
\JoinCoffins\result\aaa

% align all other of coffins
\JoinCoffins\result [\aaa-t,\aaa-r] \bbb [t,l](\gap,0pt)
\JoinCoffins\result [\bbb-t,\bbb-r] \ccc [t,l](\gap,0pt)
\JoinCoffins\result [\ccc-t,\ccc-r] \ddd [t,l](\gap,0pt)
\JoinCoffins\result [\aaa-b,\aaa-r] \eee [b,l](\gap,0pt)
\JoinCoffins\result [\aaa-b,\aaa-l] \fff [t,l](0pt,-\gap)
\JoinCoffins\result [\fff-t,\fff-r] \ggg [t,l](\gap,0pt)

% Typeset \result
\noindent\TypesetCoffin\result

\end{document}

enter image description here

1

A way to think of such layouts, if you are familiar with html, is to use boxes the way divs are placed in html, but using minipages.

enter image description here

Here is the MWE

\documentclass[a4paper]{article}
\usepackage{calc}
\usepackage{graphicx}
\def\lorem{This is some text}
\newlength\Wi% width for 1,2,3,4
\newlength\Hi% height for 1
\newlength\gap% separation between boxes
\setlength\gap{4pt}
\setlength\Wi{\dimexpr0.25\textwidth-0.75\gap\relax}
\setlength\Hi{.2\textheight}
\parindent0pt
\begin{document}
\fboxsep0pt
\fboxrule0pt

\newcommand\area[1]{
\frame{%
  \begin{minipage}[b][2\Hi][t]{\Wi}%
     \centering
     \includegraphics[width=.9\textwidth]{#1}  % put contents here
      Some text.
  \end{minipage}}%
}
\area{one}%
\fbox{%
\begin{minipage}[b][2\Hi][t]{3\Wi+2\gap}
\frame{%
  \begin{minipage}[t][\Hi][t]{\Wi}
     \centering
     \includegraphics[width=.9\textwidth]{three}\par
    \lorem
  \end{minipage}}
\frame{%
  \begin{minipage}[t][\Hi][t]{\Wi}
      \centering
      \includegraphics[width=.9\textwidth]{two} % put contents here
  \end{minipage}}
\frame{%
  \begin{minipage}[t][\Hi][t]{\Wi}
       \centering
      \includegraphics[width=.9\textwidth]{three}
  \end{minipage}}
\frame{%
  \begin{minipage}[t][\Hi][t]{3\Wi+2\gap}
       \centering
      \includegraphics[width=.95\linewidth]{four}
     \lorem
  \end{minipage}}
\end{minipage}}
\par
\frame{%
  \begin{minipage}[t][\Hi][t]{2\Wi+1\gap}
     \centering
      \includegraphics[width=.95\linewidth]{five}
     Figure overflows
  \end{minipage}}%
\frame{%
  \begin{minipage}[t][\Hi][t]{2\Wi+1\gap}
    \centering
      \includegraphics[width=.95\linewidth]{six}
      Figure overflows
  \end{minipage}}

\end{document}

The macro area is to illustrate that you may need to abstract the boxes a bit to simplify capturing, if you have a lot of layouts such as this. They get to become a bit unreadable. I consider Gonzalo's solution using xcoffins as more flexible that what is outlined here, but you need to get to understand xcoffins well. Another approach is to use tikz and I am sure someone will post a solution as well. The bottom images don't fit the boxes well and will overflow. I included them to illustrate that the aspect ratios of your images must be proportional to the box aspect ratios.

I have used both fbox and \frame. Personally I prefer \fbox throughout as it is easier to switch the padding and frame off. During development you need to see the frames, but in the final layout you may want to hide them. The Code with this adjustments can be found at Github.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.