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.

When using the sansmath package with the Arev font, symbols like + and = fail to appear in the compiled document.

\documentclass{article}
\usepackage{fouriernc} % use the Arev font
\usepackage{sansmath}
\begin{document}
You can see this $+$ and this $=$.
But you can't see \sansmath this $+$ and this $=$.
\end{document}

If, however, I switch the order of \usepackage to include sansmath first and then fouriernc, for some reason you now can see the symbols, but I get two errors...

\documentclass{article}
\usepackage{sansmath}
\usepackage{fouriernc} % use the Arev font
\begin{document}
You can see this $+$ and this $=$.
Now you can see \sansmath this $+$ and this $=$, but there are 2 errors.
\end{document}

! LaTeX Error: Command `\mathrm' already defined.

! LaTeX Error: Command `\mathrm' already defined.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

The package fouriernc doesn't use Arev fonts, but rather NewCentury Schoolbook and a modified version of the Fourier math fonts.

These fonts have different symbol positions and so they define + and = differently from normal: the normal mathcode of + is "202B (in hexadecimal form), while fouriernc uses "2280.

These cryptic codes say: + is an operation symbol (first digit 2), which comes from math family 0 (in the standard setting) or 2 (in the fouriernc settings). The symbol lives in font position "2B (standard setting) or "80 (fouriernc).

The package sansmath expects standard codes; in family 2 it uses cmsy10 which in position "80 has nothing (it's a seven bit font).

So the two packages are completely incompatible.

share|improve this answer
    
Thanks, but then do you have an alternative to the answer to my question here? tex.stackexchange.com/a/44926/9757 (the comments are relevant). Is there another font/package that will change my Fourier math fonts? –  jamaicanworm Feb 20 '12 at 23:14
1  
The alternatives are: not using math in captions or not using a sans serif font in captions. Sorry: reverting all the math codes when switching to \sansmath is a job that nobody would undertake. –  egreg Feb 20 '12 at 23:22
    
I'm fine with not using a sans serif font; the original question was to just have the font in my overpic captions be different from my main font (including in math mode). Is there another (non-sans-serif) solution for this? –  jamaicanworm Feb 20 '12 at 23:24
1  
Two different serif fonts are quite difficult to combine, but even if they existed, the problem would be just the same: if the main font changes the math codes, also the other font should use the same conventions (or the big work of doing a reversal each time one switches font family should be carried out). –  egreg Feb 20 '12 at 23:33
1  
It's theoretically possible: take the huge default math symbol table and keep it somewhere to be called when you want \sansmath. Practical? No, sorry. This table is built in a large number of steps and keeping track of it is a herculean task. –  egreg Feb 21 '12 at 0:41
show 2 more comments

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.