Problem with mathastext package

The following very simple code does not work here:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Droid Sans}
\usepackage[italic]{mathastext}

\begin{document}
\section{test}
test $\frac{1}{2}$
\end{document}


The problem seems to be with the mathastext package, when I load it I get the following error:

LaTeX Error: Command \mathdollar' already defined.


It happens with any font, it's not related to the use of Droid Sans.

What am I doing wrong?

-

You have to consult the documentation of mathastext:

When using mathastext with either XeTeX or LuaLaTeX it is recommended to use the fontspec package. Else, some of the encoding dependent things done by mathastext like using the en-dash character to get a minus sign in math mode will not work correctly. Furthermore, it is necessary to load fontspec with its no-math option, and this must happen before loading mathastext.

\documentclass{article}
\usepackage[no-math]{fontspec}
%\setmainfont{Droid Sans}
\usepackage[italic]{mathastext}

\begin{document}
\section{test}
test $\frac{1}{2}$
\end{document}

-
you're right, I will contact the author of the package, thanks –  JackO Feb 1 at 10:17
@JackO in the code you can un-comment the \setmainfont{Droid Sans}` line in order to check that "mathastextification" now works (it does on my system). –  jfbu Feb 1 at 12:06