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.

How can I write equations in Trebuchet MS? Ideally, I'd like to have the following results:

  • All symbols that are available in Trebuchet MS are written in Trebuchet MS. That includes, e.g., Latin and Greek letters and basic math symbols such as plus, minus, parentheses, commas, etc.

  • Symbols that are not available in Trebuchet MS are taken from a font that looks sufficiently good when mixed with Trebuchet MS.

I'd like to use LaTeXiT to typeset equations that I would use in presentation slides that use the Trebuchet MS. I have tried several solutions, but none of them are completely satisfactory.

Solution 1: I tried xelatex and the following preamble:

\usepackage{mathspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setallmainfonts{Trebuchet MS}

Latin and Greek letters look exactly as I'd like them to look. However, all symbols look completely out of place.

Solution 2: Next I tried to use some kind of "close replacement":

\usepackage{arevmath}

At least all math symbols are now in a sans-serif font. However, Arev Math is too far from Trebuchet MS to fool anyone.

Solution 3: Finally, I combined solutions 1 and 2. I didn't even know if this is going to compile:

\usepackage{arevmath}
\usepackage{mathspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setallmainfonts{Trebuchet MS}

The result was surprisingly good. I think this could actually fool a casual reader. All Latin and Greek letters are taken from Trebuchet MS, and all other symbols are from arevmath. Everything is in sans serif, and the "thickness" of symbols looks correct.

However, it's still fairly easy to tell the difference between an equation that is typeset with these settings and the same equation that is typeset entirely in Trebuchet MS. Commonly used symbols such as {}, () and comma look different; + is too large, etc. If I place an equation typeset in Latex next to an equation that is typeset by simply writing a piece of text in Trebuchet MS, there are some eye-catching differences.

Question: Is it possible to do something better than solution 3? I think I'm missing something obvious; for example, I'd assume that it should be fairly easy to typeset basic math symbols such as "," and "+" in Trebuchet MS?

This time I'm not really interested in finding a "correct" solution; all that matters is that the output "looks good".

EDIT:

Following Wojtek Myszka's advice, I tried something like this (with xelatex):

\usepackage{arevmath}
\usepackage{mathspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\setallmainfonts{Trebuchet MS}
\makeatletter
\DeclareSymbolFont{my}{EU1}{\zf@family}{m}{n}
\makeatother
\DeclareMathSymbol{!}{\mathclose}{my}{"21}
\DeclareMathSymbol{+}{\mathbin}{my}{"2B}
\DeclareMathSymbol{:}{\mathrel}{my}{"3A}
\DeclareMathSymbol{=}{\mathrel}{my}{"3D}
\DeclareMathSymbol{?}{\mathclose}{my}{"3F}
\DeclareMathSymbol{,}{\mathpunct}{my}{44}
\DeclareMathSymbol{.}{\mathord}{my}{46}

Looks better, but how do I handle the delimiters ()[]{} correctly?

share|improve this question
    
Any special reason you want to use Trebuchet MS? Perhaps, especially in the beta stage, this question should be generalized to something more along the lines of "How can I work around missing symbols in a desired font?" You're likely to get answers like "Just use arevmath for everything. It looks good, and is close enough." –  Kevin Vermeer Jul 29 '10 at 22:45
4  
@reemrevnivek - His question seems just fine to me. It's the actual problem he's trying to solve, after all. –  Heath Hunnicutt Jul 30 '10 at 0:57
2  
@reemrevnivek: Of course we can consider a more general question here: math in [arbitrary TrueType font]. Anyway, this is not really about working around missing symbols in a desired font. At the very least plain ASCII symbols such as ,+(){} are present in virtually any font; the problem is that I don't know how to tell Latex to use the desired font for those symbols (other than writing something like a\text{,}\,b instead of a,b, etc.). –  Jukka Suomela Jul 31 '10 at 15:37
2  
Let's see if we can get more participation with a bounty... –  Jukka Suomela Jul 31 '10 at 21:45
1  
(Re: EDIT) standard definition is "\DeclareMathDelimiter{}{\mathopen}{operators}{"5B}{largesymbols}{"02}" [reference –  Grigory M Aug 7 '10 at 17:54
show 2 more comments

2 Answers

up vote 3 down vote accepted
+100

It's not an answer. It's a kind of discussion or only the hint. Using beamer I can define MS Trebuchet as a default sf font: \renewcommand{\sfdefault}{jtrr} (jtrr is my Trebuchet font) and this works in math also.

share|improve this answer
    
Does it take math symbols such as ,+=(){} from Trebuchet MS or from some other font? –  Jukka Suomela Aug 3 '10 at 18:20
3  
You are right: No. To yypeset mathematics in TeX you need a special math font. Anyway, look at this \DeclareSymbolFont{symfont} {T1}{jtrr}{m}{n} it's a declaration of some artificial, additional font for typesetting math symbols. It's Trebuchet in encoding T1. \DeclareMathSymbol{=}{\mathrel}{symfont}{"3D} This declares that equal sign will be typeset using this special font ("3D is the ASCII code for =). To make some font to be compatible with (La)TeX math one need to create virtual font containing all needed characters taken from base font, and close replacements taken from other fonts. –  Wojtek Myszka Aug 4 '10 at 10:23
4  
Great, thanks! Now we are finally getting somewhere! I combined my solution 3 with something like \DeclareSymbolFont{x}{EU1}{\zf@family}{m}{n} \DeclareMathSymbol{=}{\mathrel}{x}{"3D} \DeclareMathSymbol{+}{\mathbin}{x}{"2B} \DeclareMathSymbol{,}{\mathpunct}{x}{"2C} and it seems to give me the symbols ,+= in Trebuchet MS! The \zf@family thing seems to be related to the internals of the fontspec package, which is used by mathspec; don't know if I'm doing the right thing. Perhaps you or someone else could put together all this so that we have a more complete answer? –  Jukka Suomela Aug 4 '10 at 14:46
    
The bounty is about to expire, so I'm going to give it to this answer for now even though we don't have a complete solution here yet... –  Jukka Suomela Aug 6 '10 at 19:34
add comment

Based on the free math font survey texdoc free-math-font-survey and their sources from here. This was done via loading a "math font" package. That is a packaged font which is encapsulated and tuned to be used for math. e.g. \usepackage{mathpazo} So either that font needs additional packaging, or you can browse these other fonts in the survey and pick the one you like best.

From the chart included in that survey it looks like the author manages to mix a few math fonts to cover all symbols. Study that source and see if you can come up with better combination of packages.

share|improve this answer
2  
Sure, we do need special math fonts to cover special symbols, and I think I'd be fine with taking those from arevmath. However, I don't see any absolute need to use special fonts for plain ASCII symbols such as +,(){}. Why can't I take those from Trebuchet MS? –  Jukka Suomela Jul 31 '10 at 15:13
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.