math-sylvester-diagonal-matrix.tex 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. \documentclass{article}
  2. \usepackage[pdftex,active,tightpage]{preview}
  3. \setlength\PreviewBorder{0mm}
  4. \usepackage{amsmath,array}
  5. \usepackage{tikz}
  6. \usetikzlibrary{decorations.pathreplacing}
  7. \setlength\arraycolsep{4pt} % default value: 6pt
  8. \newcommand\tikzmark[1]{%
  9. \tikz[overlay,remember picture,baseline] \coordinate [anchor=base] (#1);}
  10. \newcommand\DrawBrace[3]{%
  11. \draw [decorate,decoration={brace,amplitude=2pt,mirror,raise=2pt}]
  12. (#1) -- (#2) node [black,midway,sloped,yshift=-10pt] {\footnotesize$#3$};
  13. }
  14. \begin{document}
  15. \begin{preview}
  16. \begin{equation*}
  17. S^T \cdot A \cdot S =
  18. \left(
  19. \begin{array}{*{9}{c}}
  20. \tikzmark{a}1 \\
  21. & \ddots & \\
  22. & & \tikzmark{b}1 \\
  23. & & & \tikzmark{c}-1 \\
  24. & & & & \ddots & \\
  25. & & & & & \tikzmark{d}-1\\
  26. & & & & & & \tikzmark{e}\phantom{-}0 \\
  27. & & & & & & & \ddots & \\
  28. & & & & & & & & \tikzmark{f}\phantom{-}0 \\
  29. \end{array}
  30. \right)
  31. \end{equation*}
  32. \begin{tikzpicture}[remember picture,overlay]
  33. \DrawBrace{a}{b}{r_{+}(s)-mal}
  34. \DrawBrace{c}{d}{r_{-}(s)-mal}
  35. \DrawBrace{e}{f}{r_{0}(s)-mal}
  36. \end{tikzpicture}
  37. \end{preview}
  38. \end{document}