Invisible text (\phantom) with kerning?

In my answer to another question, I've used an upside-down A as a V-with-strikethrough character. After playing with it a bit, I've realized that this doesn't give appropriate kerning if the character is followed by a subscript, presumably because the A is placed in a rotatebox.

It seems that the best way to get around this is to place the upside-down A in a zero-width box using llap/rlap and then insert an invisible V, so that the same kerning as would be used for a regular V is applied. Unfortunately, if I use \phantom{V}, it seems that result is a box (no kerning).

Is there a \phantom-like function which makes the character invisible/non-selectable but maintains the same kerning?

Edit: I came up with a hack which checks to see whether the following text is subscript, then applies kerning if it is. The key component is

\@ifnextchar_{\kern-0.17em}{}
% if the next char is "_", add negative kerning
% otherwise, do nothing


And the full \Vol command is then

\makeatletter
\newcommand{\Vol}{\rotatebox[origin=c]{180}{\ensuremath{A}}\@ifnextchar_{\kern-0.17em}{}}
\makeatother


Nonetheless, if there is a more elegant way of keeping the exact kerning from the original V, I'd be interested to hear about it.

• Can you use \forall, which is already an upside-down A? – Arun Debray Dec 5 '15 at 8:10
• It's similar, but it doesn't have serifs and isn't ever placed in italics, so it doesn't come out looking much like a crossed-out V. Also, what if I wanted to write "for all volumes V" in math? :p – user1476176 Dec 5 '15 at 8:13
• fair enough. I had a very similar issue when I needed to TeX an ∃xt operator, and \exists didn't work so well, but I didn't address its kerning. – Arun Debray Dec 5 '15 at 8:26
• You're using text stuff for maths. I'm not very good with this, but there are distinct commands for use in maths. Kerning in the ordinary text sense isn't used in maths mode, that I know of. You should define this properly as a maths symbol so that you benefit from the automatic adjustments made to spacing etc. – cfr Dec 6 '15 at 1:56
• Unfortunately, a \phantom can never be the nucleus of a math atom (it yields a different type of node, a “four-way choice”), so it cannot carry a subscript. – GuM Sep 29 '17 at 9:57

You can use an ordinary math-mode V and \put a horizontal line where you need it. It won't scale, but it's easily adjustable.

\newcommand{\Vol}{\rotatebox[origin=c]{180}{\ensuremath{A}}}
\newcommand{\volume}{\put(2,4){\line(1,0){3}}V}


However, the desired symbol is not really an upside-down A, but rather a V with a horizontal strike-through as seen here:

So instead of using \ooalign as in the original solution without subscripts, you can use \rlap as in the macro:

\newcommand{\volsym}{\rlap{\kern.08em--}V}


Then $\volsym_n$ will produce the output

This has the additional advantage of providing the correct spacing to the left of the volume element in the Reynolds transport theorem:

Using \ooalign:

Using \rlap:

The \rlap version will scale with size (\tiny, \large, \Huge, etc.), but a separate macro is needed if the volume symbol appears in a subscript. Even \mathchoice won't work since it separates the choices from the subscript and results in the same bad kerning.

\newcommand{\volsubsym}{\rlap{\scriptsize\kern.08em--}V}


will produce the correct scripted version. So $M_{\volsubsym_n}$ will produce

If (for reasons I cannot imagine) you needed a scriptscript size, you could use

\newcommand{\volsubsubsym}{\rlap{\tiny\kern.08em--}V}


Here is the complete code:

\documentclass{article}

\newcommand{\volume}{\mathop{\ooalign{\hfil$V$\hfil\cr\kern0.08em--\hfil\cr}}\nolimits}

\newcommand{\volsym}{\rlap{\kern.08em--}V}
\newcommand{\volsubsym}{\rlap{\scriptsize\kern.08em--}V}

\newcommand{\dd}{\mathrm{d}}

\begin{document}
\noindent Let $\volume_n$ represent system volume. (using \verb\ooalign---bad kerning)
\newline Let $V_n$ represent system volume. (math V)
\newline Let $\volsym_n$ represent system volume. (using \verb\rlap---correct kerning)
\bigskip
\newline As a subscript, $M_{\volsubsym_n}$ renders correctly.

$\frac{\dd}{\dd t}\int_{\Omega(t)}\mathbf{f}\,\dd\volume\qquad \frac{\dd}{\dd t}\int_{\Omega(t)}\mathbf{f}\,\dd\volsym$

\end{document}