当 tcolorbox 位于并排 tcolorbox 的右侧时,它会垂直居中。使用\vfill
或align = top
不将 tcolorbox 放在右侧顶部。tcolorbox 和右侧上部之间的空间是可变的。有没有办法将 tcolorbox 放在右侧顶部?
右侧的Tcolorboxes:居中。
\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}
答案1
您可以使用sidebyside align
键(可能的值是top
,bottom
以及默认值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}