[Tex/LaTex] creating implication and equivalence symbols of intermediate length

math-modespacingsymbols

It is said that using the commands \implies and \iff is preferred over \Rightarrow and \Leftrightarrow, because they give wider spacing around and thus more prominence to the characters. (This other question discusses this.) Alas, I find these symbols a bit too long; this might or might not have to do with my "native" typographic tradition (German).

How can I define implication/equivalence arrow symbols of intermediate length (and I suppose also intermediate spacing)? (Bonus if the solution is a unit that is selected as a single symbol and pastes with the right Unicode codepoints (U+21D2 and U+21D4; I think there are no (longer or whatnot) alternatives), using accsupp I suppose.)

Best Answer

I assume package amsmath is loaded (e.g. needed for \iff).

\implies, \impliedby, and \iff adds a surrounding space of \;, that is space of the amount \thickmuskip. Macro \HalfThickmuskip uses the half of \;.

\implies, \impliedby are composed of the arrow with the equals sign. Macro \HalfRelbar uses the same equals sign, but the width is scaled by factor 0.5. \joinrel fixes the side bearings (horizontal space surrounding the glyph shape) and is adjusted to the smaller side bearings of the scaled equals sign in macro \PartJoinrel.

The case of \iff is different, because it is composed by the two arrows that cannot be scaled without affecting the arrow tips. Here the half width of the equals sign is subtracted.

As assumed, package accsupp is used to get a better Unicode representation of the glyph constructs.

\documentclass{article}
\usepackage[fleqn]{amsmath}

\usepackage{graphics}
\usepackage{accsupp}

\makeatletter
\newcommand*{\HalfRelbar}{%
  \mathrel{%
    \mathpalette\MathResizeHalfWidth=%
  }%
}
\newcommand*{\MathResizeHalfWidth}[2]{%
  \scalebox{.5}[1]{$\m@th#1#2$}%
}
\newcommand*{\HalfThickmuskip}{%
  \mskip.5\muexpr\thickmuskip\relax
}
\newcommand*{\NegHalfEquals}{%
  \mathrel{%
    \mathpalette\@NegHalfEquals=%
  }%
}
\newcommand*{\@NegHalfEquals}[2]{%
  \setbox0=\hbox{$\m@th#1#2$}%
  \kern-.5\wd0 %
}
\newcommand*{\PartJoinrel}{%
  \mathrel{\mkern-2.25mu}% -3mu/2 -1.5mu/2
}

\newcommand*{\Implies}{%
  \DOTSB
  \protect\HalfThickmuskip
  \protect\BeginAccSupp{method=hex,unicode,ActualText=21D2}%
  \protect\HalfRelbar
  \protect\PartJoinrel
  \protect\Rightarrow
  \protect\EndAccSupp{}%
  \protect\HalfThickmuskip
}
\newcommand*{\Impliedby}{%
  \DOTSB
  \protect\HalfThickmuskip
  \protect\BeginAccSupp{method=hex,unicode,ActualText=21D0}%
  \protect\Leftarrow
  \protect\PartJoinrel
  \protect\HalfRelbar
  \protect\EndAccSupp{}%
  \protect\HalfThickmuskip
}   
\newcommand*{\Iff}{%
  \DOTSB
  \protect\HalfThickmuskip
  \protect\BeginAccSupp{method=hex,unicode,ActualText=21D4}%
  \protect\Leftarrow
  \protect\joinrel
  \protect\NegHalfEquals
  \protect\Rightarrow
  \protect\EndAccSupp{}%
  \protect\HalfThickmuskip
}

\makeatother

\begin{document}
\begin{gather*}
  a \implies b_{a \implies b} \\
  a \Implies b_{a \Implies b} \\
  a \Rightarrow b_{a \Rightarrow b} \\
  c \impliedby d_{c \impliedby d} \\
  c \Impliedby d_{c \Impliedby d} \\
  c \Leftarrow d_{c \Leftarrow d} \\
  e \iff f_{e \iff f}\\
  e \Iff f_{e \Iff f} \\
  e \Leftrightarrow f_{e \Leftrightarrow f} \\
\end{gather*}
\end{document}

Result