4

I couldn't find following symbol on web and in this site also:

enter image description here

have we any TeX code for that?. Thanks.

Nosrati
  • 237

2 Answers2

7

\not prints the slash for the following relational symbol. "Relational", because then TeX will not add additional horizontal space. Also, the "not minus" symbol looks more than a relational symbol than a binary or unary symbol.

Example:

\documentclass{article}
\begin{document}
\[ 1 \not\mathrel{-} 1 \]
\end{document}

Result

A red slash below the minus sign can be achieved with:

\documentclass{article}
\usepackage{color}
\begin{document}
\[ 1 \begingroup\color{red}\not\endgroup\mathrel{-} 1 \]
\end{document}

Minus on red slash

(However, this will not work in cases, where \not is redefined to take an argument.)

The case, where the slash is on top of the minus, is more complicate, because it needs the measurement of the symbol width that also depends on the current math style.

\documentclass{article}
\usepackage{color}

\makeatletter
\newcommand*{\rednotminus}{%
  \mathrel{%
    \mathpalette\@rednotminus{}%
  }%
}
\newcommand*{\@rednotminus}[2]{%
  % #1: math style
  % #2: unused
  \sbox\z@{$#1\not-\m@th$}%
  \hbox to\wd\z@{$#1-\m@th$\hss}%
  \kern-\wd\z@
  \hbox to\wd\z@{\begingroup\color{red}$#1\not\m@th$\endgroup\hss}%
}
\makeatother

\begin{document}
\[ 1 \rednotminus 1 \]
\end{document}

Red slash on minus

Heiko Oberdiek
  • 271,626
  • Shouldn't the resulting symbol be a \mathbin, like the–` symbol? – Bernard Mar 26 '17 at 11:59
  • @Bernard You have to ask the OP about the intended mathematical meaning. The symbol can be changed to a binary operator by putting it in \mathbin: \mathbin{\not\mathrel{-}} – Heiko Oberdiek Mar 26 '17 at 12:03
2

MnSymbol.sty offers the relational symbol \nleftrightline.

enter image description here

\documentclass{article}
\usepackage{MnSymbol}
\begin{document}
$x\nleftrightline y$
\end{document}

You probably do not want to import all the symbols from MnSymbol, but want to pick just this single symbol.

\documentclass{article}
% http://tex.stackexchange.com/a/36088
\DeclareFontFamily{U}{MnSymbolB}{}
\DeclareFontShape{U}{MnSymbolB}{m}{n}{
    <-6>  MnSymbolB5
   <6-7>  MnSymbolB6
   <7-8>  MnSymbolB7
   <8-9>  MnSymbolB8
   <9-10> MnSymbolB9
  <10-12> MnSymbolB10
  <12->   MnSymbolB12}{}
\DeclareSymbolFont{MnSyB}{U}{MnSymbolB}{m}{n}
\DeclareMathSymbol{\nleftrightline}{\mathrel}{MnSyB}{208}
\begin{document}
$x\nleftrightline y$
\end{document}
gernot
  • 49,614