I want to make an itemized list with verbatim elements which contain underscores (actually \verb just doesn't work) . So far, nothing I have tried worked. Escaping doesn't work, and I have tried examples but that package is broken. How can I achieve what I want ?
\documentclass[aspectratio = 169]{beamer}
\setbeamertemplate{navigation symbols}{}
\usetheme{Boadilla}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{graphicx}
\usepackage{hyperref}
\begin{document}
\section{Sorting algorithms}
\begin{frame}{Sorting algorithms}
Three algorithms :
\begin {itemize}
\item \verb"bubble_sort"
\item \verb"strand_sort"
\item \verb"pigeonhole_sort"
\end{itemize}
\end{frame}
\end{document}
framecontaining verbatim material must be set with thefragileoption (so\begin{frame}[fragile]). Preferable would be to use\item\texttt{bubble\_sort}. – Skillmon May 12 '22 at 12:47\begin{frame}\frametitle{title}, (2) as Skillmon mentions use\begin{frame}[fragile]when using special constructions like\verbetc. Then your example compiles just fine – daleif May 12 '22 at 12:51