0

I'm frequently using tcolorbox, now with raster. I'm quite happy with the momentary result:

\documentclass{standalone}

\usepackage[most]{tcolorbox}
\usepackage[outline]{contour}

\begin{document}

\begin{tcolorbox}[enhanced,colback=gray!15,colframe=black!50, boxrule = 1pt, titlerule=1mm, 
colbacktitle=blue!15, coltitle=black!75, center title, title =  \contour{blue!30}{Main Title}] 

\begin{tcbraster}[raster columns=2, sharp corners, raster equal height,
             raster column skip= 0.5mm, nobeforeafter]
\begin{tcolorbox}[colback=blue!30, title = Sub Title , width=0.3\textwidth]
Column1 
\end{tcolorbox}
\begin{tcolorbox}[height fill]
Column 2
\end{tcolorbox}
\end{tcbraster}
\end{tcolorbox}

\end{document}

(the code has to be compiled twice)

The other thing being ignored is the width-command on the submitted box. After skimming the manual I also was not lucky to find an option to do that. Any alternatives?

0

1 Answer 1

1

To decrease the width of both columns use raster width=0.6\textwidth.

To change the width of one column use more columns (3 in this example), and expand the second tcolorbox to occupy two columns using raster multicolumn=2.

(or any combinations of number of columns and raster multicolumn)

a

\documentclass{article}

\usepackage[most]{tcolorbox}
\usepackage[outline]{contour}

\begin{document}    

\begin{tcolorbox}[enhanced,colback=gray!15,colframe=black!50, boxrule = 1pt, titlerule=1mm, 
    colbacktitle=blue!15, coltitle=black!75, center title, title =  \contour{blue!30}{Main Title}] 

    % two columns, same width
    \begin{tcbraster}[raster columns=2, sharp corners, raster equal height,
        raster column skip= 0.5mm, nobeforeafter, raster width=0.6\textwidth]
        \begin{tcolorbox}[colback=blue!30, title = Sub Title ]
            Column1 
        \end{tcolorbox}
        \begin{tcolorbox}[height fill]
            Column 2
        \end{tcolorbox}
    \end{tcbraster}
\end{tcolorbox}
    
\begin{tcolorbox}[enhanced,colback=gray!15,colframe=black!50, boxrule = 1pt, titlerule=1mm, 
    colbacktitle=blue!15, coltitle=black!75, center title, title =  \contour{blue!30}{Main Title}] 

    % two columns column 1 = 1/3 column 2= 2/3
    \begin{tcbraster}[raster columns=3, sharp corners, raster equal height,
        raster column skip= 0.5mm, nobeforeafter]
        \begin{tcolorbox}[colback=blue!30, title = Sub Title ,]
            Column1 
        \end{tcolorbox}
        \begin{tcolorbox}[height fill, raster multicolumn=2]
            Column 2
        \end{tcolorbox}
    \end{tcbraster}
\end{tcolorbox}

\end{document}

You must log in to answer this question.

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