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.

The fourier package does not provide a \nmid command. Using the \nmid from amssymb looks very different from the fourier's \mid.

Is there a way to produce a "compatible" symbol in fourier? The two vertical lines should have the same height and width, but the \mid should have some extra space as to match the \nmid's width when they are typeset in two lines above each other, as shown below.

I tried importing both from MnSymbol but couldn't figure out how they are defined there in the first place.

\documentclass{minimal}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[widespace]{fourier}

\begin{document}

\begin{align*}
  a&=b & v\mid\infty\\
  c&=d & v\nmid\infty
\end{align*}

\end{document}
share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

enter image description here

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

enter image description here

share|improve this answer
    
Very nice, thanks. But I also wanted the two symbols/commands (of course not the glyphs themselves) to have the same width for typesetting them directly above one another in cases etc., see the refined question. –  Carsten Thiel Jul 11 '13 at 11:14
    
@CarstenThiel I've added a wide version –  egreg Jul 11 '13 at 12:39
    
thanks. I have those two cases side by side throughout my thesis. And with just amssymb they are in fact of the same width. –  Carsten Thiel Jul 11 '13 at 12:45

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.