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.

In proximity theory, we use \delta and \ll as binary relations on the power set of a set X. How can one display NOT \delta or NOT \ll similar to how we can do \not\in. Using \not\delta and \not\ll place the strike-through in bad positions over the \delta and \ll.

For NOT \delta, I am currently using

  • \!\!\not\!\delta

For NOT \ll, I am using

  • \hskip 0.4mm \not \hskip -0.4mm \ll

There are a few problems here. Sometimes the placement of the "not" over the "delta" is a little off but it varies throughout the pages. Also, at the end of the line, I may get the \not appearing at the end of the current line and the \delta appearing at the beginning of the next line. I have not noticed this issue with my defininition of NOT \ll.

What is the best way to define these symbols? How can one make sure that the "not" is on the same line as the "delta"?

share|improve this question
1  
Welcome to TeX.SE. I took the liberty of formatting your code; backticks make it look pretty. –  Matthew Leingang Mar 25 '11 at 3:59
2  
@Matthew: I made it even prettier by replacing \\! with \! :-) (The \\! was caused by the backticks.) –  Hendrik Vogt Mar 25 '11 at 5:19
    
@Matthew, @Hendrik: Thank you. I am new here and will try to format things better from now on. :-) –  Justin J Stark Mar 25 '11 at 21:09
add comment

3 Answers

Just use Heiko Oberdiek's centernot package:

\documentclass{article}
\usepackage{centernot}
\usepackage{amsmath}
\begin{document}

$a\centernot\ll b \centernot\Delta c$

$a\centernot\longrightarrow b$

$a\centernot{\xrightarrow{1234567}} b$

\end{document}

enter image description here

share|improve this answer
    
I guess there really is nothing new under the sun! –  Matthew Leingang Mar 25 '11 at 9:05
2  
Are there any drawbacks to \let\not\centernot? –  Konrad Rudolph Mar 25 '11 at 10:11
2  
@Knorad: No, I guess. But you'd better \let\oldnot\not first. –  Leo Liu Mar 25 '11 at 12:37
2  
@Justin: \centernot makes the symbol to be a math relation. You can use \mathord{\centernot\delta} or simply {\centernot\delta} to get an ordinary symbol. –  Leo Liu Mar 26 '11 at 13:46
1  
@Leo: Thank you. I had no idea there were differences between relations and symbols. I guess I should keep notdelta as relational and instead make delta a binary relation using \mathbin{\delta} –  Justin J Stark Mar 28 '11 at 5:22
show 3 more comments

Leo Liu told you a great way to define the symbols; I'd like to explain the odd behaviour you observed.

Sometimes the placement of the "not" over the "delta" is a little off but it varies throughout the pages.

The reason for this is that \not is a relational symbol, and TeX inserts a \thickmuskip between an ordinary and a relational symbol (which gives nice spacing). Now \thickmuskip usually is a skip of 5.0mu plus 5.0mu, which means: It's at least 5 mu units wide, but it can stretch an additional 5 mu units, depending on how full the current line is.

For example, if you type $a \!\!\not\!\delta b$, then TeX puts this \thickmuskip before the \not symbol and also before the \delta. The stretchability of this latter skip causes the placement of the "not" over the "delta" to vary throughout the pages.

Also, at the end of the line, I may get the \not appearing at the end of the current line and the \delta appearing at the beginning of the next line.

If a relational symbol (like \not) is followed by a skip like \! (or by an ordinary symbol), TeX allows a line break in between. (TeXnically this is achieved by putting a \penalty 500.)

I have not noticed this issue with my defininition of NOT \ll.

The issue with the undesired line break can also happen with your definition of NOT \ll. The variation of the placement of the "not", however, does not happen: The reason is that both \not and \ll are relational symbols, and TeX doesn't put any space between two relational symbols.

share|improve this answer
1  
That's very helpful (to me at least)! –  Matthew Leingang Mar 25 '11 at 9:04
add comment

I think you want the macro \mathrlap to overlap the slash on the symbol you are negating:

\documentclass{article}
\usepackage{mathtools}
\newcommand{\NOTDelta}{\!\!\not\!\Delta}
\newcommand{\NOTll}{\hskip 0.4mm \not \hskip -0.4mm \ll}
\newcommand{\notDelta}{\mathrel{\mathrlap{\not}\Delta}}
\newcommand{\notll}{\mathrel{\mathrlap{\;\;\not}\ll}}
\begin{document}

\begin{align*}
    A &\not\Delta B     & A &\not\ll B \\
    A &\NOTDelta  B     & A &\NOTll  B \\
    A &\notDelta  B     & A &\notll  B
\end{align*}

\end{document}

sample code

The \mathrel command spaces your symbol as if it were a binary relation. Without it your symbols get pushed too close together. And the \mathrlap command sets its contents in a box of width zero, with the rest overlapping to the right.

share|improve this answer
3  
Actually, \mathbin is for binary operators. \mathrel is for relations. –  TH. Mar 25 '11 at 5:33
    
Note that the spacing to the left of your \notll is not good. –  Hendrik Vogt Mar 25 '11 at 7:26
    
@TH.: You are correct, sir! I made that change. –  Matthew Leingang Mar 25 '11 at 9:01
    
@Hendrik: Hm...how does that happen? I expected my \notll to have the same width as \ll. –  Matthew Leingang Mar 25 '11 at 9:02
    
you get an automatically added \thickmuskip twice: once from your \mathrel, and once from the \ll; I'm not sure why this happens. You could use {\ll} and adjust the \;\; to correct it. –  Hendrik Vogt Mar 25 '11 at 9:18
add comment

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.