Matriz como subíndice

Matriz como subíndice

Si bien $\begin{matrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{matrix}$se ve muy bien para la raíz más alta de $\mathsf E_8$, $s_{\begin{matrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{matrix}}$se ve horrible. Puedo acercarme a un resultado razonable usando $s_{\begin{smallmatrix} 2 & 4 & 6 & 5 & 4 & 3 & 2 \\ && 3 \end{smallmatrix}}$, pero parece que debe haber alguna variante de un entorno de tipo array/ matrixque cambie el tamaño automáticamente en subíndices y otros contextos apropiados. ¿Existe tal cosa o debo usar alguna combinación de \mathchoice, matrixy smallmatrix?

Como pregunta adicional, ¿qué parámetro controla el espacio antes y después de un entorno arrayo ?matrix

Respuesta1

Podrías usar una variante de smallmatrixeso usa \scriptscriptstyleen lugar de \scriptstylepara las entradas. También \vcenterse debe cambiar para \vtopque la línea superior vaya al nivel de los subíndices normales.

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

ingrese la descripción de la imagen aquí

En lugar de los tres parches, puedes definirlo editando la definición de smallmatrixdesde 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}

ingrese la descripción de la imagen aquí

Si cambia de opinión sobre el estilo del texto, cambie el segundo {\spicematrixaux{matrix}{#1}}a

{\null\!\spicematrixaux{smallmatrix}{#1}\!}

para eliminar los espacios delgados a la izquierda y a la derecha de smallmatrix.

información relacionada