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.

2
  • 2
    What about +. That is the closest I can come for "not minus".
    – StefanH
    Mar 26 '17 at 11:40
  • A line with a slop which could be colored is my favorite.
    – Nosrati
    Mar 26 '17 at 11:43
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

2
  • 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{-}} 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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.