1

I want to put to tcolorboxes side by side in a beamer document. I am using tcbraster to split the page in two. However, the two tcolorboxes are placed one below the other and not side by side. Strangely I manage to do what I want for the boxes "Introduction" and "Significance" but not for the "Cells" and "Demes" boxes in the attached image.

What am I doing wrong?

\documentclass{beamer}
\usepackage[size=a2,orientation=portrait,scale=1.3]{beamerposter}
\setbeamersize{text margin left=5mm,text margin right=5mm} 
\RequirePackage{enumitem}
\RequirePackage[normalem]{ulem}
\RequirePackage{etoolbox}
\usepackage[skins,most]{tcolorbox}
\tcbuselibrary{skins,raster}
\usepackage{adjustbox}
\newtcolorbox{mybox}[1]{colback=white,colframe=ICOrange, coltext=ICDeepBlue, arc=3mm, title=#1}

\newtcolorbox{ghostbox}[1][]{%
  colback=white,
  colframe=white,
  coltext=ICDeepBlue, 
  #1%
}

\usepackage{graphicx}
\usepackage{caption}
\graphicspath{ {./images/} }

\begin{document}

\begin{frame}[fragile=singleslide,t]\centering

 \maketitle

\begin{mybox}{Introduction}
\begin{tcbraster}[raster columns=2]

\begin{ghostbox}

\begin{itemize}
    \item For the principle of competitive-exclusion...
    \item Plankton ...
     \item Biophysical models have been recently...
    \item Spatial heterogeneity...
\end{itemize}
\end{ghostbox}

\begin{mybox}{Significance: Modelling Plankton Biodiversity}
\begin{figure}
    \includegraphics[width=\hsize]{significance.pdf}
\end{figure}
\end{mybox}
\end{tcbraster}

\begin{mybox}{Research Questions:}
   \begin{itemize}
    \item \textbf{How can microbial coexistence emerge in a resource-limited ecosystem ?}
    \item \textbf{Can spatial heterogeneity in the plankton structure account for emergence of coexistence ?}
    \end{itemize}
\end{mybox}

\end{mybox}


\begin{mybox}{Methods}

\begin{itemize}
    \item Investigate a biophysical model and implement a computer simulation in MATLAB.
    \item  Assume ...
\end{itemize}

\begin{tcbraster}[raster column skip=0.1\columnwidth]
\begin{mybox}{Cells}

 \begin{itemize}
   \item Every species occupies point in the space of resource consumption
\end{itemize}   

\begin{figure}
    \includegraphics[width=\hsize]{respace.pdf}
\end{figure}

\begin{itemize}
     \item Every species, $\sigma$ ...
     \item To account for trade-offs...
     \item Monod function: $r_i(c_i) = \frac{c_i}{k_i + c_i}$
\end{itemize}
\end{mybox}

\begin{mybox}{Demes}
   \begin{figure}
        \includegraphics[width=\hsize]{demes.pdf}
    \end{figure}

  \begin{itemize}
    \item The ecosystem...
    \item Nutrients...
    \item Nutrients...
    \end{itemize}

\end{mybox}
\end{tcbraster}
\end{mybox}
\end{frame}
\end{document}

the boxes "cells" and "demes" are not side by side. I manage to place them side by side for the "introduction" and "significance" plots but not the cells and demes.

4
  • 1
    Currently, your code does not reproduce the output you show. In order to make it compile, I had to replace the pdf files by example-image and the undefinded colors by others. Could you please also clarify on the desired vertical alignment (top, centered...) of the two side by side boxes? In order to place the two boxes side by side, try removing the empty line between the boxes. – leandriis Apr 22 '19 at 7:59
  • yeah sorry I cut down some code as it was too messy. Anyways I removed the empty lines between the boxes and it worked. Amazing thank you so much ! – Alberto Scarampi Apr 22 '19 at 8:10
  • 4
    I'm voting to close this question as off-topic because the OP has solved the issue himself – user156344 Apr 22 '19 at 9:25
  • Related: tex.stackexchange.com/q/114520/9057 – Schweinebacke Apr 22 '19 at 11:42
3

Your problem of two side by side tcolorboxes can be reduced to the following MWE. The first frame contains the reduced MWE. In the second frame, I have removed the blank line between the two boxes. If you want the boxes to be top aligned instead of vertically centere, you can add the raster valign=top option as shown in the third frame:

\documentclass{beamer}
\usepackage[size=a2,orientation=portrait,scale=1.3]{beamerposter}
\setbeamersize{text margin left=5mm,text margin right=5mm} 
\usepackage[skins,most]{tcolorbox}
\tcbuselibrary{skins,raster}
\newtcolorbox{mybox}[1]{colback=white,colframe=orange, coltext=blue, arc=3mm, title=#1}
\usepackage{lipsum}

\begin{document}

\begin{frame}[fragile=singleslide,t]\centering
\begin{tcbraster}[raster column skip=0.1\columnwidth]
\begin{mybox}{Cells}
\lipsum[1]
\end{mybox}

\begin{mybox}{Demes}
 \lipsum[4]
\end{mybox}
\end{tcbraster}
\end{frame}

\begin{frame}[fragile=singleslide,t]\centering
\begin{tcbraster}[raster column skip=0.1\columnwidth]
\begin{mybox}{Cells}
\lipsum[1]
\end{mybox}
%
\begin{mybox}{Demes}
 \lipsum[4]
\end{mybox}
\end{tcbraster}
\end{frame}

\begin{frame}[fragile=singleslide,t]\centering
\begin{tcbraster}[raster column skip=0.1\columnwidth,raster valign=top]
\begin{mybox}{Cells}
\lipsum[1]
\end{mybox}
%
\begin{mybox}{Demes}
 \lipsum[4]
\end{mybox}
\end{tcbraster}
\end{frame}
\end{document}

Unrelated to the alignment issue: but I have removed the enumitem package as it is not compatible with the beamer documentclass.

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