[Tex/LaTex] Shorter line for math-mode

math-mode

I have

$A-V$

but the line "-" is shown too long:

enter image description here

I would like to have shorter line.

How can you have a shorter line there in the math-mode?

Best Answer

A hyphen in math mode is interpreted as a minus sign. If you mean to have a variable named A-V in math mode, with a hyphen in between, you need to define a “math hyphen” or resort to $A\text{-}V$.

For defining a math hyphen you can do

\DeclareMathSymbol{\mh}{\mathord}{operators}{`\-}

Full example:

\documentclass{article}
\usepackage{amsmath}

\DeclareMathSymbol{\mh}{\mathord}{operators}{`\-}

\begin{document}

$A\mh V$

$A\text{-}V$

\end{document}

enter image description here

The first option, with \mh (or the name you prefer), is better.

Of course, if this is not a variable, but you're referring to two variables in some text, the correct input would be

$A$\nobreakdash-$V$
Related Question