4

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.)

1 Answer 1

7

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

7
  • Why do you use \scalebox? Wouldn't it be better to use \NegHalfEquals for all the commands? One only sees it clearly if one zooms in, but of course it has to happen: \scalebox makes halfellipes out of the halfdiscs at the left and right ends of the =. Oct 16, 2012 at 6:50
  • @HendrikVogt I wanted to reduse the overlapping between the two different symbols, it looked nicer in my PDF viewer. Oct 16, 2012 at 8:25
  • Ah, I see. So I guess for printing one should still prefer \NegHalfEquals. Oct 16, 2012 at 9:38
  • I notice that, when a symbol (e.g. \Implies) is at the beginning of a line, the spacing before it remains. Is there an easy way to have the spacing adjacent to the beginning or end of a line disappear? Oct 16, 2012 at 12:23
  • @user14996 Outside math mode \hspace{...} could be used, but we are in math here. A symbol can be defined and used without the additional spacing for these situations. Oct 16, 2012 at 14:05

You must log in to answer this question.

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