The simplest way to produce Gödel codes is with $\ulcorner$
and $\urcorner$
, and we may write $\ulcorner p\urcorner$
to enclose the formula $p$
within codes.
Buss programmed a macro which gives a better appearance than Gödel codes in many contextst.
The macro Godeln{}, which egreg recently suggested, as an aside in an answer to a recent question (Dotted x in mathmode), is an improvement of Buss's improvements of \(\ulcorner \urcorner\)
.
My question is: May the corners of the egreg codes be rounded, e.g. with TikZ, to obtain codes which are discernibly different?
MWE
\documentclass[]{article}
\usepackage{amsmath, amssymb}
\newlength{\gnCornerHgt}
\newlength{\gnArgHgt}
\makeatletter
\newcommand{\Godeln}[1]{\mathinner{\mathpalette\Godeln@{#1}}}
\newcommand{\Godeln@}[2]{%
\begingroup
\settoheight{\gnCornerHgt}{$\m@th#1\ulcorner$}%
\settoheight{\gnArgHgt}{$\m@th#1#2$}%
\ifdim\gnArgHgt<\gnCornerHgt
\setlength{\gnArgHgt}{0pt}%
\else
\addtolength{\gnArgHgt}{-\gnCornerHgt}%
\fi
\raisebox{\gnArgHgt}{$\m@th#1\ulcorner$}%
#2%
\raisebox\gnArgHgt{$\m@th#1\urcorner$}%
\endgroup
}
\makeatother
\begin{document}
$\ulcorner 2^2\urcorner$ vs. $\Godeln{2^2}$
\end{document}
\ulcorner
and\urcorner
output. You cannot transform the path of a glyph, but you can use another glyph or you can create your own "rounded corner" glyphs using TikZ if this is what you want.