[OS X TeX] Matrix in a subsections's title ?
Eric van der Oord
eric.vanderoord at gmail.com
Thu Jul 14 19:37:26 CEST 2011
"\protect" works fine !
Thank you very much
Eric
Le 14 juil. 2011 à 13:41, Manfred Braun a écrit :
> On 14.07.2011, at 12:14, Eric van der Oord wrote:
>
>> I've put in my preamble :
>>
>> \usepackage{amsmath,amssymb}
>> \usepackage{array}
>> \usepackage[medium,raggedright,md,compact]{titlesec}
>>
>> %%%
>>
>> In the document :
>>
>> [some text]
>>
>> \subsection{ bla bla $\begin{array}{cc} 1&2\\3&4 \end{array}$}
>>
>> [some text]
>>
>> causes the following error :
>>
>> ./Ana-Plan deÃÅtailleÃÅ-2.tex:284: TeX capacity exceeded, sorry [input stack si
>> ze=5000].
>> \reserved at a ->\def \reserved at a
>> *{\ttl at assign@i {\@tempskipb }}\reserved at a
>> l.284 ...$\begin{array}{cc} 1&2\\3&4 \end{array}$}
>>
>> ./Ana-Plan deÃÅtailleÃÅ-2.tex:284: ==> Fatal error occurred, no output PDF fil
>> e produced!
>>
>> Is that a known issue ? How can I put a matrix in a subsections's title ?
>>
>
> Eric,
>
> try this:
>
> \documentclass{article}
> \newcommand\mymatrix{$\left[ \begin{array}{cc} 1 & 2 \\ 3 & 4 \end{array} \right]$}
> \begin{document}
> \section{Section Headline}
> \subsection{Matrix \protect\mymatrix}
> Some text \ldots
> \end{document}
>
> The reason of the failure is that the sectioning commands provide the headlines also for the table of contents and for running headlines, even if not used. Therefore commands within sectioning headlines must not be expanded immediately. The immediate expansion of a command is suppressed by \protect.
>
> Manfred
>
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>
More information about the macostex-archives
mailing list