0

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%
    \else \advance \gnArgHgt by -\gnCornerHgt%
    \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?

6
  • 1
    Did you try a simple \dot{x}?
    – Bernard
    Commented Jun 18, 2022 at 9:05
  • 1
    As Bernard writes, type A(\dot{x}) instead of A(\dot{x)}. Commented Jun 18, 2022 at 9:20
  • @Bernard I need the Gödel codes Commented Jun 18, 2022 at 13:52
  • 1
    @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.
    – frabjous
    Commented Jun 18, 2022 at 14:23
  • 1
    @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.
    – frabjous
    Commented Jun 18, 2022 at 16:53

1 Answer 1

2

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})}

enter image description here

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).

enter image description here

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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .