Matriz no cabeçalho da seção

Matriz no cabeçalho da seção

É possível colocar uma matriz em um título de seção?

Esta é minha tentativa atual:

\section{Analyze the invertible $M= \left[ \begin{array}{rr}2 & 6 \\
2 & 4 \end{array} \right]$ matrix by doing the following:}

Eu quero que leia: insira a descrição da imagem aqui

Qualquer ajuda é apreciada, pois sou novo.

Responder1

Você pode usar a lrboxpara criar uma caixa contendo o material matemático e então usá-la no argumento de \section.

Em primeiro lugar, adicione

\newsavebox{\mybox}

no preâmbulo. Em seguida, incorpore o material matemático nolrbox

\begin{lrbox}{\mybox}
$M= \left[ \begin{array}{rr}2 & 6 \\
2 & 4 \end{array} \right]$
\end{lrbox}

e finalmente imprima a caixa dentro de \section:

\section{Analyze the invertible \usebox{\mybox} matrix by doing the following:}

MWE:

\documentclass{article}
\newsavebox{\mybox}

\begin{document}

\begin{lrbox}{\mybox}
$M= \left[ \begin{array}{rr}2 & 6 \\
2 & 4 \end{array} \right]$
\end{lrbox}

\section{Analyze the invertible \usebox{\mybox} matrix by doing the following:}

\end{document} 

insira a descrição da imagem aqui

Isso não atrapalha, \tableofcontentsmas considere usar o argumento opcional de \sectionpara imprimir algo diferente no ToC, se você estiver imprimindo.

Responder2

Com muitos \protects para o toc;-)

\documentclass{article}
\usepackage{mathtools}
\usepackage{array}
\begin{document}

\tableofcontents

% Protection for the math stuff written to toc
\section[{$M= \protect\left[\protect\begin{array}{rr}   2 & 6 \\   2 & 4 \protect\end{array}\protect\right]$}]{Analyze the invertible  matrix \protect{$M= \left[ \begin{array}{rr}
  2 & 6 \\
  2 & 4 
\end{array} \right]$}
 by doing the following:}

% protection for both heading and toc
\section{Analyse the matrix {$M= \protect\left[\protect\begin{array}{rr}   2 & 6 \\   2 & 4 \protect\end{array}\protect\right]$}
 by doing the following:}


\end{document}

insira a descrição da imagem aqui

Responder3

Além disso, usar o ambiente "smallmatrix" pode ficar melhor no título de uma seção.

Exemplo de saída

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath}
\newsavebox{\mybox}
\begin{document}
\begin{lrbox}{\mybox}
$M=\small[\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\small]$
\end{lrbox}
\tableofcontents
\section{Analyze the invertible {\usebox{\mybox}} by doing the following}
\end{document}

informação relacionada