Here is a possibility, superimposing a rotated minus to the vertical bar.
\documentclass{article}
\usepackage{amsmath}
%\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[widespace]{fourier}
\makeatletter
\providecommand{\nmid}{} % a mock definition
\renewcommand\nmid{\mathrel{\mathpalette\thiel@nmid\relax}}
\newcommand{\thiel@nmid}[2]{%
\ooalign{%
\rotatebox[origin=c]{40}{$\m@th#1-\mkern-3.5mu$}\cr
\hidewidth$\m@th#1|$\hidewidth\cr}%
}
\makeatother
\begin{document}
\begin{gather*}
v\mid\infty\\
v\nmid\infty\\
x_{\nmid_{\nmid}}
\end{gather*}
\end{document}
I use first \providecommand
to give a definition to \nmid
, so the later \renewcommand
will work in all cases.
I'm not sure you really want \mid
to take as much space as \nmid
other than in the supposedly rare cases when they must be aligned, so I believe it's best to define a new command \wmid
for the “wide \mid
”:
\newcommand\wmid{\mathrel{\mathpalette\thiel@mid\relax}}
\newcommand{\thiel@mid}[2]{%
\ooalign{%
\hphantom{\rotatebox[origin=c]{40}{$\m@th#1-\mkern-3.5mu$}}\cr
\hidewidth$\m@th#1|$\hidewidth\cr}%
}
(put this before the \makeatother
in the above code). Then the code
\begin{align*}
v&\wmid\infty\\
v&\nmid\infty
\end{align*}
will produce
Quite easy, once you know how to do it. ;-)
\documentclass{article}
\usepackage{fourier}
\usepackage{amsmath}
% load the CM symbol font
\DeclareSymbolFont{arrows}{OMS}{cmsy}{m}{n}
% change the arrows to be taken from the CM symbol font
\DeclareMathSymbol{\leftrightarrow}{\mathrel}{arrows}{"24}
\DeclareMathSymbol{\leftarrow}{\mathrel}{arrows}{"20}
\let\gets=\leftarrow
\DeclareMathSymbol{\rightarrow}{\mathrel}{arrows}{"21}
\let\to=\rightarrow
\DeclareMathSymbol{\mapstochar}{\mathrel}{arrows}{"37}
% the bar for making longer arrows
\DeclareMathSymbol{\relbardash}{\mathbin}{arrows}{"00}
\DeclareRobustCommand\relbar{%
\mathrel{\smash\relbardash}% \smash, because - has the same height as +
}
\begin{document}
$X\to Y\gets Z$
$X\longrightarrow Y\longleftarrow Z$
$x\mapsto f(x)$
$X\xrightarrow{aaaaaaaaa}Y$
\end{document}
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
\DeclareSymbolFont{symbols}{OMS}{cmsy}{m}{n}
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:
\DeclareRobustCommand{\longrightarrow}{\relbar\joinrel\rightarrow}
\DeclareRobustCommand{\longlefttarrow}{\leftarrow\joinrel\relbar}
We need to change also \relbar
, because \joinrel
is just a negative spacing. Now, in fontmath.ltx
we find
\DeclareRobustCommand\relbar{%
\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 -
:
\DeclareMathSymbol{-}{\mathbin}{symbols}{"00}
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
\DeclareMathSymbol{\relbardash}{\mathbin}{arrows}{"00}
\DeclareRobustCommand\relbar{%
\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.
Best Answer