TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}

share|improve this question
Use \protect before \verb+@interface+ – azetina Nov 23 '12 at 3:17
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
up vote 12 down vote accepted

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.

share|improve this answer

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



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


enter image description here

share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.