
$\begin{matrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{matrix}$
は の最高根として最適に見えますが$\mathsf E_8$
、$s_{\begin{matrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{matrix}}$
はひどく見えます。 を使用すると妥当な結果に近づくことができますが、下付き文字やその他の適切なコンテキストで自動的にサイズを変更する/型環境$s_{\begin{smallmatrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{smallmatrix}}$
のバリアントがいくつかあるはずです。そのようなものが存在するのでしょうか、それとも、 、の組み合わせを使用する必要がありますか?array
matrix
\mathchoice
matrix
smallmatrix
array
追加のボーナス質問として、または環境の前後のスペースを制御するパラメーターは何ですかmatrix
?
答え1
エントリにの代わりにsmallmatrix
を使用するのバリエーションを使用できます。また、一番上の行が通常の下付き文字のレベルになるようにを変更する必要があります。\scriptscriptstyle
\scriptstyle
\vcenter
\vtop
\documentclass{article}
\usepackage{amsmath}
\usepackage{etoolbox}
\let\tinymatrix\smallmatrix
\let\endtinymatrix\endsmallmatrix
\patchcmd{\tinymatrix}{\scriptstyle}{\scriptscriptstyle}{}{}
\patchcmd{\tinymatrix}{\scriptstyle}{\scriptscriptstyle}{}{}
\patchcmd{\tinymatrix}{\vcenter}{\vtop}{}{}
\patchcmd{\tinymatrix}{\bgroup}{\bgroup\scriptsize}{}{}
\begin{document}
$s_{\begin{tinymatrix}2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{tinymatrix}}$
\end{document}
smallmatrix
3 つのパッチの代わりに、 fromの定義を編集して定義することもできますamsmath
。
\makeatletter
\newenvironment{tinymatrix}{\null\,\vtop\bgroup\scriptsize % smallmatrix has \vcenter\bgroup
\Let@\restore@math@cr\default@tag
\baselineskip6\ex@ \lineskip1.5\ex@ \lineskiplimit\lineskip
\ialign\bgroup\hfil$\m@th\scriptscriptstyle##$\hfil&&\thickspace\hfil % smallmatrix has \scriptstyle
$\m@th\scriptscriptstyle##$\hfil\crcr % smallmatrix has \scriptstyle
}{%
\crcr\egroup\egroup\,%
}
\makeatother
If you want to use a single command for all styles, then it's necessary to use `\mathchoice`:
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newenvironment{tinymatrix}{%
% removed also \, from left and right
\null\vtop\bgroup\scriptsize % smallmatrix has \vcenter\bgroup
\Let@\restore@math@cr\default@tag
\baselineskip6\ex@ \lineskip1.5\ex@ \lineskiplimit\lineskip
\ialign\bgroup
\hfil$\m@th\scriptscriptstyle##$\hfil&&\thickspace\hfil % smallmatrix has \scriptstyle
$\m@th\scriptscriptstyle##$\hfil\crcr % smallmatrix has \scriptstyle
}{%
\crcr\egroup\egroup
}
\makeatother
\newcommand{\spicematrix}[1]{\mathchoice
{\spicematrixaux{matrix}{#1}}
{\spicematrixaux{matrix}{#1}}
{\spicematrixaux{tinymatrix}{#1}}
{\spicematrixaux{tinymatrix}{#1}}
}
\newcommand{\spicematrixaux}[2]{\begin{#1}#2\end{#1}}
\begin{document}
\begin{gather*}
A \spicematrix{2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3} B
\\
\textstyle A\spicematrix{2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3} B
\\
s_{\spicematrix{2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3}}
\end{gather*}
\end{document}
テキストスタイルを変更したい場合は、2番目を次{\spicematrixaux{matrix}{#1}}
のように変更します。
{\null\!\spicematrixaux{smallmatrix}{#1}\!}
の左右の細いスペースを削除しますsmallmatrix
。