Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

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}
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.