Driven from Let's get fancy: Text like tag? , I wrote this code:
\documentclass{article}
\usepackage{tcolorbox}
\definecolor{mycolor}{rgb}{0.122, 0.435, 0.698}
\newtcbox{\mybox}{nobeforeafter,colframe=mycolor,colback=mycolor!10!white,boxrule=0.5pt,arc=4pt,
boxsep=-3pt,left=6pt,right=6pt,top=6pt,bottom=6pt,tcbox raise base}
\begin{document}
\mybox{C{}\verb!++!}
\end{document}
The error:
! Missing } inserted.
<inserted text>
}
l.9 \mybox{C{}\verb!++!}
This works with normal text inside the box, but because of the fancy way I am trying to write C++ and the fancy textbox, I am getting fancy² and I overflow! :) Any ideas?


tcbox– May 28 '16 at 14:45! LaTeX Error: \verb illegal in command argument.. – Torbjørn T. May 28 '16 at 14:47tcboxand still have a fancy C++ text? – gsamaras May 28 '16 at 14:47\tcboxverbis what you want – May 28 '16 at 14:47