Verbatim inside a command

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}

enter image description here

Tags:

Verbatim