# Horizontal alignment of math accents for slanted symbols

I want a double widehat accent. Here's my setup: xelatex, accents package, and a definition of dwtilde command (as a reference to dhatheight shows, the code is a modification of someone else's code found on the Web):

\newcommand{\dwtilde}[1]{%<br>
\settoheight{\dhatheight}{\ensuremath{\widetilde{#1}}}%<br>
\widetilde{\vphantom{\rule{1pt}{\dhatheight}}%<br>
\smash{\widetilde{#1}}}}


I'm using euscript for Euler fonts. Then, a $\dwtilde{\mathscr A}$ produces two wide tildes with the top one shifted to the left. How do I put the accents aligned horizontally?

Here's an example:

Run it with xelatex

\documentclass{article}
\usepackage{unicode-math}
\usepackage{libertine}
\def\dWDTilde#1{\widetilde{\widetilde{#1\mkern0mu}}}
%\setmathfont{XITS Math}

\begin{document}
foo
$\dWDTilde{\mathscr A}$
foo

\end{document}


• the two accents are aligned with one another, but unfortunately, they're visually too far to the left. that symbol looks like something that should appear on the funnel of a steamship. – barbara beeton Sep 30 '14 at 12:38
• I don't want to change the fonts (Computer Modern Concrete Postscript fonts with cyrillics + Euler math fonts). I use fontspec to redefine main fonts. – Andrei Zorine Sep 30 '14 at 13:33