2

I would like to create a symbol denoting a map onto itself. Is there a way to only get the arrow tip from \leftarrow (to match the arrow head of e.g. \to) since \leftarrow is too long? The arrow head from the lasy fonts is unfortunately smaller as shown in this answer. Furthermore, the symbol is shifted slightly downwards. How can I align it correctly? Should I use \ooalign or array instead?

\documentclass{article} \newcommand{\toitself}{\mathrel{\vcenter{\offinterlineskip\hbox{$\leftarrow$}\kern-0.63ex\hbox{$\supset$}}}} \begin{document} $f\colon D \toitself \supset \quad \toitself_{\toitself_{\toitself}} \supset_{\supset_{\supset}} \leftarrow_{\leftarrow_{\leftarrow}}$ \end{document} 

The constructed symbol

5
  • 2
    You could use U+2b8c Commented Sep 9, 2024 at 21:36
  • @DavidCarlisle Thank you, that's great! Is there a latex math font including this character? Commented Sep 9, 2024 at 21:43
  • 1
    hmm it doesn't seem to be in most math fonts but is in the Segoe Windows symbol font so this works in windows with xelatex or lualatex \documentclass{article} \usepackage{fontspec} \newfontfamily\sui{Segoe UI Symbol} \begin{document} $a \mathrel{\mbox{\sui⮌}} b$ \end{document} output Commented Sep 9, 2024 at 22:48
  • @DavidCarlisle Thank you! It doesn't match the Computer Modern fonts but it's a nice alternative. Commented Sep 10, 2024 at 15:51
  • Yes when I originally suggested that code point I thought it would be in at least some of the opentype math fonts but it seems not, just in the larger textual symbol fonts, so I think I'll leave the comment but not post an answer. Commented Sep 10, 2024 at 16:43

2 Answers 2

2

You can clip the arrow. Complications arise due to the peculiar bounding box of arrows in Computer Modern fonts.

\documentclass{article} \usepackage{amsmath} \usepackage{trimclip} \makeatletter \newcommand{\toitself}{\mathrel{\mathpalette\toitself@\relax}} \newcommand{\toitself@}[2]{% \vbox{% \sbox\z@{$#1\supset$} \hbox{\clipbox{0 {-0.1\height} {0.65\width} {-0.4\height}}{$\m@th#1\leftarrow$}} \nointerlineskip \kern-0.57\ht\z@ \ifx#1\scriptstyle\kern0.03\ht\z@\fi \ifx#1\scriptscriptstyle\kern0.04\ht\z@\fi \hbox{$\m@th#1\supset$} }% } \makeatother \begin{document} $f\colon D \toitself \supset$ $\scriptstyle\toitself \scriptscriptstyle\toitself$ \fboxsep=0pt \fboxrule=0.1pt \fbox{$\toitself$} {\large$\toitself$} {\small$\toitself$} {\footnotesize$\toitself$} \end{document} 

output

3
  • Thank you very much! Commented Sep 10, 2024 at 15:48
  • I think \makeatother at the end is missing. Commented Sep 10, 2024 at 15:59
  • @EuklidAlexandria Yes, fixed. Thanks for noting. Commented Sep 10, 2024 at 16:01
3

My solution uses pgf. You will be able to adjust the width of the horizontal lines, the height, the line width, the arrow type, or even the baseline.

\documentclass{article} \usepackage{tikz} \newdimen\toitselfhlinewd \newdimen\toitselfht \def\toitself{ \toitselfhlinewd=0.3em \toitselfht=0.5em \mathrel{ \pgfpicture %\pgfsetbaseline{0pt} \pgfsetarrowsend{>} \pgfpathmoveto{\pgfpoint{0pt}{0pt}} \pgfpathlineto{\pgfpoint{\toitselfhlinewd}{0pt}} \pgfpatharc{-90}{90}{0.5\toitselfht} \pgfpathlineto{\pgfpoint{0pt}{\toitselfht}} \pgfusepath{stroke} \endpgfpicture } } \begin{document} $f\colon D \toitself F$ \end{document} 

enter image description here

2
  • Thank you very much! The arrow head does not exactly match the Computer Modern one but I like the customizability. Commented Sep 10, 2024 at 15:55
  • You can add \pgfsetroundcap before \pgfusepath too ;) Commented Sep 10, 2024 at 17:05

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.