
Embora $\begin{matrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{matrix}$
pareça ótimo para a raiz mais alta de $\mathsf E_8$
, $s_{\begin{matrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{matrix}}$
parece horrível. Posso chegar mais perto de um resultado razoável usando $s_{\begin{smallmatrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{smallmatrix}}$
, mas parece que deve haver alguma variante de um ambiente do tipo array
/ matrix
que redimensiona automaticamente em subscritos e outros contextos apropriados. Isso existe ou devo usar alguma combinação de \mathchoice
, matrix
e smallmatrix
?
Como uma pergunta bônus adicional, qual parâmetro controla o espaço antes e depois de um ambiente array
or matrix
?
Responder1
Você poderia usar uma variante smallmatrix
que usa \scriptscriptstyle
em vez de \scriptstyle
para as entradas. Também \vcenter
deve ser alterado para \vtop
que a linha superior fique no nível dos subscritos normais.
\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}
Em vez dos três patches você poderia defini-lo editando a definição de smallmatrix
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}
Se você mudar de ideia sobre o estilo do texto, mude o segundo {\spicematrixaux{matrix}{#1}}
para
{\null\!\spicematrixaux{smallmatrix}{#1}\!}
de modo a remover os espaços finos à esquerda e à direita de smallmatrix
.