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 want to combine Helvetica and Symbol fonts so that Helvetica handles the Latin letters, while Symbol handles the Greek letters. Mathspec and XeLaTeX does a reasonably good job of this, but I cannot get the parentheses and the percentage symbol (and possible other things) to look right. For example, the following code

\documentclass[10pt]{article}
\usepackage{mathspec}
\setmainfont{Helvetica}
\setmathsfont(Digits,Latin,Greek)[Uppercase=Italic,Lowercase=Italic]{Helvetica}
\begin{document}
\Huge This looks right: $L_e$ (\%)

\Huge This looks wrong: $L_e\,(\%)$ 
\end{document}

produces the following document:

enter image description here

(In order to keep things simple, I omitted the \setmathsfont(Greek){Symbol} command, since the problem shows up without it.) How do I make XeLaTeX use Helvetica for the the parentheses and the percentage symbol when I am in math mode?

share|improve this question
    
Welcome to TeX.SX! –  karlkoeller Dec 28 '13 at 11:42
    
mathspec has known problems with those kind of symbols. You might have a look at the mathastext package. –  karlkoeller Dec 28 '13 at 11:51
    
Why do you want to emulate the bad printing of a bad word processor? –  egreg Dec 28 '13 at 12:05
    
@karlhoeller Thank you for the suggestion. I tried combining the mathastext package with the mathspec package (to use the symbol font with greek letters), but I could not get them to play nice together. In the end, I just want a font that looks like Helvetica for the latin letters and looks like the symbol font for the greek letters. I just tried URW Nimbus Sans and TEX Gyre Heros, which look good for the latin letters, but the greek letters are ugly IMHO. –  Stretch Dec 28 '13 at 17:55
    
Last resort (very bad one): add the following lines: \usepackage{unicode-math} \setmathfont{Helvetica} in the preamble –  karlkoeller Dec 29 '13 at 7:56

2 Answers 2

load fontspec without math:

\documentclass[10pt]{article}
\usepackage[no-math]{fontspec}
\setmainfont{Helvetica}
\usepackage{mathastext}
%\setmathsfont(Digits,Latin,Greek)[Uppercase=Italic,Lowercase=Italic]{Helvetica}
\begin{document}
\Huge This looks right: $L_e$ (\%)

\Huge This looks wrong: $L_e\,(\%)$ 
\end{document}

enter image description here

share|improve this answer
    
Thanks for your suggestion. I almost accepted it as the best answer, but you may recall that I also require mathspec. Mathspec allows me to use the Symbol font for greek letters in math mode. One can combine mathspec and fontspec together, but it turns out you only need mathspec. See my answer below. –  Stretch Jan 1 at 18:00
up vote 0 down vote accepted

Through the help of karlkoeller and Herbert I came upon the following solution,

\documentclass[10pt]{article}
\usepackage{mathspec}
\setmathsfont(Digits,Latin)[Uppercase=Italic,Lowercase=Italic]{Helvetica}
\setmathsfont(Greek)[Uppercase=Regular,Lowercase=Italic]{Symbol}
\setmainfont{Helvetica}
\usepackage[italic]{mathastext}
\begin{document}
\Huge This looks right: $\delta_e/L_e$ (\%)

\Huge This looks wrong: $\delta_e/L_e\,(\%)$ 
\end{document}

which produces,

enter image description here

I am relatively certain I tried this back when karlkoeller suggested mathastext on Dec 28th, and I ran into a bunch of errors. In between Dec 28th and Jan 1st, I updated from TexLive 2012 to TexLive 2013, and now it appears to work. The mathspec package was not updated between 2012 and 2013, but the mathastext package was updated something like 15 times. Probably one of those updates fixed the errors I was running into.

In the interest of informing others, I thought I would also share an alternate solution that I think I like better. The XeLaTeX package is nice, but it takes nearly 3 times as long to typeset a short document like the one above. Also I am not sure the Symbol and Helvetica fonts will work so well when typesetting complicated mathematica formulae. Instead I have settled on the newtx package, which has full math support and a Helvetica clone for its sans-serif font. The following code

\documentclass[10pt]{article}
\usepackage{newtxtext}
\renewcommand*\familydefault{\sfdefault}
\usepackage[italic]{mathastext}
\usepackage{newtxmath}
\begin{document}
\Huge This looks right: $\delta_e/L_e$ (\%)

\Huge This looks wrong: $\delta_e/L_e\,(\%)$ 
\end{document}

produces, enter image description here

The \delta is different in newtx, but the overall style is similar and I was not married to the Symbol font. I just did not want the computer modern (CM) fonts. (IMHO the CM fonts line weights are too light.) Unfortunately, close inspection reveals that the newtx parentheses are a bit different in math mode versus text mode, but I can handle that.

share|improve this answer
    
it looks to me that the position of the subscript on \delta_e is too far to the right. since it's not being put in the proper place automatically, you'll need to put in some negative kern yourself. –  barbara beeton Jan 1 at 19:51

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.