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.

I am using

\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Ubuntu}

to change the "text" font in my latex document. However this has messed up some math equations and things like

\mathbf{E} \exp \sin \cos

are also displayed using the font for the text which makes it look ugly and inconsistent with the rest of equation.

Is there a way to fix this so that the above specified font is only used for text and not anywhere in the equations?

share|improve this question
add comment

2 Answers

up vote 12 down vote accepted

\usepackage[no-math]{fontspec} instead of xltxtra (assuming that you have a recent fontspec).

share|improve this answer
    
I have to use xltxtra since Ubuntu is a ttf font –  behzad.nouri Jul 4 '11 at 14:46
    
@user6530 xltxtra loads fontspec, and unless you need some of the specific functions it offers, (mainly the XeTeX logos) it is no longer needed. fontspec is the main package for using fonts of any sort with XeLaTeX. –  Alan Munn Jul 4 '11 at 14:56
    
@user6530: Why do you reject my suggestion without trying it? –  Ulrike Fischer Jul 4 '11 at 15:02
1  
Well I wrote \usepackage[no-math]{fontspec} not \usepackage[no-math]{Ubunut}. Beside this: fontspec has a documentation. –  Ulrike Fischer Jul 4 '11 at 15:12
6  
If you are not willing to search and peruse a documentation of a package: Don't use latex. It is not the right system for you. –  Ulrike Fischer Jul 4 '11 at 16:07
show 1 more comment

You could also try to load the mathspec package before xltxtra (or fontspec)

\usepackage{mathspec}
\usepackage{xltxltra}

Optionally, you can define then a specific math font.

share|improve this answer
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.