セクション見出しのマトリックス

セクション見出しのマトリックス

セクション見出しにマトリックスを配置することは可能ですか?

これが私の現在の試みです:

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

次のように読みたい: ここに画像の説明を入力してください

私は初心者なので、どんな助けでもありがたいです。

答え1

を使用してlrbox数学的な内容を含むボックスを作成し、それを の引数で使用することができます\section

まず、

\newsavebox{\mybox}

序文に数学的な内容を埋め込んでlrbox

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

そして最後に、次のボックスを印刷します\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} 

ここに画像の説明を入力してください

これは を妨げるものではありませんが、印刷する場合は、ToC に別の内容を印刷するため\tableofcontentsに のオプション引数を使用することを検討してください。\section

答え2

;-)にはたくさんの\protectsが付いています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}

ここに画像の説明を入力してください

答え3

さらに、セクション タイトルでは環境「smallmatrix」を使用すると見栄えが良くなる場合があります。

サンプル出力

\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}

関連情報