How can I get a left arrow as a math accent to go over single symbols and groups of symbols, in such a way that:
- the left arrows over a single character and multiple characters have the same heaviness; and
- the left arrow over a single character is not overly long?
Here is what I've tried so far:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{newtxtext,newtxmath}
\usepackage{accents}
\usepackage{extarrows}
\linespread{1.1} % just to display output here more clearly
\newcommand{\reverse}[1]{\accentset{\leftarrow}{#1}}
\newcommand{\xreverse}[1]{\accentset{\xlongleftarrow{}}{#1}}
\newcommand{\longreverse}[1]{\overleftarrow{#1}}
\begin{document}
Accent single character with left arrow:
\smallskip
$\reverse{\sigma}$ \quad Arrow too short, too light, too small?
$\longreverse{\sigma}$ \quad Arrow too long and heavy!
\medskip
Accent multiple characters with left arrow:
\smallskip
$\xreverse{\sigma \ast \tau}$ \quad Use \verb!\xreverse!: arrow definitely too short.
$\longreverse{\sigma \ast \tau}$ \quad Use \verb!\longreverse!: arrow long enough, but perhaps too heavy?
\bigskip
Want to use better arrows in the alternative to \dots
\[(\sigma \ast \tau)^{\leftarrow} \simeq \reverse{\tau} \ast \reverse{\sigma}
\]
\dots that instead puts the long left arrow over the whole group of 3 symbols:
\begin{itemize}
\item $\longreverse{\sigma \ast \tau} \simeq \reverse{\tau} \ast \reverse{\sigma}$ \quad Use \verb!\longreverse! on left, \verb!\reverse! on right.
\item $\longreverse{\sigma \ast \tau} \simeq \longreverse{\tau} \ast \longreverse{\sigma}$ \quad Use \verb!\longreverse! for all.
\end{itemize}
\end{document}
I'd strongly prefer a method that avoids using TikZ or other drawing methods. And I need a method that will be relatively robust when a different font family (e.g., lucidabr
, mathtimepro2
) is used insstead of newtx
. also when unicode-math
is used along with a math font requiring xelatex
.
I am aware of Configurable and Extensible Accents (Arrows, Dots, Vectors) and the item Dashed left arrow over symbol that is referenced by the accepted answer to it.
Addendum: using halloween
command \overscriptleftarrow
Following the comment by @GuM, I tried the \overscriptleftarrow
command from the halloween
package. This does seem to work with all the font families I've tried, no matter whether I'm using pdflatex
or, together with unicode-math
, xelatex
. For example:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{fontspec}
%\setmainfont[Ligatures=TeX]{TeX Gyre Termes}
%\setmainfont[Ligatures=TeX,SmallCapsFont={Latin Modern Roman Caps}]{Latin Modern Roman}
\usepackage{unicode-math}
\setmathfont[Ligatures=TeX]{TeX Gyre Termes Math}
%\setmathfont[Ligatures=TeX]{Latin Modern Math}
\usepackage{halloweenmath}
\newcommand{\reverse}[1]{\overscriptleftarrow{#1}}
\begin{document}
$\reverse{\sigma \ast \tau} \eqsim \reverse{\tau} \ast \reverse{\sigma}$
\end{document}
Output:
\overscriptleftarrow
from thehalloweenmath
package?halloweenmath
coexist happily withunicode-math
and such math fonts as TeX Gyre Termes Math and Latin Modern Math?halloweenmath
does seem to work with every document text & math font I trow at it. I do hate to load in another package with so many definitions -- for "scary" symbols (witches, ghosts, broomsticks, etc.) drawn withpict2e
-- irrelevant to ordinary math usage.