9

Is there a better way to get the symbol produced by V\llap{--}? I need it in math mode. The symbol is someitmes used to represent volume. The above hack is not the right symbol but something close.

mythealias
  • 3,621

5 Answers5

15
\documentclass{article}
\newcommand{\volume}{{\ooalign{\hfil$V$\hfil\cr\kern0.08em--\hfil\cr}}}
\begin{document}
$\volume(abc)$
\end{document}

enter image description here

A better implementation, where the dash is built as above, but over a phantom V; the real one is added later, so subscripts and superscripts are placed with respect to it.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\DeclareRobustCommand{\volume}{\text{\volumedash}V}
\newcommand{\volumedash}{%
  \makebox[0pt][l]{%
    \ooalign{\hfil\hphantom{$\m@th V$}\hfil\cr\kern0.08em--\hfil\cr}%
  }%
}
\makeatother

\begin{document}

$d\volume(abc)$

$x^{}_{\volume}$

$\volume_x$

$V_x$

\end{document}

enter image description here

egreg
  • 1,121,712
  • There are kerning issues here if you want a subscript, as in \volume_n. Also, as a differential, \mathrm{d}\volume has incorrect spacing. This issue is addressed in a solution to another question. Are there any issues with that solution? – Sandy G Jan 10 '18 at 20:15
  • @SandyG The subscript problem is solved by using a phantom V in the \ooalign and a real V afterwards. Thanks for pointing to the weakness of the original macro. – egreg Jan 10 '18 at 22:48
1

I was looking for the same thing, but found it a bit distracting to have the cross extend beyond the lines of the V. I came up with an alternative approach:

\documentclass{article}

\usepackage{graphicx}

\newcommand{\Vol}{\rotatebox[origin=c]{180}{\ensuremath{A}}}

\begin{document}
    Let $\Vol$ represent system volume.
\end{document}

Result

user1476176
  • 1,225
0

Here you go. Inspired by @egreg's answer. You can adjust the position parameters in the code.

\ooalign{$V$\cr\raisebox{0.15em}{\kern0.04em--}\cr}

enter image description here

vinc
  • 1
0

Another simple alternative using \makebox command with the same name of @egreg's named \volume:

\documentclass[a4paper,12pt]{article}
\newcommand{\volume}{\makebox[1pt][l]{$-$}V}
\begin{document}
\[\frac{d\volume(x,y,z)}{dz}\]
\end{document}

enter image description here

Sebastiano
  • 54,118
0

This is how to get it on Google Slides:

  V\kern-0.8em\raise0.3ex-

Resulting in:

cross V

In Google Docs Addon Math equations, many of the commands, in the neat solutions provided here, are not supported: \ooalign, \raisebox, \cr, \hfill. Instead, using a simple \raise and \kern helps. This is not a generic solution that handles sub- and super-scripts. In slides, we normally want a quick solution that can be easily edited locally, and the expressions are small and local to a slide. Playing around with kern and raise can still work for sub- and super-scripts.

Sunthar
  • 141
  • 4
  • This doesn't work in (La)TeX. It might work on Google Slides but that's off-topic here. – campa Jan 15 '21 at 18:16