from this topic: Inspired beautiful box from Indesign.
Now, i want create page layout with differentboxes like attachment image.
Use tcbposter if possible or other solution.
Thanks
This boxes code:
\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage[most]{tcolorbox}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{MnSymbol,wasysym}
\usepackage{tikzsymbols}
\usepackage{caption}
\usepackage{adjustbox}
\input{insbox}
\makeatletter
\tcbset{
myhbox/.style 2 args={%
enhanced,
breakable,
colback=white,
colframe=blue!30!black,
attach boxed title to top left={yshift*=-\tcboxedtitleheight},
title={#2},
boxed title size=title,
boxed title style={%
sharp corners,
rounded corners=northwest,
colback=tcbcol@frame,
boxrule=0pt,
},
underlay boxed title={%
\path[fill=tcbcol@frame] (title.south west)--(title.south east)
to[out=0, in=180] ([xshift=5mm]title.east)--
(title.center-|frame.east)
[rounded corners=\kvtcb@arc] |-
(frame.north) -| cycle;
},
#1
},
myvbox/.style 2 args={%
enhanced,
colback=white,
colframe=blue!30!black,
left=8mm,
overlay={
\node[rotate=90, anchor=north west, inner sep=2mm, text=white] (title@aux) at (frame.south west) {#2};
\path[fill=tcbcol@frame] (title@aux.south west)--(title@aux.south east)
to[out=90, in=270] ([yshift=5mm]title@aux.east)--
(title@aux.center|-frame.north)
[rounded corners=\kvtcb@arc] -|
(frame.west) |- (title@aux.west)[sharp corners] -- cycle;
\node[rotate=90, inner sep=2mm, text=white] at (title@aux) {#2};
},
#1
},
}
\makeatother
\newtcolorbox{myhbox}[2][]{%
myhbox={#1}{#2}
}
\newtcolorbox{myvbox}[2][]{%
myvbox={#1}{#2}
}
\begin{document}
\begin{myhbox}[colframe=blue!80!black,height=3cm,width =7cm]{AAA}{
def
}
\end{myhbox}
\begin{myhbox}[colframe=blue!80!black,height=3cm,width =7cm]
{BBB }{
abc
}
\end{myhbox}
\begin{myvbox}[colframe=red!80!black,height=6cm,width =4cm,before=\adjustbox{valign=t}\bgroup,after=\egroup]{CCC}
{
abcdef
}%
\end{myvbox}
\begin{myvbox}[colframe=red!80!black,height=6cm,width =4cm,before=\adjustbox{valign=t}\bgroup,after=\egroup]{DDD}
{
abcdef
}%
\end{myvbox}
\begin{tcbposter}[
poster = {
% showframe,
columns = 2,
rows = 2,
height = .5\textheight,
width = .5\textwidth,
spacing=3mm},
boxes = {colback=red}
]
\begin{posterbox}{column=1, row=1}[colframe=red!80!black,height=6cm,width =4cm]{ABCD}
\end{posterbox}
\end{tcbposter}%
\end{document}
Best Answer
It seems that BVOT wants boxes with specific dimensions:
In this case it's easier to use
tcbposter
. Atcbposter
is an initial regular distribution of columns and rows over which place boxes with reference to columns, rows and other boxes.As desired boxes widths are not proportional, I've used a
tcbposter
with just two columns. Left box will be aligned to left and right boxes to the right. The middle box on first row will be placedxshifted
from the left border.Proposed dimensions don't allow space between columns, therefore I've reduced left box and first column right box get some separation between columns.
Note Previous code has been updated for compatibility with tcolorbox v4.20. If you're using previous versions, rename colors with form
tcbcol...
to older formtcbcol@...
.