[Tex/LaTex] How to negate a specific symbol

symbols

I want to negate the symbol whose code is \models (this would be specific to Formal Logic). How can I do that? I tried a number of combination, but didn't find how this could be done. I tried \neqmodels, \nemodels, \notmodels, \nmodels but all of them are wrong.

Is there a general way to negate symbols?

Best Answer

There are a number of ways to achieve the negation of a symbol:

  1. Follow the guidelines in How to look up a symbol or identify a math symbol or character? to see whether such a symbol already exists.

    This is usually the best course of action, since the symbol would have been constructed to match certain specification (say, placement and height/depth of negation symbol). If such a symbol is only available in a different font, then consider including only that symbol by following the instructions in Importing a Single Symbol From a Different Font.

    enter image description here

    \documentclass{article}
    \usepackage{amssymb}% http://ctan.org/pkg/amssymb
    \begin{document}
    \[
      a \neq b \nparallel c \nvDash d \nprec e
    \]
    \end{document}
    
  2. For a symbol \mysymbol, try \not\mysymbol. \not is a zero-width math relation that is set "on the right" of where it's called. As such, it visually overlaps the typical math relation/symbol. Not always perfect, but works in general.

    enter image description here

    \documentclass{article}
    \begin{document}
    \[
      a \not= b \not\geq c \not\sim d \not\approx e \not\in f
    \]
    \end{document}
    
  3. centernot works well when symbols are somewhat wider than usual, yet you still want the regular \not-like visual.

    enter image description here

    \documentclass{article}
    \usepackage{centernot}% http://ctan.org/pkg/centernot
    \begin{document}
    \[
      a \not= b \centernot= c 
        \not\parallel d \centernot\parallel e 
        \not\longrightarrow f \centernot\longrightarrow g
    \]
    \end{document}
    
  4. The cancel package draws a diagonal line across a symbol to "cancel" it.

    enter image description here

    \documentclass{article}
    \usepackage{centernot,cancel}% http://ctan.org/pkg/{centernot,cancel}
    \begin{document}
    \[
      a \not= b \centernot= c \mathrel{\cancel{=}} d
        \not\longrightarrow e \centernot\longrightarrow f \mathrel{\cancel{\longrightarrow}} g
    \]
    \end{document}
    
  5. Other methods include using graphics packages like tikz or pstricks to draw rules in specific locations across a symbol/construction.