3

In some theories on predication \eta is used instead of set theoretical \in.

How do I get a useful symbol for \noteta which is to \eta as \notin is to \in?

The solutions should be compilable both with pdfLaTeX and LuaLaTeX.

\documentclass{article}

\begin{document}

$\not\eta$

\end{document}

output

9
  • perhaps \not\eta ? ? Commented Jan 26 at 1:48
  • 1
    it isn't clear what % harmless under LuaLaTeX, required for pdfLaTeX is referring to, but if you mean the line above, then T1 encoding should (almost)never be used with luatex it breaks all the unicode support, so not exactly harmless, and utf8 is not required for pdflatex, unless your latex is 10 years old Commented Jan 26 at 1:50
  • 1
    well yes that line does absolutely nothing Commented Jan 26 at 2:02
  • 2
    what do you mean by skewed rendering, you have shown no code that produces any output or said what issue you are having Commented Jan 26 at 2:03
  • 2
    please show us the code you used to produce that output, which is not at easy to decipher. Commented Jan 26 at 3:11

3 Answers 3

5

Different math font need different treatment, I'm afraid. But we can use a couple of parameters in order to adjust the positioning for a particular font.

\documentclass{article}
%\usepackage{unicode-math}
%\setmathfont{STIX Two Math}
%\setmathfont{TeX Gyre Pagella Math}

\makeatletter
\DeclareRobustCommand{\noteta}{\mathrel{\mathpalette\noteta@{\noteta@kern\noteta@raise}}}
\newcommand{\noteta@}[2]{\noteta@@#1#2}
\newcommand{\noteta@@}[3]{%
  \mkern#2
  \ooalign{\hidewidth\raisebox{#3\height}{$#1\m@th/$}\hidewidth\cr$#1\m@th\mkern-#2\eta$\cr}%
}
\newcommand{\noteta@kern}{1mu}% tailor to the font
\newcommand{\noteta@raise}{-0.1}% tailor to the font
\makeatother

\begin{document}

$a\notin A$

$a\noteta A$ $\scriptstyle a\noteta A$

$a\mathrel\eta A$ $\scriptstyle a\mathrel\eta A$

\end{document}

Output with pdflatex

pdflatex

Output with Latin Modern Math

Just loading unicode-math (uncomment line 2)

Latin Modern Math

Output with STIX Two Math

Uncomment lines 2 and 3

STIX Two Math

Output with Pagella Math

Uncomment lines 2 and 4

Pagella Math 1

This probably needs a different amount of raising/lowering. Changing \newcommand{\noteta@raise}{-0.1} into

\newcommand{\noteta@raise}{0}

results in

Pagella Math 2

Advice

Experiment with the math font you use, but do remember that \mathrel\eta is needed if you want to use the symbol as a math relation.

1
  • Thanks for including the switches between pdflatex and lualatex. Commented Jan 26 at 15:08
8

It seems to me that the most reliable approach is to overlay a stroke at the desired angle yourself (while still scaling it properly across different math styles). This can be done in a way that works with both pdfLaTeX and LuaLaTeX. The stroke is drawn using \rule{...}{...}; \notetaangle controls the angle, and \notetashift controls the stroke’s vertical placement. All parameters are under your control; for example:

\documentclass{article}
\usepackage{graphicx} % \rotatebox

\newcommand*\notetaangle{25}
\newcommand*\notetashift{.4ex}

\makeatletter
\newcommand{\noteta}{\mathrel{\mathpalette\noteta@{}}}
\newcommand{\noteta@}[1]{%
  \ooalign{%
    $#1\eta$\cr
    \hidewidth
      \raisebox{\notetashift}{%
        \rotatebox[origin=c]{\notetaangle}{%
          $#1\rule{1.05em}{.10ex}$%
        }%
      }%
    \hidewidth\cr
  }%
}
\makeatother

\begin{document}

$\eta\quad\noteta$

\vskip10pt
$x\noteta y$

\end{document}

enter image description here

3

You could maybe use \mathclap, from the mathtools package

\NewDocumentCommand{\noteta}{}{%
  \mathclap{\not}\eta%
}

Example:

\documentclass{article}

\usepackage{mathtools}

\NewDocumentCommand{\noteta}{}{%
  \mathclap{\not}\eta%
}

\begin{document}

$x\noteta y$ $\scriptstyle x\noteta y$

\end{document}

Example

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.