<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div>On 14.07.2011, at 12:14, Eric van der Oord wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I've put in my preamble :<br><br>\usepackage{amsmath,amssymb}<br>\usepackage{array}<br>\usepackage[medium,raggedright,md,compact]{titlesec}<br><br>%%%<br><br>In the document :<br><br>[some text]<br><br>\subsection{ bla bla $\begin{array}{cc} 1&2\\3&4 \end{array}$}<br><br>[some text]<br><br>causes the following error :<br><br>./Ana-Plan deÃÅtailleÃÅ-2.tex:284: TeX capacity exceeded, sorry [input stack si<br>ze=5000].<br>\reserved@a ->\def \reserved@a <br> *{\ttl@assign@i {\@tempskipb }}\reserved@a <br>l.284 ...$\begin{array}{cc} 1&2\\3&4 \end{array}$}<br><br>./Ana-Plan deÃÅtailleÃÅ-2.tex:284: ==> Fatal error occurred, no output PDF fil<br>e produced!<br><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><blockquote type="cite"><div>Is that a known issue ? How can I put a matrix in a subsections's title ?<br><br></div></blockquote><br><div>Eric,<div><br></div><div>try this:</div><div><br></div><div><div><div>\documentclass{article}</div><div>\newcommand\mymatrix{$\left[ \begin{array}{cc} 1 & 2 \\ 3 & 4 \end{array} \right]$}</div><div>\begin{document}</div><div>\section{Section Headline}</div><div>\subsection{Matrix \protect\mymatrix}</div><div>Some text \ldots</div><div>\end{document}</div><div><br></div><div>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. </div><div><br></div><div>Manfred</div><div><br></div></div></div></div></div></div></body></html>