1

I have the following table

\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{table}[h]
\centering
    \caption{Alignment of ADTree to ISSRM}
{\renewcommand\arraystretch{1.75}
\begin{tabular}{|l|l|l|} \hline
Statement & \multicolumn{2}{l|}{Description} \\ \hline\hline


P(\text{Attack} \mid \text{Asset}) & \multicolumn{2}{p{8cm}|}{\raggedright  The probability of Attack, given the Asset, was targeted} \\ \hline
P(\text{Attack} \cap \text{Asset}) & \multicolumn{2}{p{8cm}|}{\raggedright  The probability of happening Atomic attack on Asset, Can be obtained from join of Attack and Assets tables} \\ \hline
P(Asset & \multicolumn{2}{p{8cm}|}{\raggedright  Can be obtained from Asset table, and Table 15 } \\ \hline

\end{tabular}}
\label{Explanation of formula}
\end{table}

\end{document}

Although, the *.tex get compiled successfully, and it shows the table correctly, but there are two errors on it which complains with:

undefined control sequence.missing $ inserted latex
Jimmy
  • 281
  • You're using \text but haven't loaded the amsmath package. – Mico Jun 18 '17 at 16:01
  • It seems that you do not know the basics of LaTeX. Maybe you start by reading a tutorial for beginners. Here you have used math without saying LaTeX that it is math stuff :). In addition you use the \text command from my previous answer (https://tex.stackexchange.com/questions/375570) but apparently didn't read the answer completely. The \text command is from the amsmath package tahts is loaded by the mathtools package in my answer. – Dr. Manuel Kuehner Jun 18 '17 at 16:02
  • https://tex.stackexchange.com/questions/11 or http://mirror.hmc.edu/ctan/info/lshort/english/lshort.pdf – Dr. Manuel Kuehner Jun 18 '17 at 16:05
  • @Dr.ManuelKuehner thanks a lot. i know, i should start from scratch, but i need to handle this issue now, and then i have long term plan to learn latex too. – Jimmy Jun 18 '17 at 16:09

1 Answers1

3
  • The command \mid must occur while TeX is in math mode.

  • In order to use the macro \text, the package amsmath must be loaded.

  • Don't define two columns and then use \multicolumn{2}{...}{...} to join the two columns.

  • Instead of issuing repeated \multicolumn{2}{p{8cm}|}{\raggedright ...} instructions, load the array package and define a single column of the following type: >{\raggedright\arraybackslash}p{8cm}.

  • Give your table a more appealing, open look by omitting all vertical bars and most interior horizontal bars.

  • Do take the time to learn the basics of LaTeX. You'll find it so much easier to write papers...

enter image description here

\documentclass[runningheads,a4paper]{llncs}

\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage{booktabs,array}
\begin{document}

\begin{table}[h]
\centering
\caption{Alignment of ADTree to ISSRM}
 \label{Explanation of formula}
\renewcommand\arraystretch{1.25}
\begin{tabular}{@{}l>{\raggedright\arraybackslash}p{8cm}@{}} 
\toprule
Statement & Description \\ 
\midrule
$P(\text{Attack} \mid \text{Asset})$ 
& Probability of Attack, given that Asset was targeted\\ 
\addlinespace
$P(\text{Attack} \cap \text{Asset})$ 
& Probability of Atomic attack happening on Asset. Can be obtained from join of Attack and Assets tables \\ 
\addlinespace
$P(\text{Asset})$ 
& Can be obtained from Asset table and Table 15  \\ 
\bottomrule
\end{tabular}
\end{table}

\end{document}
Mico
  • 506,678