![指定された方法でLaTeXでブロック行列を書く方法](https://rvso.com/image/400362/%E6%8C%87%E5%AE%9A%E3%81%95%E3%82%8C%E3%81%9F%E6%96%B9%E6%B3%95%E3%81%A7LaTeX%E3%81%A7%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF%E8%A1%8C%E5%88%97%E3%82%92%E6%9B%B8%E3%81%8F%E6%96%B9%E6%B3%95.png)
次のコードを書きました:
\[
Q=\left[
\begin{array}{c c c c}
\textbf{nI}& \vline & \textbf{J}\\
\hline
\textbf{J^T} &\vline &\textbf{K}
\end{array}
\right]
\]
次のエラーが発生します:
! 余分な }、または忘れられた $.\textdef@ ...th {#1}\let \f@size #2\selectfont #3}} \textbf{J^T}
他にもここに書ききれないほどのエラーが多数あります。
誰か親切に助けてくれませんか。
答え1
答え2
\textbf コマンド内に上付き文字が含まれているのが気に入りません。
\documentclass[10pt]{article}
\begin{document}
\begin{equation}
Q=\left[
\begin{array}{c c c c}
\textbf{nI}& \vline & \textbf{J}\\
\hline
\textbf{J}^\textbf{T} &\vline &\textbf{K}
\end{array}
\right]
\end{equation}
\end{document}
答え3
私の提案には 2 つの例が含まれています。当然ですが、テキストの文字のサイズを拡大または縮小する通常のコマンドを使用して、マトリックス内の文字のサイズを変更できます。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\renewcommand\arraystretch{1.5}
\left[\begin{array}{@{}c|c@{}}
\mbox{\Large A} & \mbox{\Large B} \\
\hline
\mbox{\Large C} & \mbox{\Large D}
\end{array}\right], \quad \left[\begin{array}{@{}c|c@{}}
\mbox{\Large $A$} & \mbox{\Large $B$} \\
\hline
\mbox{\Large $C$} & \mbox{\Large $D$}
\end{array}\right]
\]
\end{document}