[Tex/LaTex] Smaller membership symbol

fontsizescalingsymbols

To mean that x is an element of X, we can write x \in X. However, in the standard packages, the membership symbol that results is too big; it draws too much attention to itself. This is especially evident when we're doing set theory and writing sets as lowercase, as in x \in y. Does anyone one how to draw a less attention-seeking membership symbol?

Best Answer

  • Package mathdesign provides \smallin.
  • \in of package MnSymbol looks smaller than the usual form.

See also "The Comprehensive LaTeX Symbol List".

The example file compares the default with the version of MnSymbol without loading the package (it also changes other symbols):

\documentclass{article}
\DeclareFontFamily{U}{MnSymbolD}{}
\DeclareSymbolFont{MnSyD}{U}{MnSymbolD}{m}{n}
\SetSymbolFont{MnSyD}{bold}{U}{MnSymbolD}{b}{n}
\DeclareFontShape{U}{MnSymbolD}{m}{n}{
    <-6>  MnSymbolD5
   <6-7>  MnSymbolD6
   <7-8>  MnSymbolD7
   <8-9>  MnSymbolD8
   <9-10> MnSymbolD9
  <10-12> MnSymbolD10
  <12->   MnSymbolD12
}{}
\DeclareFontShape{U}{MnSymbolD}{b}{n}{
    <-6>  MnSymbolD-Bold5
   <6-7>  MnSymbolD-Bold6
   <7-8>  MnSymbolD-Bold7
   <8-9>  MnSymbolD-Bold8
   <9-10> MnSymbolD-Bold9
  <10-12> MnSymbolD-Bold10
  <12->   MnSymbolD-Bold12
}{}
\DeclareMathSymbol{\insmall}{\mathrel}{MnSyD}{"3E}
\begin{document}
\[ a\in b \]
\[ a\insmall b\]
\end{document}

Result

Version with scaling

Similar to Enrico Gregorio's solution, but with calculated vertical position with unchanged math axis.

\documentclass{article}
\usepackage{graphicx}
\makeatletter
\newdimen\scalemath@axis
% Macro \scalemath
% #1: math class (\mathrel, \mathbin, ...)
% #2: scale factor
% #3: symbol
\newcommand*{\scalemath}[3]{%
  #1{%
    \mathpalette{\scalemath@aux{#2}}{#3}%
  }%
}
% Macro \scalemath@aux
% #1: factor
% #2: math style
% #3: symbol
\newcommand*{\scalemath@aux}[3]{%
  \begingroup
    \everyvbox{}%
    \settoheight\scalemath@axis{$#2\vcenter{}$}%
    \raisebox{\scalemath@axis}{%
      \scalebox{#1}{%
        \raisebox{-\scalemath@axis}{%
          $\m@th#2#3$%
        }%
      }%
    }%
  \endgroup
}
\makeatother 

\newcommand*{\smallin}{\scalemath{\mathrel}{.75}{\in}}
\newcommand*{\smallni}{\scalemath{\mathrel}{.75}{\ni}}
\newcommand*{\smallnotin}{\scalemath{\mathrel}{.75}{\notin}}

% for testing
\newcommand*{\test}[1]{%
  \[%
    \testaux{#1}^{\testaux{#1}^{\testaux{#1}}}%
    \quad
    \rlap{\scriptsize\texttt{\string#1}}%
  \]%
}
\newcommand*{\testaux}[1]{%
  \testrule\!\!#1\!\!\testrule
}
\newcommand*{\testrule}{%
  \vcenter{\hrule width .5em height .01pt depth .01pt}%
}

\begin{document}
\[ a\in b \ni c \notin d \quad\rlap{\scriptsize(normal)} \]
\[ a\smallin b \smallni c \smallnotin d \quad\rlap{\scriptsize(small)} \]
\test\in
\test\smallin
\test\smallni
\test\smallnotin
\end{document}  

Result