# Typesetting a double Over Dot on top of a symbol

I wanted to make a notation with a double dot over a symbol in Mathematica. Searching online or in the documentation did not yield any results. However, just randomly attempting to give a second parameter to the OverDot function surprisingly did exactly what I needed:

I assume the red font suggests that Mathematica perceives this as a syntax mistake at some level, even though the output is as desired. Unfortunately, this does not work for three dots and more.

Is there a proper way to do this without red font appearing?

• {Overscript[x, ".."], Overscript[x, "..."], Overscript[x, "\[Ellipsis]"]} – Bob Hanlon Apr 9 at 1:35
• The code editor and documentation are not always completely in sync with the actual typesetting. This is only one of several examples. Ignore the code coloring. – m_goldberg Apr 9 at 2:35
• @BobHanlon as a German speaker I perceive your Overscript[x, ".."] Umlaut to be very improperly typeset. Overscript[x, "¨"] is bad as well. They work, yes; but not for publication. Cheers! – Roman Apr 9 at 9:43
• @Roman Why not just literally use the German character set for that? The double dot over a symbol has e.g. the meaning of a second time derivative in Physics -- which is typeset properly. – Kagaratsch Apr 9 at 12:37
• For Umlaut characters you only get äëïöüÿ from the font set but not the others. That wasn't my point though. All I'm saying is that the size of the dots and their distance must be appropriate for the chosen font, otherwise it looks very bad for a native speaker of German, Turkish, Swedish, French, etc. If you don't care about the aesthetics, then all the given solutions work, sure. – Roman Apr 9 at 13:46

Use ToBoxes to find the boxes generated for OverDot[x, 2]:

OverDot[x,2] //ToBoxes


OverscriptBox["x", "¨"]

You can reproduce these boxes using Overscript:

Overscript[x, RawBoxes @ "¨"]


You can use the same approach for triple dots:

Overscript[x, RawBoxes @ "\[TripleDot]"]


For more dots, you will have to use a different mechanism to generate the dots, e.g.:

Overscript[x, Style[Row[{".",".",".","."}],FontTracking->"Condensed"]]


Update

You could also overload OverDot to work with the 3 and higher versions (I also included @Michael's syntax information fix):

SyntaxInformation[OverDot] = {"ArgumentsPattern" -> {_, _.}};
MakeBoxes[OverDot[a_, n_Integer?(GreaterThan[2])], StandardForm] := If[n==3,
OverscriptBox[MakeBoxes[a], "\[TripleDot]"],
OverscriptBox[
MakeBoxes[a],
ToBoxes @ Style[Row[ConstantArray[".", n]], FontTracking->"Condensed"]
]
]


Then:

You could fix the syntax highlighting, or ignore it. Here's a fix:

SyntaxInformation[OverDot] = {"ArgumentsPattern" -> {_, _.}};


Go to the Basic math assistant palette and click on the template.

• There indeed is a [DoubleDot] template, but it actually leads to an expression with the FullForm OverDot[X,2]! So the syntax is in fact intended, then I'm confused why Mathematica marks it in red font when typed in directly? – Kagaratsch Apr 9 at 1:13
• Yes... confusing. The documentation for OverDot shows only one argument... so the $2$ is somehow treated extraneously. (Perhaps a bug report is in order.) – David G. Stork Apr 9 at 1:21