I want to create 2 boxes side by side (image below) in order to have the red box on the right of the blue one :
I wrote this code but I don't know how to do it (I am just specifying the width to fit in the general page):
\documentclass{article}
\usepackage{pgf, tikz, adjustbox}
\usepackage{tcolorbox}
\begin{document}
\tcbset{colback=blue!5!white,colframe=blue!75!black,fonttitle=\bfseries, width = 12cm}
\begin{tcolorbox}[before=\adjustbox{valign=t}\bgroup, after=\egroup]
\textbf{Démonstration}
\end{tcolorbox}
\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, width = 5cm}
\begin{tcolorbox}[before=\adjustbox{valign=t}\bgroup, after=\egroup]
\gap
A écrire
\end{tcolorbox}
\end{document}
Any help would be appreciated ! Thank you very much.
Best Answer
I found the option
box align
in the package documentation on page 86 in the PDF. You can set this totop
,bottom
andcenter
. Here is an example usingcenter
:This produces the output: