Is it possible to get the \not
glyph with a centered bounding box in Latin Modern?
\documentclass{article}
\usepackage{lmodern}
\begin{document}
\fbox{$\not$}
\end{document}
The \not
symbol has zero width; (the box you get is twice \fboxsep
wide).
You can use \centernot
over an invisible =
.
\documentclass{article}
\usepackage{lmodern}
\usepackage{centernot}
\setlength{\fboxsep}{0pt}
\begin{document}
\fbox{$\not$}
\fbox{$\centernot{\hphantom{=}}$}
\end{document}
Of course you want to define a command.
\documentclass{article}
\usepackage{lmodern}
\usepackage{centernot}
\NewDocumentCommand{\wnot}{O{6}}{%
\centernot{\mkern#1mu}%
}
\setlength{\fboxsep}{0pt}
\begin{document}
\fbox{$\not$}
\fbox{$\wnot[4]$} (4)
\fbox{$\wnot[6]$} (6)
\fbox{$\wnot[8]$} (8)
\fbox{$\wnot[10]$} (10)
\fbox{$\wnot[12]$} (12)
\end{document}
When you have decided what's the width that suits you, you can remove the optional argument and hardwire the desired width.
Note that \centernot
creates a relation symbol. If you want an ordinary symbol, add braces around the whole thing.
In the following example I use 12mu, which is the width of =
.
\documentclass{article}
\usepackage{lmodern}
\usepackage{centernot}
\NewDocumentCommand{\wnot}{}{% ordinary
{\centernot{\mkern12mu}}%
}
\NewDocumentCommand{\rnot}{}{% relation
\centernot{\mkern12mu}%
}
\begin{document}
$a\wnot b$ versus $a\rnot b$
\end{document}