I am using the fourier font in a LaTeX document, but instead of the \rightarrow that fourier provides, I need the Computer Modern right arrow.

For example, I need

enter image description here

instead of:

enter image description here

I have tried using \DeclareMathSymbol to no avail and am totally stuck -- any help would be much appreciated!


1 Answer 1


Quite easy, once you know how to do it. ;-)


% load the CM symbol font
% change the arrows to be taken from the CM symbol font
% the bar for making longer arrows
  \mathrel{\smash\relbardash}% \smash, because - has the same height as +

$X\to Y\gets Z$

$X\longrightarrow Y\longleftarrow Z$

$x\mapsto f(x)$


enter image description here

How to find this solution? Here's a method.

We know that we need a new math symbol font to which assigning the arrows we want to modify. So I looked into fontmath.ltx, the file where the standard assignment are found. There I found the line


and assigned a new name to the symbol font (I chose arrows). Then I looked for \rightarrow, \leftarrow and \mapstochar, which are the basic ingredients for the needed arrow and copied the respective lines by changing symbols into arrows. I also put the two \let instruction to make sure that the aliases \to and \gets point to the redefined symbols.

Less easy is the question about \longrightarrow and \longleftarrow. They are built by pasting together a minus sign and an arrow:


We need to change also \relbar, because \joinrel is just a negative spacing. Now, in fontmath.ltx we find

  \mathrel{\smash-}% \smash, because -has the same height as +

and we find a problem. This definition uses the minus sign, but we don't want to change the minus sign coming from the Fourier fonts. So I found the line for -:


and defined a new symbol with the same properties; finally, I redeclared \relbar to use it instead of the minus sign:

% the bar for making longer arrows
  \mathrel{\smash\relbardash}% \smash, because - has the same height as +

Doing the same with other symbol fonts can be done similarly, by looking at the style files where the correspondence of symbols with triples “math type+math font+slot” is defined.

  • How did you find out that the \rightarrow was in slot 21 (and so on for the other symbols)? Is there an easy way of doing this? Thanks! Commented Oct 4, 2013 at 17:08
  • @AndrewBate Just find on your computer the file fontmath.ltx; I just copied from there changing symbols into arrows in order to assign the symbols to the new math font just declared.
    – egreg
    Commented Oct 4, 2013 at 17:23
  • amsmath has its own definition of \relbar which is not robust and uses \mathpalette. It also has its definition of \longrightarrow etc... so your code reverts this to the non-amsmath status, I don't know if or where this could show up concretely under certain circumstances.
    – user4686
    Commented Oct 4, 2013 at 17:55
  • @jfbu The \relbar redefinition by amsmath is just to make the construction compatible with the tricks amsmath does when doing \qopname; since I don't use the minus sign, nothing bad should happen. And I don't redefine \longrightarrow nor \longleftarrow.
    – egreg
    Commented Oct 4, 2013 at 17:59
  • @jfbu Actually, the amsmath definition uses directly \mathpalette\mathsm@sh, which is what \smash expands to when used in math mode. It would be probably slightly more efficient to use \mathpalette\mathsm@sh also here, but less direct for the beginner.
    – egreg
    Commented Oct 4, 2013 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .