# Put hyphen into equation

Probably a pretty simple question, but how do I make a hyphen in a LaTeX equation?

Currently I have:

$$F-score = ....$$


But it renders as F - score when I want F-score.

Suggestions?

-

## migrated from stackoverflow.comAug 5 '11 at 18:38

This question came from our site for professional and enthusiast programmers.

See here: stackoverflow.com/questions/436823/… – Anders Forsgren Aug 5 '11 at 15:08
Thank you! I think I saw that question, but didn't read it carefully enough. I was skimming for hyphens, not en-dashes.... – sas4740 Aug 5 '11 at 15:13
Now if I could just accept that link as the answer – sas4740 Aug 5 '11 at 15:19

F-score will be interpreted as "F" "minus" "s" "c" "o" "r" "e". With the incorrect spacing that results from the five different consecutive letters, formatted as if it were the product of five variables.

Whenever you want text in math mode (you do here, since F-score is descriptive), you want a \text... command.

Since it looks like a variable, then \textit{F-score} is ok (formats in italic).

If you are going to reuse the variable, you can make a command:

\newcommand{\Fscore}{\ensuremath{\textit{F-score}}}%


Beware of \DeclareMathOperator which will use funky spacing. Its use is for mathematical functions like sin or log which take an argument: notice the funky spacing in 2\log 3. This may be what you want: if you'll be writing, F-score(\mu) then you should use \DeclareMathOperator.

-
\usepackage{amsopn}
\DeclareMathOperator{\Fscore}{F-score}

$\Fscore = ...$

-