Insert square bracket in itemize environment in LaTeX

bracketsitemize

I insert square bracket in itemize environment in LaTeX, but there is an error.

\documentclass{article}
\usepackage{enumitem}
\usepackage{mathtools}
\begin{document}
\begin{itemize}
    \item [$\left[ \frac{a}{b} \right] $ ]
\end{itemize}
\end{document}

How can I insert square bracket in itemize in LaTeX?

Best Answer

Assuming that you want to use $[\frac{a}{b}]$ as the item marker, you need to protect the closing ] so it is not mistaken as the one closing the optional argument to \item. Additional braces suffice.

\item[{$[\frac{a}{b}]$}]

Alternatively

\item[$\lbrack\frac{a}{b}\rbrack$]