4

I would like to use a symbol that looks like an equality symbol, but with one arrow on one of the sides of the lines that indicates an orientation.

(for instance when manipulating possibly undefined expression and indicate that definiteness of one side implies that of the other)

The closest thing I found are the $\rightbarharpoon$ and $\leftbarharpoon$ from the mathabx package. But the symbol does not really evoke an equality to me: too long, the two lines too close to each other.

Any suggestions?

percusse
  • 157,807
Marc
  • 701
  • 1
    would something like unicode U+296C or U+296A suit? or do they also appear too long? (those would be in the xits or stix fonts.) if they are too long, then i think what you want hasn't been implemented; i've never seen them in the proportions you describe. – barbara beeton Mar 18 '15 at 19:11
  • Could do, but you need xetex or something like this load these fonts, right? – Marc Mar 18 '15 at 22:08

2 Answers2

4

Here is a solution which can be used with (pdf)latex. Igive a ‘long’ version and a short version of harpoon equality (not perfect, as it uses \resizebox to adjust the length of the symbol):

\documentclass{article}

\usepackage{mathtools}
\usepackage{graphicx}

\newcommand{\rightharpoonupeq}{\mathrel{%
\raise.22ex\hbox{$\rightharpoonup $}%
\setbox0=\hbox{$\relbar\mkern-9.1mu\relbar$}%
\kern -.98\wd0 \lower.22ex\box0}}%
%
\newcommand{\leftharpoonupeq}{\mathrel{%
\raise.22ex\hbox{$\leftharpoonup $}%
\setbox0=\hbox{$\relbar\mkern-9.1mu\relbar$}%
\kern -.98\wd0 \lower.22ex\box0}}%

\newcommand{\rightharpoondowneq}{\mathrel{%
\lower.22ex\hbox{$\rightharpoondown$}%
\setbox0=\hbox{$\relbar\mkern-9.1mu\relbar$}%
\kern -.98\wd0 \raise.22ex\box0}}%

\newcommand{\leftharpoondowneq}{\mathrel{%
\lower.22ex\hbox{$\leftharpoondown$}%
\setbox0=\hbox{$\relbar\mkern-9.1mu\relbar$}%
\kern -.98\wd0 \raise.22ex\box0}}%


\newcommand{\shortrightharpoonupeq}{\mathrel{%
\resizebox{\widthof{$=$}}{\height}{%
\raise.22ex\hbox{$\rightharpoonup $}%
\setbox0=\hbox{$\relbar\mkern-9.1mu\relbar$}%
\kern -.98\wd0 \lower.22ex\box0}}}%
%%
\newcommand{\shortleftharpoonupeq}{\mathrel{%
\resizebox{\widthof{$=$}}{\height}{%
\raise.22ex\hbox{$\leftharpoonup $}%
\setbox0=\hbox{$\relbar\mkern-9.1mu\relbar$}%
\kern -.98\wd0 \lower.22ex\box0}}}%

\newcommand{\shortrightharpoondowneq}{\mathrel{%
\resizebox{\widthof{$=$}}{\height}{%
\lower.22ex\hbox{$\rightharpoondown$}%
\setbox0=\hbox{$\relbar\mkern-9.1mu\relbar$}%
\kern -.98\wd0 \raise.22ex\box0}}}%

\newcommand{\shortleftharpoondowneq}{\mathrel{%
\resizebox{\widthof{$=$}}{\height}{%
\lower.22ex\hbox{$\leftharpoondown$}%
\setbox0=\hbox{$\relbar\mkern-9.1mu\relbar$}%
\kern -.98\wd0 \raise.22ex\box0}}}%



\begin{document}

\begin{alignat*}{2}%
  \texttt{`Long' version} & :\qquad & A & = B \\
                                & & A & \rightleftharpoons B \\
                                & & A & \rightharpoonupeq B\leftharpoonupeq C \\
                                & & A & \rightharpoondowneq B \leftharpoondowneq C \\[4ex]
  \texttt{`Short' version} & :\qquad & A & = B \\
                                & & A & \shortrightharpoonupeq B\shortleftharpoonupeq C \\
                                & & A & \shortrightharpoondowneq B \shortleftharpoondowneq C
\end{alignat*}
\end{document}

enter image description here

Bernard
  • 271,350
  • \textttt was faulty, and I forgot to change the quotes also for short… It's corrected now. – Bernard Mar 19 '15 at 00:13
  • Works well, thanks. One thing though: the $\relbar\mkern-9.1mu\relbar$ doesn't display very well on my pdf reader, superposing to relbars seems to create an artifact. – Marc Mar 19 '15 at 18:49
  • Could you describe precisely what you see? I checked it was OK with SumatraPDF and Adobe Reader, at a magnification of 6400 %. Did you try to zoom, to see whaat happens? – Bernard Mar 19 '15 at 19:17
  • When I zoom in, it disappears. So this is probably the pdf reader (evince on ubuntu) trying to be smarter than everyone. Basically on the area where the two relbars overlap, there is a slight dark blur that makes the lower bar look a bit thicker. Nevermind, that was more to let you know, I think I'll be using your solution as is. – Marc Mar 19 '15 at 21:29
  • Actually if you look close carefully enough, it is discernible on the images you posted to illustrate your commands. – Marc Mar 19 '15 at 21:31
  • It's not the first time I see Evince mentioned for display problems. Did you try to see what happens with Ghostscript? – Bernard Mar 19 '15 at 21:32
  • I've tried various readers, all exhibit a similar behavior. I guess this has to do with anti-aliasing, and the only way I see to avoid that would be to use \rule instead of \relbar, but this is a mess to get right (interaction with \kern... but I basically know nothing about plain TeX) – Marc Mar 20 '15 at 14:56
  • I'll try when I have a moment — although I'm no expert either. – Bernard Mar 20 '15 at 16:07
3

With help of Lua- or XeLaTeX you may want to take one of the following unicodes and fonts. If you think the symbols are too long, you may want to trim them like shown in the end. The last approach can be done with the symbols of mathabx as well and therefore may be compiled with pdfLaTeX.

enter image description here

% arara: lualatex

\documentclass{article}
\usepackage{mathtools}
\usepackage{unicode-math}
\usepackage{trimclip}

\newcommand*{\rightequal}{\mathrel{\clipbox{1.95999pt 0pt .45pt 0pt}{$\rightharpoonupdash$}}}
\newcommand*{\leftequal}{\mathrel{\clipbox{.45pt 0pt 1.95999pt 0pt}{$\leftharpoonupdash$}}}

\begin{document}
\setmathfont{Asana Math}
$A= A \equalrightarrow B = B \equalleftarrow A = A$ % U+2971 and U+2972

$A= A \rightharpoonupdash B = B \leftharpoonupdash A = A$ % U+296C and U+296A

\setmathfont{STIX Math}
$A= A \equalrightarrow B = B \equalleftarrow A = A$

$A= A \rightharpoonupdash B = B \leftharpoonupdash A = A$

\begin{align*}
A&\rightequal B\\
A &= B\\
A&\leftequal B
\end{align*}
\end{document}

enter image description here

LaRiFaRi
  • 43,807
  • Thanks, this looks like a good option. Indeed I should have mentioned that something working with pdflatex would be preferable.

    Could you explain what is happening in the definition \mathrel{\mathpalette\laux\relax}}?

    (what are the relax, mathpalette, mathrel for?

    – Marc Mar 18 '15 at 22:19
  • @Marc Sorry, the mathpalette was used falsely. I removed that. The \mathrel is needed to make the clipped symbol a relation symbol again (which it has been before.) – LaRiFaRi Mar 19 '15 at 07:40