Hi, thanks a lot for the notice! I haven't read the article yet, but after a quick look at box 6, I have two little comments (that's FYI and for fun, I'm not asking you to modify your article).
1. First, I feel guilty for having suggested using `\kvtcb@width` since it is a `tcolorbox` internal. The obvious way to make me feel less guilty is to encapsulate all uses of this internal so that it only appears in one place:
% Limit use of tcolorbox internals to this one place
\newcommand*{\my@tcbget}[1]{\csname kvtcb@#1\endcsname}
With this, you can use `\my@tcbget{width}` instead of `\kvtcb@width` and ditto for `\kvtcb@lefttitle` and `\kvtcb@righttitle`.
2. The second thing is just a different way of computing `\mytitlelen` in the `mywidth` style—using `expl3`, of course. :)
\ExplSyntaxOn
\cs_new_protected:Npn \my_set_width:Nnn #1#2#3
{
\hbox_set:Nn \l_tmpa_box {#3}
\dim_set:Nn #1
{
\dim_max:nn {#2}
{
\box_wd:N \l_tmpa_box + \my@tcbget{lefttitle} + \my@tcbget{righttitle}
}
}
}
\cs_new_eq:NN \my@setwidth \my_set_width:Nnn
\ExplSyntaxOff
\tcbset{
mywidth/.code={%
\my@setwidth{\mytitlelen}{\mymaxlen}{\bfseries\scriptsize #1}%
},
}
Here is the full example for box 6 (sorry, I recreated the indentation as I copy/pasted from the PDF which presumably wasn't a great idea; as a result, it doesn't necessarily match yours):
```
\documentclass[twocolumn]{article}
\usepackage[most]{tcolorbox}
\usetikzlibrary{tikzlings}
\usepackage{varwidth}
\newlength{\mytitlelen}
\newlength{\mymaxlen}
\setlength{\mymaxlen}{.9\linewidth}
\newlength{\iconwidth}
\setlength{\iconwidth}{9mm}
\makeatletter
% Limit use of tcolorbox internals to this one place
\newcommand*{\my@tcbget}[1]{\csname kvtcb@#1\endcsname}
\ExplSyntaxOn
\cs_new_protected:Npn \my_set_width:Nnn #1#2#3
{
\hbox_set:Nn \l_tmpa_box {#3}
\dim_set:Nn #1
{
\dim_max:nn {#2}
{
\box_wd:N \l_tmpa_box + \my@tcbget{lefttitle} + \my@tcbget{righttitle}
}
}
}
\cs_new_eq:NN \my@setwidth \my_set_width:Nnn
\ExplSyntaxOff
\tcbset{
commonoptions/.style={
enhanced,
fonttitle=\bfseries\scriptsize,
titlerule=0pt, boxrule=0pt, boxsep=0pt,
toptitle=6pt, bottomtitle=2pt,
opacityframe=0,
},
myenlarge/.style={
enlarge #1 by=\linewidth -
(\my@tcbget{width} + \iconwidth),
},
mywidth/.code={%
\my@setwidth{\mytitlelen}{\mymaxlen}{\bfseries\scriptsize #1}%
},
}
\makeatother
\NewTColorBox{receivedmsg}{s o m}{
commonoptions,
left skip=\iconwidth,
overlay={
\pic[scale=.3] at
([shift={(-6mm,-6mm)}]frame.north west)
{bear};
\path[fill=yellow!30] (frame.north) --
([xshift=-3mm]frame.north west) --
([yshift=-3mm]frame.north west) --
cycle;
},
coltitle=red, colbacktitle=yellow!30,
colback=yellow!30,
title={#3},
IfBooleanTF={#1}{%
mywidth={#3},
}{%
hbox, varwidth upper=.8\linewidth,
},
halign title=flush left,
halign=flush left,
IfValueT={#2}{#2}
}
\NewTColorBox{sentmsg}{s o m}{
commonoptions,
right skip=\iconwidth,
overlay={
\pic[scale=.3] at
([shift={(6mm,-6mm)}]frame.north east)
{elephant};
\path[fill=green!30] (frame.north) --
([xshift=3mm]frame.north east) --
([yshift=-3mm]frame.north east) --
cycle;
},
coltitle=blue, colbacktitle=green!30,
colback=green!30,
title={#3},
IfBooleanTF={#1}{%
mywidth={#3},
}{%
hbox, varwidth upper=.8\linewidth,
},
myenlarge=left,
halign title=flush right,
halign=flush right,
IfValueT={#2}{#2},
}
\begin{document}
\begin{receivedmsg}{Jerry}
I’m a man!
\end{receivedmsg}
\begin{sentmsg}{Osgood}
Well, nobody’s perfect!
\end{sentmsg}
\end{document}
```
This example doesn't require `etoolbox`, but presumably yours should have the `\usepackage` call? (Yes, it works as is, but “by luck” because some of the packages you explicitly load must itself load `etoolbox`...)