He creado esta matriz:
Con este código LaTeX:
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{amsmath,array}
\renewcommand\arraycolsep{4pt} % default value: 6pt
\begin{document}
\begin{preview}
\begin{equation*}
\left( \,
\begin{array}{r@{}r@{}r r r} % @{} is used twice to suppress intercolumn whitespace
\overbrace{
\boxed{
\begin{array}{rrr} % First block (1)
1 & & \\
& \ddots & \\
& & 1 \\
\end{array}
}
}^{r_+(s)-mal} \\
&
\underbrace{
\boxed{
\begin{array}{rrr} % Second block (-1)
-1 & & \\
& \ddots & \\
& & -1\\
\end{array}
}
}_{r_{-}(s)-mal} \\
& &
\underbrace{
\boxed{
\begin{array}{rrr} % Third block
0 & & \\
& \ddots & \\
& & 0\\
\end{array}
}
}_{r_0(s)-mal} \\
\end{array}\,\right)
\end{equation*}
\end{preview}
\end{document}
Puede ver que el refuerzo hace que el tercer bloque parezca un poco más bajo de lo que sería sin el refuerzo del segundo bloque. Pero no quiero que el tercer bloque parezca más bajo.
¿Cómo puedo hacer que LaTeX ignore la altura del segundo soporte?
Sería aún mejor si pudiera hacer tirantes diagonales y quitar los bloques. Pero supongo que eso es complicado.
Respuesta1
Una solución que utiliza TikZ
tirantes diagonales:
\documentclass{article}
\usepackage{amsmath,array}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\setlength\arraycolsep{4pt} % default value: 6pt
\newcommand\tikzmark[1]{%
\tikz[overlay,remember picture,baseline] \coordinate [anchor=base] (#1);}
\newcommand\DrawBrace[3]{%
\draw [decorate,decoration={brace,amplitude=2pt,mirror,raise=2pt}]
(#1) -- (#2) node [black,midway,sloped,yshift=-10pt] {\footnotesize$#3$};
}
\begin{document}
\begin{equation*}
\left(
\begin{array}{*{9}{c}}
\tikzmark{a}\phantom{-}1 \\
& \ddots & \\
& & \tikzmark{b}\phantom{-}1 \\
& & & \tikzmark{c}-1 \\
& & & & \ddots & \\
& & & & & \tikzmark{d}-1\\
& & & & & & \tikzmark{e}\phantom{-}0 \\
& & & & & & & \ddots & \\
& & & & & & & & \tikzmark{f}\phantom{-}0 \\
\end{array}
\right)
\end{equation*}
\begin{tikzpicture}[remember picture,overlay]
\DrawBrace{a}{b}{r_{+}(s)-mal}
\DrawBrace{c}{d}{r_{-}(s)-mal}
\DrawBrace{e}{f}{r_{0}(s)-mal}
\end{tikzpicture}
\end{document}
Respuesta2
No es realmente una solución elegante. Básicamente, todo lo que se necesita es poner \underbrace
a cero el espacio vertical adicional producido por el. Una herramienta fácil para esto es \raisebox
que en su primera y segundaopcionalEl argumento permite dar una altura y profundidad explícitas para el cuadro resultante.
Dos complicaciones:
- ElinternoLa matriz sale verticalmente centrada, por lo que la altura y la profundidad de la
\underbrace
construcción son turbias. - Se inserta algo de espacio vertical adicional en la matriz exterior si una de las líneas tiene profundidad cero, por lo que toda la construcción en caja debe bajarse nuevamente.
Esto lleva a esta "solución":
\begin{equation*}
\left( \,
\begin{array}{r@{}r@{}r r r} % @{} is used twice to suppress intercolumn whitespace
\overbrace{
\boxed{
\begin{array}{rrr} % First block (1)
1 & & \\
& \ddots & \\
& & 1 \\
\end{array}
}
}^{r_+(s)-mal} \\
&
\raisebox{-.5\height}[.5\height][.5\height]
{%
$\underbrace{
\raisebox{\depth}
{%
$\boxed{
\begin{array}{rrr} % Second block (-1)
-1 & & \\
& \ddots & \\
& & -1\\
\end{array}
}$%
}%
}_{r_{-}(s)-mal}$%
}%
\\
& &
\underbrace{
\boxed{
\begin{array}{rrr} % Third block
0 & & \\
& \ddots & \\
& & 0\\
\end{array}
}
}_{r_0(s)-mal} \\
\end{array}\,\right)
\end{equation*}
Respuesta3
Debe haber una tikzmark
forma. Pero ahora no tengo tiempo. Mientras tanto, un truco feo sería reducir manualmente el espacio usando \\[length]
como en
\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{amsmath,array}
\renewcommand\arraycolsep{4pt} % default value: 6pt
\begin{document}
\begin{preview}
\begin{equation*}
\left( \,
\begin{array}{r@{}r@{}r r r} % @{} is used twice to suppress intercolumn whitespace
\overbrace{
\boxed{
\begin{array}{rrr} % First block (1)
1 & & \\
& \ddots & \\
& & 1 \\
\end{array}
}
}^{r_+(s)-mal} \\
&
\underbrace{
\boxed{
\begin{array}{rrr} % Second block (-1)
-1 & & \\
& \ddots & \\
& & -1\\
\end{array}
}
}_{r_{-}(s)-mal} \\[-17pt] %%% <--Here
& &
\underbrace{
\boxed{
\begin{array}{rrr} % Third block
0 & & \\
& \ddots & \\
& & 0\\
\end{array}
}
}_{r_0(s)-mal} \\
\end{array}\,\right)
\end{equation*}
\end{preview}
\end{document}
Sin embargo , haría falta poca observación para estimar el valor apropiado de \\[-17pt]
.