In the first version of the answer to my question Gödel codes with rounded Cornes?, Sandy G offered the following solution:
\newcommand{\godel}[1]{{}\mathbin{\vcenter{\hbox{\tikz{
\node[inner ysep=-1pt, inner xsep=3pt](M){$#1\strut$};
\draw[rounded corners=.5mm]([xshift=-1mm]M.north east)--(M.north east)--++(0,-.1);
\draw[rounded corners=.5mm]([xshift=1mm]M.north west)--(M.north west)--++(0,-.1);
}}}}{}}
The solution is quite satisfactory for my document, except that many errors are produced, so that the document does not compile, if I put $\godel{A}$ in the title of a section. I tried two ways to protect it, via. $\protect\godel{A}\protect$ and $\protect\godel[thick]{A}$.
Are there other ways to protect $\godel{A}$ in section titles which may help me out?
\DeclareRobustCommand
instead of\newcommand
\subsection{.$\godel{a}$.}
or\subsection{.$\godel[thick]{a}$.}
(with the macro\godel
having been copied from the answer you reference) produces no errors on my system -- MacOS 13.2 "Ventura"; MacTeX2022; pdfTeX Version 3.141592653-2.6-1.40.24; LaTeX2e <2022-11-01> patch level 1; and L3 programming layer <2023-02-07>. Note that I don't find there's a need for\protect
.