SDStyLeZ SDStyLeZ - 4 months ago 26
LaTeX Question

Adding Arrows inside itemize in latex

I want to add a long left right arrow inside itemize.
At the moment I use:

\begin{itemize}
\item DNS <-> check\_dns
\item DHCP <-> check\_dhcp
\end{itemize}


But I want something like ↔ instead of <->.

Unfurtunatly I can't use "\longleftrightarrow" cause i get "\item invalid in math mode" if I try.

any ideas?

Answer

The answer to your question is quite simple. The command "\longleftrightarrow" only works in math mode. The solution is thus to use inline math mode by using \( \longleftrightarrow \) or $ \longleftrightarrow $.

Your code then changes to:

\begin{itemize}
    \item DNS **\(\longleftrightarrow\)** check\_dns
    \item DHCP **\(\longleftrightarrow\)** check\_dhcp
\end{itemize}

Note: if you are a new latex user and you want more information about the concept math mode, then this link could be interesting: wikibooks about latex