3

How do I make an almost normal subgroup symbol? It looks like:

$\underset{\sim}{\triangleleft}$ 

enter image description here

But this has too much of a space between the triangle and the tilda. The result looks skewed in my paper.

CarLaTeX
  • 62,716
Lyndsay
  • 31
  • 3
    The first step is to go through The Comprehensive LATEX Symbol List at http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf – John Kormylo Aug 11 '16 at 15:03
  • Or, if there's a specific math symbol you want, you can use detexify. I guess, what specifically do you want? – auden Aug 11 '16 at 15:07
  • @heather -- this is a single two-part symbol. no space. it's rather like \lessim, but with a triangle instead of the less than. – barbara beeton Aug 11 '16 at 15:08
  • this symbol doesn't seem to be in unicode. if you can provide a reference to its use in a published source, i'll be happy to submit it for consideration. – barbara beeton Aug 11 '16 at 21:09

3 Answers3

4

The optional argument to \stackunder allows the gap to be specified.

EDITED to accomplish 2 goals, with the added use of the scalerel package: 1) realign the symbol to take up the same vertical footprint as the letter "A" (per OP's request); and 2) make it work across math styles.

\documentclass{article}
\usepackage{amsmath,stackengine,scalerel}
\def\newsym{\mathrel{\scalerel*{\ensurestackMath{\stackunder[1pt]{\triangleleft}{%
  \scriptscriptstyle\mkern1mu\sim}}}{A}}}
\begin{document}
$A \newsym B \quad\scriptstyle 
A \newsym B \quad\scriptscriptstyle 
A \newsym B$
\end{document}

enter image description here

ORIGINAL SOLUTION

\documentclass{article}
\usepackage{amsmath,stackengine}
\def\newsym{\mathrel{\ensurestackMath{\stackunder[1pt]{\triangleleft}{%
  \scriptscriptstyle\mkern1mu\sim}}}}
\begin{document}
$A \newsym B$
\end{document}

enter image description here

1

You may want to use a smaller \sim symbol:

\documentclass{article}
\usepackage{amsmath,amssymb}

\DeclareFontFamily{OMS}{smallcmsy}{\skewchar\font48 }
\DeclareFontShape{OMS}{smallcmsy}{m}{n}{%
  <-5.5>    s*[.65] cmsy5
  <5.5-6.5> s*[.65] cmsy6
  <6.5-7.5> s*[.65] cmsy7
  <7.5-8.5> s*[.65] cmsy8
  <8.5-9.5> s*[.65] cmsy9
  <9.5->    s*[.65] cmsy10
}{}
\DeclareFontShape{OMS}{smallcmsy}{b}{n}{%
  <-5.5>    s*[.65] cmbsy5
  <5.5-6.5> s*[.65] cmbsy6
  <6.5-7.5> s*[.65] cmbsy7
  <7.5-8.5> s*[.65] cmbsy8
  <8.5-9.5> s*[.65] cmbsy9
  <9.5->    s*[.65] cmbsy10
}{}

\DeclareSymbolFont{smallsymbols}{OMS}{smallcmsy}{m}{n}
\SetSymbolFont{smallsymbols}{bold}{OMS}{smallcmsy}{b}{n}
\DeclareMathSymbol{\smallsim}{\mathrel}{smallsymbols}{"18}


\makeatletter
\newcommand{\ansg}{\mathrel{\lyndsay@ansg}}
\newcommand{\lyndsay@ansg}{\mathpalette\lyndsay@@ansg\relax}
\newcommand{\lyndsay@@ansg}[2]{%
  \vbox{
    \m@th\offinterlineskip
    \halign{\hfil##\hfil\cr
      $#1\triangleleft$\cr
      \noalign{\kern.5pt}
      $#1\smallsim$\cr
      \noalign{\kern-.5pt}
    }
  }%
}
\makeatother

\begin{document}

$A\ansg B_{C\ansg D}$

\end{document}

enter image description here

egreg
  • 1,121,712
0

Adding \raisebox, as suggested here: Shifting a symbol vertically in Math mode, to Steven's original solution:

\documentclass{article}
\usepackage{amsmath,stackengine}

\def\newsym{\mathbin{\ensurestackMath{\stackunder[1pt]{\triangleleft}{%
  \scriptscriptstyle\mkern1mu\sim}}}}

\def\newsymraised{\mathrel{\raisebox{2pt}{$\mathbin{\ensurestackMath{\stackunder[1pt]{\triangleleft}{%
  \scriptscriptstyle\mkern1mu\sim}}}$}}}

\begin{document}

Steven's original solution:
$A \newsym B$ \\

With raisebox:
$A \mathrel{\raisebox{2pt}{$\newsym$}} B$ \\

Creating a newcommand with raisebox:
$A \newsymraised B$%

\end{document}

enter image description here

CarLaTeX
  • 62,716