You can use the sidebyside align
key (possible values are top
, bottom
and, the default, center
):
\documentclass[]{article}
\usepackage[skins,listings,breakable,listingsutf8,theorems,hooks,fitting]{tcolorbox}%
\begin{document}
\begin{tcolorbox}[adjusted title= First Outer Box,sidebyside,sidebyside align=top]
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
\tcblower
Variable vertical space
\begin{tcolorbox}[adjusted title=First Box Right Side]
Inside 1st box
First Outer Box
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=Second Box Right Side]
Inside 2nd box
First Outer Box
\end{tcolorbox}
\end{tcolorbox} % first outer box
\begin{tcolorbox}[adjusted title= Second Outer Box,sidebyside,sidebyside align=top]
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
Left side of Outer Box\\
\tcblower
Variable vertical space.
\begin{tcolorbox}[adjusted title=First Box Right Side]
Inside 1st box
Second Outer Box
\end{tcolorbox}
\begin{tcolorbox}[adjusted title=Second Box Right Side]
Inside 2nd box
Second Outer Box
\end{tcolorbox}
\end{tcolorbox} % first outer box
\end{document}
![enter image description here](https://i.stack.imgur.com/t33S8.png)
You can adjust lefthand width=1.5em,
and use sidebyside gap=2pt,
to get
![enter image description here](https://i.stack.imgur.com/bzHGA.png)
I don't think I understand the bonus question properly. It means probably this:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
%\tcbuselibrary{skins}
\newtcolorbox{EmR}{%
sidebyside,sidebyside align=top,lower separated=true,lefthand width=1.8em,
arc=8pt,
boxsep=0pt,
left=8pt,right=2pt,top=2pt,bottom=2pt,
fontupper=\Large\bfseries\rmfamily,
fontlower=\small,
after=\smallskip,
skin=bicolor,
colback=black!60, colframe=black!60,
colupper=white,
colbacklower=white,boxrule=0.5pt,
sidebyside gap=2pt,
}
\begin{document}
\begin{EmR}
\raisebox{-1ex}{R}
\tcblower
\lipsum[1]
\end{EmR}
\end{document}
![enter image description here](https://i.stack.imgur.com/ZMpRU.png)
If the upper part has only one letter like R
, then the following is also possible:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
%\tcbuselibrary{skins}
\newtcolorbox{EmR}[1][]{%
arc=8pt,
boxsep=0pt,
left=3em,,right=2pt,top=2pt,bottom=2pt,
fontupper=\small,
after=\smallskip,
skin=bicolor,
colback=white,colframe=black!60,
boxrule=0.5pt,
overlay={\begin{tcbclipinterior}
\draw[black!60,line width=6em-4pt] (interior.north west)--(interior.south west);
\node[font=\Large\bfseries\rmfamily, text=white, anchor=north west, inner ysep=5pt, minimum width=3em]
at (frame.north west) {#1};
\end{tcbclipinterior}
}
}
\begin{document}
\begin{EmR}[R]
\lipsum[1]
\end{EmR}
\end{document}
![enter image description here](https://i.stack.imgur.com/EpxJk.png)
Adjust left=3em,
, line width=6em-4pt
(6em=2 times the left margin and 4pt = 2 times the right margin), inner ysep=5pt, minimum width=3em
(minimum width
=left
).
Best Answer
side by side
alignment options includetop seam
which do what you want as it's shown in following first example.Your example shows nested tcolorboxes. This means that the boxes are not breakable. If this is your intention, I've nothing to say. But, in any case, I propose a similar format, without the external box, which allows breakable boxes and an automatic counter for the boxes.