# Dotted x in mathmode

I want a dot over my variable x inside Gödel-codes, and used the following code $\exists x\mathcal{T}\Godelnum{A(\dot{x)}}$, with this in the preamble to have nice corner quotes:

\newbox\gnBoxA
\newdimen\gnCornerHgt
\setbox\gnBoxA=\hbox{$\ulcorner$}
\global\gnCornerHgt=\ht\gnBoxA
\newdimen\gnArgHgt
\def\Godelnum #1{%
\setbox\gnBoxA=\hbox{$#1$}%
\gnArgHgt=\ht\gnBoxA%
\ifnum     \gnArgHgt<\gnCornerHgt \gnArgHgt=0pt%
\fi \raise\gnArgHgt\hbox{$\ulcorner$} \box\gnBoxA %
\raise\gnArgHgt\hbox{$\urcorner$}}


But the dot is too high up to the right. How can I obtain a normal dot above the variable x?

• Did you try a simple \dot{x}? Jun 18, 2022 at 9:05
• As Bernard writes, type A(\dot{x}) instead of A(\dot{x)}. Jun 18, 2022 at 9:20
• @Bernard I need the Gödel codes Jun 18, 2022 at 13:52
• @Sapiens. When I type $\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. Jun 18, 2022 at 14:23
• @Sapiens I don't understand how that's relevant. You can use the code you posted above. The problem with the dot over the x is completely unrelated to the code for the Gödel numbering, and is just the result of a silly typo, but for some reason you aren't reading the comments properly. See hair-splitter's comment and read it carefully. Jun 18, 2022 at 16:53

\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}{%
\settoheight{\gnCornerHgt}{$\ulcorner$}%
\settoheight{\gnArgHgt}{$#1$}%
\ifdim\gnArgHgt<\gnCornerHgt
\setlength{\gnArgHgt}{0pt}%
\else
\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}{\mathinner{\mathpalette\Godelnum@{#1}}}
\newcommand{\Godelnum@}{%
\begingroup
\settoheight{\gnCornerHgt}{$\m@th#1\ulcorner$}%
\settoheight{\gnArgHgt}{$\m@th#1#2$}%
\ifdim\gnArgHgt<\gnCornerHgt
\setlength{\gnArgHgt}{0pt}%
\else
\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} 