# Verbatim inside a command

I have a question about a Verbatim, I want to write a word inside of the subsubsection title. I got an error. How can I fix it?: \subsubsection{The \verb+@interface+ Section}

-
Use \protect before \verb+@interface+ –  azetina Nov 23 '12 at 3:17
–  Werner Nov 23 '12 at 3:21
For simple spells like @interfcae I'd just write \subsubsection{The \texttt{@interface} Section}. When the spells have braces({}) in them, just escape them: \{ or \}. –  Marc van Dongen Nov 23 '12 at 4:09
Thanks to all for your helping. The type of document that I write is a report; I tried with all methods, but the only one that works for me is the \texttt{}, although I use the cprotectand fancyvrb packages. –  Isai Nov 23 '12 at 4:13

Use the cprotect package:

\usepackage{cprotect}% http://ctan.org/pkg/cprotect
...
\cprotect\subsubsection{The \verb+@interface+ Section}


However, consider reading through the informative UK TeX FAQ entry: Why doesn’t verbatim work within …? In particular, other alternatives like \texttt{...} also exist and are far more manageable. Even in your case, using

\subsubsection{The \texttt{@interface} Section}


works as-is.

-

The standard \verb command cannot be used in the argument of other commands. You can use \Verb from the fancyvrb package:

\documentclass{article}
\usepackage{fancyvrb}

\begin{document}

\subsubsection{The \protect\Verb+@interface+ Section}

\end{document}


-
While this works, it still doesn't allow for adding special characters in the argument to \Verb, so the simpler \texttt` might be better. –  egreg Nov 24 '12 at 10:48