With a lot of help from this site I have made some code for a new character ʾ (transcribed Arabic Hamza) consisting of a raised, small rotated c. This character needed special kerning for italic font for which I used some code from this question. After I added this I ran intro problems. The whole thing works fine for normal text, but when the character is put in a section command it gives errors. When I run the MWE below on sharelatex.com it gives Extra }, or forgotten \endgroup. When this character is in a section title in my larger project it gives TeX capacity exceeded, sorry [input stack size=50 00].

How can I make this work for section titles as well?




% test for italicness

% New character HAMZA



\textit{Liqāʾ al-yawn}

\section{\textit{Liqāʾ al-yawn}}


  • 1
    \protected\def'{...} if you plan to use it in a section title. – egreg Oct 23 '14 at 7:47

Commands such as \rotatebox are fragile, meaning that they are not safe for usage in moving arguments (sectional titles or captions).

The simplest workaround is to use


so that TeX won't try expanding ' when writing to auxiliary files.

| improve this answer | |
  • You're going to end up in the acknowledgement section in my dissertation at this rate. – Andreas Oct 23 '14 at 8:48
  • I'd prefer a beer when I'm around Sweden! My best wishes for your dissertation. – egreg Oct 23 '14 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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