I'd like to define several option styles in one time, for example, cf1/.style args={#1}{#1},cf2/.style args={#1}{#1},cf3/.style args={#1}{#1},etc.
I tried like this:
\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable,raster}
\begin{document}
\newcounter{loopvariable}
\setcounter{loopvariable}{5}
\whiledo{\theloopvariable > 1}{%
\addtocounter{loopvariable}{-1}
\tcbset{cf\theloopvariable/.style args={#1}{%
raster column \theloopvariable/.style={#1}}}
}
%
\begin{tcbitemize}
[raster force size=false,raster columns=4,sharp corners,
boxrule=3pt,
raster width=\textwidth,
raster column skip=0pt,
raster row skip=0pt,
cf3={colback=green}]
\tcbitem some text
\tcbitem some text
\tcbitem some text
\tcbitem some text
\end{tcbitemize}
\end{document}
But the typeset is wrong(see the attached figure). So,could anyone tell me how to achieve the function I want?


style argshere? – cfr Aug 12 '17 at 13:04.style. There's no need forstyle argshere. You aren't defining a non-standard input format. – cfr Aug 12 '17 at 13:13tcolorboxis already loadingtikz. – cfr Aug 12 '17 at 13:13style argsdoes.my style/.style args={#1:#2 over #3}{...}defines a style with the syntaxmy style=<value>:<value> over <value>or whatever. It doesn't add to an existing list of options. Possibly you wantappend styleinstead. As for the code, all I can say is that it doesn't compile here and I don't believe that exactly that code compiles elsewhere either. But maybe I just have a deficient LaTeX format. – cfr Aug 12 '17 at 16:08