Possible Duplicate:
“TeX capacity exceeded” because of a couple of raiseboxes in a \section?

I'm not able to use the following command in a listing caption (I think the same applies to headings):

\newcommand{\CS}{C\nolinebreak\hspace{-.05em}\raisebox{.6ex}{\smaller\smaller\bf \#}}

The error is:

! Undefined control sequence.
   \in@ #1#2->\begingroup \def \in@@ 
      ##1#1{}\toks@ \expandafter {\in@@ #2{}{}#1...
     l.10 ]

How can I solve this?

marked as duplicate by David Carlisle, Werner, Mensch, Qrrbrbirlbel, Gonzalo Medina Dec 10 '12 at 2:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \protect\CS should suffice. – egreg Dec 10 '12 at 0:02
  • fragile command in moving argument: use \protect\CS – David Carlisle Dec 10 '12 at 0:03
  • got to be a duplicate somewhere, will have a look :) – cmhughes Dec 10 '12 at 0:03
  • Thanks all of you... And who should I accept now?:D – Matthias Dec 10 '12 at 0:11
  • I voted this question is closed as duplicate (the one I picked is for section rather than caption, but in both cases it's raisebox causing the problem) (writing to table of contents or list of figures respectively) – David Carlisle Dec 10 '12 at 0:38

Browse other questions tagged or ask your own question.