I was trying to use a tikzpicture using a robust custom command in a section title as is it described here. I'm not getting error when using the robust command but my custom symbols definition is printed after the correct symbol and section title. In a normal text everything works perfectly fine, tough. The command for the picture I got from here.
\definecolor{folderbg}{RGB}{124,166,198}
\definecolor{folderborder}{RGB}{110,144,169}
\newlength\Size
\setlength\Size{4pt}
\DeclareRobustCommand\customFile{
\begin{tikzpicture}[#1]{
\filldraw [draw=folderborder, top color=folderbg!5, bottom color=folderbg!10] (-\Size,.4*\Size+5pt) coordinate (a) |- (\Size,-1.2*\Size) coordinate (b) -- ++(0,1.6*\Size) coordinate (c) -- ++(-5pt,5pt) coordinate (d) -- cycle (d) |- (c) ;
}
\end{tikzpicture}
}
When I use the custom command in a section the definition of the folder symbol is printed after the section:
\subsubsection{\customFolder{} bubbleInterTrackFoam}
Any suggestions what may this problem? Thanks in advance!


\documentclass{...}, the required\usepackage's,\begin{document}, and\end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – dexteritas Jan 16 '20 at 12:48