32

I write $P \niton x$, but it does not work. How can I write the symbol $\notin$ backwards?

3
  • 1
    Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). Jan 7, 2013 at 14:25
  • 21
    Wouldn't it be more bizarre if it actually worked? :)
    – percusse
    Jan 7, 2013 at 15:12
  • 2
    Do you want the slash to be backwards too?
    – asmeurer
    Jan 7, 2013 at 17:50

6 Answers 6

23

After consulting The Comprehensive LaTeX Symbol List a few fonts provide such a symbol:

  • txfonts, newtxmath and pxfonts have $\notni$.
  • mathabx has $\notowner$ and $\varnotowner$
  • MnSymbol has $\nowns$
  • mathdesign has a small version $\notsmallowns$, but no normal sized one.
  • kpfonts has $\notowns$

Note however that using one of these packages changes the complete font set. Of course you can rip this single symbol from a font that has it, let's try with $\notni$ from txfonts, surrounded by Latin Modern:

\DeclareSymbolFont{symbolsC}{U}{txsyc}{m}{n}
\DeclareMathSymbol{\notniFromTxfonts}{\mathrel}{symbolsC}{61}
...
$x \notin P \notniFromTxfonts x$

but the result is not convincing:

notni

1
  • 3
    You should remark that both these packages change the whole font, not only add some symbols.
    – yo'
    Jan 7, 2013 at 14:53
33

If the math fonts you use don't have the symbol, you can say

\newcommand{\niton}{\not\owns}

Here's a complete example, showing that the symbol will change size in subscripts:

\documentclass{article}
\newcommand{\niton}{\not\owns}
\begin{document}
$A\niton x_{B\niton y}$
\end{document}

enter image description here

If your fonts don't have \owns (that is, the reverse of \in) you can emulate it by loading graphicx and amsmath:

\usepackage{graphicx}
\usepackage{amsmath}
\newcommand{\niton}{\not\mathrel{\text{\reflectbox{$\in$}}}}

A possibly better definition, that uses the same slash as \notin, can be the following:

\documentclass{article}

\makeatletter
\newcommand\niton{\mathrel{\m@th\mathpalette\canc@l\owns}}
\newcommand\canc@l[2]{{\ooalign{$\hfil#1/\mkern1mu\hfil$\crcr$#1#2$}}}
\makeatother

\begin{document}
$A\niton x_{B\niton y}$

$A\notin x_{B\notin y}$
\end{document}

enter image description here

3
  • Some \m@th would probably be good. Feb 20, 2019 at 10:12
  • @HenriMenke Isn't it there in the “better definition”?
    – egreg
    Feb 20, 2019 at 10:18
  • Oh, yes indeed it is there. But it is missing from the \reflectbox example. Feb 20, 2019 at 19:57
13
\documentclass{memoir}
\usepackage{graphicx}
\begin{document}

$\notin$ \reflectbox{$\notin$}

\end{document}
2
  • 2
    It does not work for me. It just prints the same symbol without reversing it. I have a \documentclass[12pt, a4paper]{article} and I use TeXnicCenter 1 RC1 and Tex 3.1n15926 (MiKTeX 2.9 64-bit. Jan 7, 2013 at 14:36
  • 4
    view the pdf output and not the dvi one!
    – user2478
    Jan 7, 2013 at 14:42
8

I believe that \rotatebox is more proper than \reflectbox, I suggest this solution:

enter image description here

\documentclass{article}

\usepackage{rotating}

\makeatletter
\newcommand\@notni[2]{\mathrel{\rotatebox[y=#1]{180}{$#2\notin$}}}
\newcommand\notni{
\mathchoice
  {\@notni{0.57ex}\displaystyle}
  {\@notni{0.57ex}\textstyle}
  {\@notni{0.39ex}\scriptstyle}
  {\@notni{0.26ex}\scriptscriptstyle}
}
\makeatother

\begin{document}

\[
    L\notni x
\quad
    x\notin L
\quad
    \sum_{L\notni x} f(L)
\quad
    \sum_{Z_{L\notni x}} 1
\]

\end{document}
4
  • 3
    sorry to disagree, but i think \reflectbox is the correct interpretation here -- it's a mirror image. the only situation in which i'd use \rotatebox is if the symbol were sloped, and the slope had to be retained. (this is done, for example, with the first E in \XeTeX when it's rendered in italic; see ltugboat.cls.) but \in is usually symmetrical, and besides, \owns (= \ni) is defined in plain.tex, so should be available in any good tex system. Jan 7, 2013 at 15:35
  • 2
    @barbarabeeton I tried to place them next to each other: i.stack.imgur.com/3qXwr.png and I came to conclusion that having all the slashes "forward" is more consistent; on any other symbol the slash is this way, so why should \ni be an exception?
    – yo'
    Jan 7, 2013 at 15:38
  • 1
    ah -- i was considering just the basic \in as being rotated. apologies. i didn't read your code carefully enough, but rashly assumed that you were rotating the non-negated symbol and then applying \not. in this case you're correct; rotation is appropriate. but still better to use \owns directly. no need then for \mathchoice. Jan 7, 2013 at 15:44
  • 1
    @barbarabeeton well, the pointe is whether you want to manually adjust vertical placement of the symbol (as I do) or horizontal placement of the \not (as egreg does).
    – yo'
    Jan 7, 2013 at 15:47
1

my solution is: $\ni \negthickspace \negthickspace \negthickspace / $ or$\owns \negthickspace \negthickspace \negthickspace /$ at least on my page it worked fine.

1
  • this one is slightly more slanted than \not (in default font), but I'm not sure if it's desirable especially if all the other ones have equal slant. / side note, this may mess the spacing after the character up / the 3 repetition is equivalent to \mskip -3\thickmuskip
    – user202729
    Apr 21, 2022 at 11:53
0

This one works for me:

$\not\ni$

1
  • As mentioned in a comment above, anywhere \ni is defined \owns should be defined, so this should be identical to egreg's answer.
    – user202729
    Apr 21, 2022 at 11:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .