# How to cancel the effect by the option of raster style on nested tcbitemize enviroment

I construct a raster by tcbitemize enviroment in tcolorbox. I found that the option raster column 1/.style have a effect on nested tcbitemize as shown in the following example. You can see that the first column of the nested raster is colored with red which is not what I want. How to cancel this effect by lower layer on higher layer of tcolorbox raster?

\documentclass[12pt,a4paper]{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable,raster}

\begin{document}
\begin{tcbitemize}[raster equal height=rows,raster columns=4,raster column 1/.style={colback=red}]
\tcbitem 1\tcbitem 1\tcbitem 1\tcbitem 1
\tcbitem 1
\tcbitem \begin{tcbitemize}[raster columns=2]
\tcbitem 2\tcbitem 2
\end{tcbitemize}
\tcbitem 1\tcbitem 1
\end{tcbitemize}
\end{document}


• Do you want \begin{tcbitemize}[empty,raster columns=2]? This adds the empty skin.
– Ross
Sep 5 '17 at 2:28
• What do you want the nested environment to look like? Without the column 1 settings but with what?
– Ross
Sep 5 '17 at 5:42
• As you see, I just want the nested tcbitemize is not affected by its outer tcbitemize options. In my example, cells of the first column in the nested raster should not be colored with red.
– lyl
Sep 5 '17 at 5:50
• Using the breakable library in conjunction with nested boxes is rather useless.
– user31729
Sep 5 '17 at 6:54

The raster columns 1 etc. styles are sticky and persist for the nested boxes as well unless explicitly defined again in a lower layer. Unfortunately neither the reset nor the raster reset option removes those styles.

\colorlet{standardbackground}{yellow}
\tcbset{layerone/.style={raster every box/.style={colback={standardbackground}},raster equal height=rows,raster columns=4,raster column 1/.style={colback=red}}}
\tcbset{layertwo/.style={raster columns=2,raster column 1/.style={colback=standardbackground}}}


define the standard background colour (yellow just for demonstration here) and clear all boxes to this background first, then set the specific settings for the first layer with and the first column to colback=red and redefine the settings for raster column 1 to switch back to the standard background colour.

\documentclass[12pt,a4paper]{article}
\usepackage[most]{tcolorbox}

\colorlet{standardbackground}{yellow}

\tcbset{layerone/.style={raster every box/.style={colback={standardbackground}},raster equal height=rows,raster columns=4,raster column 1/.style={colback=red}}}
\tcbset{layertwo/.style={raster columns=2,raster column 1/.style={colback=standardbackground}}}

\begin{document}
\begin{tcbitemize}[layerone]
\tcbitem 1\tcbitem 1\tcbitem 1\tcbitem 1
\tcbitem 1
\tcbitem
\begin{tcbitemize}[layertwo]
\tcbitem 2\tcbitem 2
\end{tcbitemize}
\tcbitem 1\tcbitem 1
\end{tcbitemize}
\end{document}


• Why must \makeatother be used?
– lyl
Sep 5 '17 at 7:54
• @lyl: The \makeatother command is a relic of a trial of solution -- I just forgot to remove it.
– user31729
Sep 5 '17 at 9:41