2

I want a symbol similar to \gtreqless, but replace the horizontal line in the middle with a wavy line like \sim. How to create this symbol in LaTeX?

0

3 Answers 3

6

is U+2A90 which may be used as \gsiml with unicode-math for lualatex or xelatex, or compatible packages for pdflatex such as stix2

0
2

As written in the answer of @David Carlisle I have taken only the symbol \gsiml from the stix package. Note che the symbol is also big and I have rescaled using scalerel package. I think that the size .6 that you see in \newcommand{\gsimt}{\mathrel{\scaleobj{.6}{\gsiml}}} is good. You can see the differences between the rescaled symbol and the original.

%% Compile and read me!
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{scalerel}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% declared only one symbol \gsiml from stix package
\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix}{m}{n}
\DeclareSymbolFont{symbols3}{LS1}{stixbb}{m}{n}
\DeclareMathSymbol{\gsiml}{\mathrel}{symbols3}{"E0}
\newcommand{\gsimt}{\mathrel{\scaleobj{.6}{\gsiml}}}
\begin{document}
$a\gsimt b \gsiml c$
\end{document}

enter image description here

Integrate with @campa's answer:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\DeclareFontEncoding{LS1}{}{}
\DeclareFontSubstitution{LS1}{stix}{m}{n}

\makeatletter
\newcommand*{\gsiml}{\mathrel{\text@{\usefont{LS1}{stixbb}{m}{n}\char"E0}}}
\makeatother
\begin{document}
$\Theta\gsiml \Xi$
\end{document}

enter image description here

5
  • 1
    \newcommand*{\gsiml}{\mathrel{\text@{\usefont{LS1}{stixbb}{m}{n}\char"E0}}} would avoid wasting a math family for a single glyph (at the cost of slower processing).
    – campa
    Commented Jun 12 at 7:36
  • @campa I have used your newcommand but I have an error of compilation: ! LaTeX Error: Encoding scheme LS1 unknown.`
    – Sebastiano
    Commented Jun 12 at 19:11
  • Erm, well, the \DeclareFontEncoding and \DeclareFontSubstitution must remain. THe problem is \DeclareMathSymbol.
    – campa
    Commented Jun 12 at 19:15
  • @campa I have followed your suggestion but I see only @ instead of symbol. Please, can you edit, putting your name, my answer?
    – Sebastiano
    Commented Jun 12 at 19:26
  • 2
    Using \text@ requires using \makeatletter/\makeatother.
    – campa
    Commented Jun 12 at 19:27
2

You can build it. The adjustments inside \noalign are font dependent.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newcommand{\gtrsimless}{\mathrel{\mathpalette\glsim@{><}}}
\newcommand{\lesssimgtr}{\mathrel{\mathpalette\glsim@{<>}}}

\newcommand{\glsim@}[2]{\glsim@@#1#2}
\newcommand{\glsim@@}[3]{%
  \vcenter{\offinterlineskip\m@th
    \ialign{\hfil##\hfil\cr
      $#1#2$\cr
      \noalign{\sbox\z@{$#1\mkern1mu$}\kern\wd\z@}
      $#1\sim$\cr
      \noalign{\sbox\z@{$#1\mkern0.5mu\nonscript\mkern1mu$}\kern-\wd\z@}
      $#1#3$\cr
    }%
  }%
}
\makeatother

\begin{document}

$a \gtrsimless b \lesssimgtr c$

$\scriptstyle a \gtrsimless b \lesssimgtr c$

\end{document}

enter image description here

2
  • Maybe an l3 version would be nice to see the updated code usage.
    – azetina
    Commented Jun 14 at 2:35
  • @azetina There is currently no expl3 interface to \halign.
    – egreg
    Commented Jun 14 at 12:30

You must log in to answer this question.

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