2

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?

  • 1
    Is it not a minus sign? Load amsmath and use $A\text{ - }V$ – user11232 Nov 3 '15 at 23:07
  • 2
    $A{-}V$ will reduce the spacing, while $A\mbox{-}V$ will change the font and therefore not set - as a minus. – Werner Nov 3 '15 at 23:10
  • Do you want \textit{A-V}? – Sigur Nov 3 '15 at 23:13
  • 1
    $A$\nobreakdash-$V$ (requires amsmath). Or $A\text{-}V$, but it's wrong to begin with. – egreg Nov 3 '15 at 23:14
  • Related: Hyphens in mathmode – Ari Brodsky Nov 11 '15 at 2:50
7

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$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.