Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

Currently I have:

\begin{equation}
F-score = ....
\end{equation}

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

Suggestions?

share|improve this question

migrated from stackoverflow.com Aug 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

2 Answers 2

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.

share|improve this answer
\usepackage{amsopn}
\DeclareMathOperator{\Fscore}{F-score}

\[
\Fscore = ...
\]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.