10

When a tcolorbox is inside the right side of a sidebyside tcolorbox, it is vertically centered. Using \vfill or align = top doesn't put the tcolorbox at the top of the right side. The space between the tcolorbox and the upper part of the right side is variable. Is there a way to put the tcolorbox at the right side top?

Tcolorboxes in the right side: centered.

\documentclass[]{article}

\usepackage[skins,listings,breakable,listingsutf8,theorems,hooks,fitting]{tcolorbox}%

\begin{document}

\begin{tcolorbox}[adjusted title= First Outer Box,sidebyside]
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]
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

1 Answer 1

10

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

6
  • 2
    Therefore, "sidebyside align=top" doesn't work alone has to be paired with "sidebyside". Thanks !
    – SDrolet
    May 12, 2014 at 19:37
  • Can we increase the left column width and decrease the right column width?
    – Say OL
    Oct 16, 2016 at 1:11
  • 1
    @SayOL: the outer box may specify the parameters lefthand width and righthand width which control the column width.
    – FK82
    Jan 19, 2017 at 10:35
  • @FK82 Thank for your suggestion! Actually, I posted a question a few weeks ago and an acceptable solution was already given :)
    – Say OL
    Jan 19, 2017 at 10:39
  • @SayOL Great! Just wanted to add this since your question was left unanswered and I came across the same problem.
    – FK82
    Jan 19, 2017 at 10:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .