The LaTeX commands \texttt
and \verb
are very similar, but not the same:
\verb
uses the next character as the delimiter, not braces\verb
will not break over a line (and will happily encroach into the margin)\verb
(and theverbatim
environment) in a Beamer slide needs thefragile
attribute
I tend to prefer \verb
, as I never want monospaced text to be broken over a line.