Is there a way to produce a space that disappears at the beginning or end of a math formula?
Idea: For the formula-final case, something that looks ahead or takes an obligatory argument might be a start. I remember that commands whose obligatory arguments are terminated by the end of a math formula will be fed empty arguments.
Some practical examples:
Example 1
The uniqueness quantifier ("there exists exactly one") is often written "∃!".
Out of visual considerations I would like the following variable to be a bit away from the exclamation mark, to make it clearer that "∃!" is considered a single token ("token" here in the sense of parsing in a programming language). I can define something like \newcommand*{\existsunique}{\exists!\mskip1.5mu\relax}
, but the space of 1.5mu
remains if the symbol is used by itself:
\documentclass{article}
\usepackage{amsmath} % better spacing behavior for \colon
\usepackage{dsfont}
\newcommand*{\existsunique}{\exists!\mskip1.5mu\relax}
\begin{document}
% spacing (1.5mu) as desired
\(\forall x \in \mathds{R}^{+}_{0} \colon
\existsunique y \in \mathds{R}^{+}_{0} \colon
y^2 = x\)
% spacing (0mu) too tight
\(\forall x \in \mathds{R}^{+}_{0} \colon
\exists! y \in \mathds{R}^{+}_{0} \colon
y^2 = x\)
% spacing (1.5mu) superfluous
The quantifier \(\existsunique\) means ``there is exactly one''.
% spacing (0mu) as desired
The quantifier \(\exists!\) means ``there is exactly one''.
\end{document}
Here the first lines of each pair have additional spacing of 1.5mu
after the uniqueness quantifier "∃!", while the second lines of each pair don't. For the first pair, the added spacing is as desired; for the second pair, it doesn't look good.
In this example, I would like a 1.5mu
space that disappears at the end of a formula: the same macro should produce lines 1 and 4 above. Perhaps there is a different approach to "∃!", but this serves as one practical example to my general question above.
Example 2
For Heiko Oberdiek's intermediate-length arrows
\Implies
(between\Rightarrow
and\implies
in length)\Impliedby
(between\Leftarrow
and\impliedby
in length)\Iff
(between\Leftrightarrow
and\iff
in length)
defined here, contextual deletion of spacing is desirable on both sides.
\existsunique
command, such like\,
or\:
(if you prefer it bigger).\mathbin{\exists!}
works... somewhat.\mathop
, but I'd like narrower spacing.$\mathop{\exists!}x$
, the space between the exclamation mark and the variable is a thin space. Less than this would be almost indistinguishable from no space. Your "idea" is not really correct.\existsunique
as\exists\mkern-1.5mu!
, rather than adding the space at the right.