As already commented, you have
\Godelnum{A(\dot{x)}}
so the dot is placed above the combination x)
, hence it is higher and centered with respect to both items.
You should fix into
\Godelnum{A(\dot{x})}
The top one is your input, the bottom one is the fixed one.
However, your code is not really LaTeX savvy and you can dispense with setting boxes, by using proper LaTeX code (your code also has a couple of mistakes).
\documentclass{article}
\usepackage{amsmath,amssymb}
\newlength{\gnCornerHgt}
\newlength{\gnArgHgt}
\newcommand{\Godelnum}[1]{%
\settoheight{\gnCornerHgt}{$\ulcorner$}%
\settoheight{\gnArgHgt}{$#1$}%
\ifdim\gnArgHgt<\gnCornerHgt
\setlength{\gnArgHgt}{0pt}%
\else
\addtolength{\gnArgHgt}{-\gnCornerHgt}%
\fi
\raisebox{\gnArgHgt}{$\ulcorner$}%
#1%
\raisebox\gnArgHgt{$\urcorner$}%
}
\begin{document}
$x\mathcal{T}\Godelnum{A(\dot{x)}}$
$x\mathcal{T}\Godelnum{A(\dot{x})}$
$x\mathcal{T}\Godelnum{\begin{bmatrix} 1 \\ 1 \end{bmatrix}}$
\end{document}
The length \gnCornerHgt
should be set at run time, because it must depend on the current font size.
The \ifnum
is really wrong as well as the %
after 0pt
. In this case TeX has a protection mechanism, but you end up with an unwanted token (precisely a “frozen” \relax
).
I know that \Godelnum
of a matrix doesn't really make sense, I used it to show that the height is the desired one.
A version that also change sizes in subscripts or superscripts. I add a \LARGE
version to show that it works in different font sizes as well.
Note the addition of \mathinner
that adds a thin space.
\documentclass{article}
\usepackage{amsmath,amssymb}
\newlength{\gnCornerHgt}
\newlength{\gnArgHgt}
\makeatletter
\newcommand{\Godelnum}[1]{\mathinner{\mathpalette\Godelnum@{#1}}}
\newcommand{\Godelnum@}[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}
$x\mathcal{T}\Godelnum{A(\dot{x})}$
$x_{\Godelnum{y}}$
\LARGE
$x\mathcal{T}\Godelnum{A(\dot{x})}$
\end{document}
\dot{x}
?A(\dot{x})
instead ofA(\dot{x)}
.$\exists x \mathcal{T}\Godelnum{A(\dot{x})}$
the dotted x looks exactly the same as with$\exists x \mathcal{T} A(\dot{x})$
. Either the problem is the one hair-splitter points out, that you're including the')
inside the\dot{..}
or there is some other setting affecting your document we don't know about.