9

I would like to typeset a symbol that means "element of or equal to," which is just the element symbol with a short horizontal line underneath.

I tried $\underline{\in}$, but that makes the underline too thick:

enter image description here

Is there a way to typeset this symbol directly, or to make the underline thinner?

  • 3
    Welcome to TeX.SX! What is element of or equal to?? I don't know this kind of math – user31729 Nov 24 '14 at 17:38
  • 2
    Are you sure you are not looking for the \subseteq symbol? – Thomas F. Sturm Nov 24 '14 at 17:39
  • 1
  • 1
    Yes, I'm not looking for \subseteq. The symbol is depicted here: s17.postimg.org/dos0j706n/eleq.png I tried DeTexify, but it didn't give any results that were right. – Nishant Nov 24 '14 at 17:47
  • 1
    @ThomasF.Sturm The symbol may be used in the theory of ordinals, where the (strict) order relation is precisely “being an element of”. – egreg Nov 24 '14 at 20:37
8

This is a first approximation:

\documentclass{article}
\newcommand{\ineq}{%
  \mathrel{\mkern1mu\underline{\mkern-1mu\in\mkern-1mu}\mkern1mu}}

\begin{document}
$\alpha\ineq\beta$
\end{document}

enter image description here

This automatically changes size in subscripts.

You may prefer a solution with a roundcap bar below the main symbol:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\ineq}{\mathrel{\text{\in@eq}}}
\newcommand{\in@eq}{%
  \oalign{%
    \hidewidth$\m@th\in$\hidewidth\cr
    \noalign{\nointerlineskip\kern1ex}%
    $\m@th\smash{-}$\cr
    \noalign{\nointerlineskip\kern-.5ex}%
  }%
}
\makeatother
\begin{document}
$\alpha\ineq\beta_{\ineq}$
\end{document}

enter image description here

8

The character ⋸ is the Unicode character U+2278, see Barbara Beeton's comment.

I found two math fonts, which contains the charactes:

  • Asana Math
  • XITS Math

They can be used with XeTeX or LuaTeX. With package unicode-math, the command is \isinvb, or the character can be given directly as UTF-8 character or the ^^^^-escape notation can be used: ^^^^22F8.

The following example shows:

  • The direct glyphs (only Asana Math and XITS Math).
  • The macros \isinvbA and \isinvbB.
    • They compose the symbol with ∈ (\in) and the minus sign. If the minus sign is too long (Latin Modern Fonts), then it is scaled horizontally to fit the symbol ∈.
    • The gap is estimated by the middle of ten percent of the height of ∈ and 150% of the line thickness of the minus sign.
    • Rounded line caps are kept (but subjected to the horizontal scaling in case of Latin Modern).
    • Asana Math centers the complete symbol around the math axis. This is implemented by \isinvbA by using \vcenter.
    • XITS Math keeps the symbol in and adds the line under it. This is implemented by \isinvbB by using \vtop.
  • The symbols can be used in all math styles.

Example and test file:

\tracinglostchars=2
\documentclass{article}
\usepackage{unicode-math}

\newcommand*{\teststring}{%
  \fbox{$\isinvb$}% U+22F8
}

\usepackage{graphicx}

\makeatletter
\newcommand*{\isinvbA}{%
  \mathrel{%
    \mathpalette\@isinvb@\vcenter
  }%
}
\newcommand*{\isinvbB}{%
  \mathrel{%
    \mathpalette\@isinvb@\vtop
  }%
}
\newcommand*{\@isinvb@}[2]{%
  % #1: math style   
  % #2: \vcenter or \vtop
  #2{%   
    \sbox0{$#1\in\m@th$}%
    \copy0 %
    \sbox2{$#1-\m@th$}%
    \sbox4{$#1\vcenter{}$}%
    \dimen@=\dimexpr\ht2-\ht4\relax
    \sbox2{\lower\dimexpr\ht4-\dimen@\relax\hbox{\unhcopy2}}%
    \dp2=\z@
    \kern.5\dimexpr3\dimen@ + .1\ht0\relax
    \ifdim\wd2>\wd0 %
      \hbox to \wd0{\hss\resizebox{\wd0}{\ht2}{\copy2}}%
    \else
      \hbox to \wd0{\hss\copy2}%
    \fi
  }%
}
\makeatother

\begin{document}

\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{.1pt}   
\newcommand*{\test}[1]{%
  \fontfamily{lmvtt}\tiny #1 &
  \setmathfont{#1.otf}$\teststring$
  &
  \setmathfont{#1.otf}${\in}{-}$
  &      
  \setmathfont{#1.otf}%  
  \fbox{$\isinvbA$}$^{\isinvbA^{\isinvbA}}$%
  &
  \setmathfont{#1.otf}%
  \fbox{$\isinvbB$}$^{\isinvbB^{\isinvbB}}$%
  \\
}
\begin{tabular}{@{}l@{ }l@{ }l@{\quad}l@{ }l@{}}
  \test{Asana-Math}  
  \test{xits-math}
  \test{latinmodern-math}
  \test{texgyretermes-math}
  \test{texgyrepagella-math}
  \test{texgyrebonum-math}
  \test{texgyreschola-math}
\end{tabular}
\end{document}

Result

Remarks:

  • \tracinglostchar=2 is quite important, because then TeX will report characters, which are not present in the used fonts, e.g.:

    Missing character: There is no ⋸ (U+22F8) in font "[texgyrebonum-math.otf]:mode=base;script=math;language=DFLT;"!
    
  • Macros \isinvbA and \isinvbB do not depend on LuaTeX or XeTeX, they can also be used with pdflatex or latex.

  • The \fbox commands show the bounding boxes.

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.