4

I would like to produce a handful of symbols with the following descriptions:

  • A subset (or rather \subseteq) symbol with the extra line replaced by a 'forward' arrow.
  • A similar symbol with a 'backward' arrow.
  • Equal signs with the lower line replaced by forward or backward arrows.

Browsing the symbols list, I came across stix symbols:

  • \subrarr (and the related \suplarr) which look like exactly the subset symbols I want, but have no reversed arrow variants
  • \dashleftharpoon and \dashrightharpoon, (or indeed the \barleftharpoon variants), but since the symbols I want relate to limits these are not what I'm looking for.

I tried making my own using boxes

\newcommand\subsetlim{\makebox[2\width]{\raisebox{0.5ex}{\scalebox{0.65}
    {$\underleftarrow{\scalebox{1.5}{\makebox[0.95\width][r]{$\subset$}}}$}}}}
\newcommand\subsetcolim{\makebox[2\width]{\raisebox{0.5ex}{\scalebox{0.65}
    {$\underrightarrow{\scalebox{1.5}{\makebox[0.95\width][r]{$\subset$}}}$}}}}
\newcommand\eqlim{\makebox[2\width]{\raisebox{0.6ex}{\scalebox{0.5}
    {$\underleftarrow{\scalebox{2}{\makebox[\width][c]{\---}}}$}}}}

but the rescaling necessary to make the arrow line up nicely results in varied line thickness in the first case, and there seems to be an unavoidably large ugly gap in the second case, whatever symbol I use for the dash.

I have seen solutions to similar problems given in pgf commands, which is fine, but I have not yet come across a definitive guide for resolving this kind of problem; I came up with my solutions based on the basic 'boxes' info in the LaTeX WikiBooks, which I feel is inadequate (especially considering that this is their page on \hbox, which I have seen used liberally in many custom typesetting constructions).

Once I've constructed my symbol, how do I ensure the surrounding spacing is correct (I know about the \mathop, \mathbin etc commands, but these rely on the symbol box being exactly the right size in the first place), or that the line widths consistent with the surrounding text/symbols?

1 Answer 1

2

Using stacks, but in this case, I only lay a scaled black triangle atop of the underlying symbol. As presented below, my first MWE will not work in smaller math styles. If that is needed, see my 2nd MWE.

The symbols are designed to take up the same horizontal space as their underlying roots (i.e., \subseteq and/or =).

\documentclass{article}
\usepackage{amssymb,stackengine,graphicx}
\stackMath
\newcommand\frightarrow{\scalebox{.4}[.3]{$\blacktriangleright$}}
\newcommand\fleftarrow{\scalebox{.4}[.3]{$\blacktriangleleft$}}
\newcommand\subsetrleads{\mathrel{%
  \stackengine{-1pt}{\subseteq}{\frightarrow}{U}{r}{F}{T}{S}}}
\newcommand\eqrleads{\mathrel{%
  \stackengine{-2.4pt}{=}{\frightarrow}{U}{r}{F}{T}{S}}}
\newcommand\subsetlleads{\mathrel{%
  \stackengine{-1pt}{\subseteq}{\fleftarrow}{U}{l}{F}{T}{S}}}
\newcommand\eqlleads{\mathrel{%
  \stackengine{-2.4pt}{=}{\fleftarrow}{U}{l}{F}{T}{S}}}
\begin{document}
$A \subseteq B\subsetrleads C$

$A = B\eqrleads C$

$A \subseteq B\subsetlleads C$

$A = B\eqlleads C$
\end{document}

enter image description here

Here's a version that works across math styles:

\documentclass{article}
\usepackage{amssymb,stackengine,graphicx,scalerel}
\stackMath
\newcommand\frightarrow{\scalebox{.4}[.3]{$\SavedStyle\blacktriangleright$}}
\newcommand\fleftarrow{\scalebox{.4}[.3]{$\SavedStyle\blacktriangleleft$}}
\newcommand\subsetrleads{\mathrel{\ThisStyle{%
  \stackengine{\dimexpr-.7\LMpt-.3pt}{\SavedStyle\subseteq}{\frightarrow}{U}{r}{F}{T}{S}}}}
\newcommand\eqrleads{\mathrel{\ThisStyle{%
  \stackengine{\dimexpr-2.45\LMpt+0.05pt}{\SavedStyle=}{\frightarrow}{U}{r}{F}{T}{S}}}}
\newcommand\subsetlleads{\mathrel{\ThisStyle{%
  \stackengine{\dimexpr-.7\LMpt-.3pt}{\SavedStyle\subseteq}{\fleftarrow}{U}{l}{F}{T}{S}}}}
\newcommand\eqlleads{\mathrel{\ThisStyle{%
  \stackengine{\dimexpr-2.45\LMpt+0.05pt}{\SavedStyle=}{\fleftarrow}{U}{l}{F}{T}{S}}}}
\begin{document}
$A \subseteq B\subsetrleads C$

$A = B\eqrleads C$

$A \subseteq B\subsetlleads C$

$A = B\eqlleads C$

$\scriptstyle A \subseteq B\subsetrleads C$

$\scriptstyle A = B\eqrleads C$

$\scriptscriptstyle A \subseteq B\subsetlleads C$

$\scriptscriptstyle A = B\eqlleads C$
\end{document}

enter image description here

ADDENDUM

Based on an OP follow up, here is a version of the fixed-style version in which the arrow conforms exactly to the end of the horizontal stroke, rather than extending past it. It does this by clipping off the tip of the black triangle, and using the rounded end of the underlying stroke to serve as the arrow tip.

\documentclass{article}
\usepackage{amssymb,stackengine,graphicx,trimclip}
\stackMath
\newcommand\frightarrow{\scalebox{.4}[.3]{%
  \clipbox{0pt 0pt 2pt 0pt}{$\blacktriangleright$}\kern1.8pt}}
\newcommand\fleftarrow{\scalebox{.4}[.3]{%
  \kern1.8pt\clipbox{2pt 0pt 0pt 0pt}{$\blacktriangleleft$}}}
\newcommand\subsetrleads{\mathrel{%
  \stackengine{-1.1pt}{\subseteq}{\frightarrow\kern.3pt}{U}{r}{F}{T}{S}}}
\newcommand\eqrleads{\mathrel{%
  \stackengine{-2.43pt}{=}{\frightarrow}{U}{r}{F}{T}{S}}}
\newcommand\subsetlleads{\mathrel{%
  \stackengine{-1.1pt}{\subseteq}{\kern.4pt\fleftarrow}{U}{l}{F}{T}{S}}}
\newcommand\eqlleads{\mathrel{%
  \stackengine{-2.43pt}{=}{\fleftarrow}{U}{l}{F}{T}{S}}}
\begin{document}
$A \subseteq B\subsetrleads C$

$A = B\eqrleads C$

$A \subseteq B\subsetlleads C$

$A = B\eqlleads C$
\end{document}

enter image description here

5
  • This is very close to what I want (I think I will probably use the first solution since I don't need too many different styles) but I have some questions: 1. Can you make the tip of the arrow align with the subset tips in the forward arrow case? 2. What is the \SavedStyle command in the definition in the second solution? Aug 2, 2017 at 13:15
  • @MorganRogers To your 1st question: Since the horizontal line in = and \subseteq do not come to a point, aligning the triangle exactly to the end of those strokes would destroy the pointiness of the triangles. To overcome this, one could possibly clip the tip of the triangle or overlay a white block over the end of the line stroke, but this will make the glyph construction much more complicated. Aug 2, 2017 at 13:19
  • @MorganRogers To your 2nd point, the \SavedStyle works inside the argument of \ThisStyle. It is part of my scalerel package and provides a way to save the current math style (\ThisStyle) and recall it (\SavedStyle) in places where it would otherwise get lost (e.g., inside LaTeX boxes). It provides a more compact invocation than\mathchoice, which is the standard LaTeX way of handling different math styles. Aug 2, 2017 at 13:22
  • @MorganRogers Please see addendum. Aug 2, 2017 at 13:54
  • I prefer this rounded arrow style, it works better with the font. Thanks again for the comprehensiveness of your answer. Aug 2, 2017 at 14:14

You must log in to answer this question.

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