[Tex/LaTex] Diereses (German Umlauts) in math

germanmath-modeunicodexetex

Is it possible to enter Umlauts directly in math?
I would like to do something like the following (using XeLaTex):

\documentclass{article}
\usepackage{amsmath}
\usepackage[silent,no-math]{fontspec}

\usepackage{unicode-math}
\setmathfont[math-style=TeX]{XITS Math}


\begin{document}

\begin{align*}
äöüÄÜÖ
\end{align*}

\end{document}

I know that I can also use \ddot{a}, but I would like my source file to be easily readable; and besides, things like \ddot{a}_j^i give bad positioning of the dots.

Any help would be appreciated.

Clarification: In my case, e.g. ü is not the second derivative of u, but rather it is a symbol representing Überschüsse (german for: surplus / excess). In the context of the document, confusion with the second derivative is unlikely.

Best Answer

There is no accented character in the "math" part of Unicode, because diacritics can be confused with math specific ornaments, such as the dot/dots for denoting derivatives.

According to a well established tradition, an ê in a formula is read as e hat even if the document is in Portuguese and usually it is interpreted as "some functional transformation on the variable e" (such a functional transformation would have previously been defined).

Therefore I don't find it a good idea to use ü for denoting a variable by itself. I'd use u and, if u is already used with another meaning, I would not adopt ü for the other one, in order to avoid any ambiguity.

This said, if you really want to use ü as a variable, you can try

\usepackage{newunicodechar}
\newunicodechar{ü}{\ifmmode\textit{ü}\else ü\fi} % version with \textit
%\newunicodechar{ü}{\ifmmode\ddot{u}\else ü\fi} % version with \ddot

and $ü=12$ will result in an italic "ü" and "Flügel" in text would print correctly as well.

Choose between the two versions according to which one renders better. But you've been warned. :)