Search code examples
jupyter-notebooklatex

How to write strings in Math Equations in Jupyter Notebook


I want to write the next equation (only the first part)

enter image description here

in a Jupyter notebook.

When I tried with this code

\begin{gather*}
Sensitivity = \frac{number true positives}{number of true positivities + number of false negatives}  
\end{gather*}

I get this:

enter image description here


Solution

  • This is how you can embed text in LaTeX:

    \text{Some text with spaces}
    

    So in your case, it could look like this:

    \begin{gather*}
    Sensitivity = \frac{\text{number true positives}}{\text{number of true positivities} + \text{number of false negatives}}  
    \end{gather*}