[Tex/LaTex] Error “! LaTeX Error: Bad math environment delimiter.”

errorsmath-mode

Edit by ManuelKuehner

! LaTeX Error: Bad math environment delimiter.

I am confused how to make the below formula in LaTeX:

I have been trying the below code, but it leads to an error:

\documentclass[runningheads,a4paper]{llncs}

\usepackage{amssymb}
\setcounter{tocdepth}{2}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{url}

\usepackage{float}
\usepackage{booktabs}
\usepackage{multirow}% http://ctan.org/pkg/multirow
\usepackage{hhline}% http://ctan.org/pkg/hhline

\usepackage{lipsum}
\setcounter{secnumdepth}{5}
\begin{document}



\begin{equation}
    P(AttackĀ¦Asset)  = \[\frac{\,\ attack,\ asset}\]
\end{equation}

\end{document}

Best Answer

  • Here's a starting point.
  • Asset and Attack are words and not variables I guess so I used \text from the amsmath package (loaded by mathtools). Both are famous and standard packages for math stuff.
  • You used \[ and \] inside a math environment -- I guess it's just copy and paste from somewhere. This was an error. See What are the differences between $$, \[, align, equation and displaymath?.

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{equation}
    P(\text{Attack} \mid \text{Asset})  = \frac{P(\text{Attack} \cap \text{Asset})}{P(\text{Asset})}
\end{equation}

\end{document}

enter image description here


I didn't know the funny arc symbol so I looked in detexify.

enter image description here