[Tex/LaTex] How to include math symbols in itemize

itemize

I want to code the below lines of the image in latex.
enter image description here

\begin{itemize}
   \item [m] - Number of training examples
   \item [x] - "Input"  variables / features
   \item [y] - "Output" variable / "target" Variable
   \item [(x,y)]  - One training example
   \item x^(i),y^(i) - i^{th} training example
\end{itemize}

I have given a try, but i am facing an error. I couldn't identify what's the issue behind. Please help me.

 The error i am facing is 

  ! Missing $ inserted.
  <inserted text> 
            $
     l.40         \item [x^(i),y^(i)] - i^{th} training example
  ? 
   ! Extra }, or forgotten $.

Best Answer

You need to use math mode for math symbols, i.e. enclose em with $ or in \(…\) (see Are \( and \) preferable to dollar signs for math mode?). Furthermore I’d use a description list in this case as this would match the input better …

\documentclass{article}

\begin{document}
\begin{description}
\item [$m$] Number of training examples
\item [$x$] ``Input''  variables / features
\item [$y$] ``Output'' variable / ``target'' Variable
\item [$(x,y)$]  One training example
\item [$x^(i),y^(i)$] $i$-th training example
\end{description}
\end{document}

Furthermore I’d write $i$-th instead of the superscript to prevent confusion with “i to the power of th”. You also missed the brackets at the last item.

And you may take a look at the csquotes package to get the right quotes.

Related Question