2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00
LaTeX-examples/tikz/jordan-normal-form-block/jordan-normal-form-block.tex
Martin Thoma 7740f0147f Remove trailing spaces
The commands

find . -type f -name '*.md' -exec sed --in-place 's/[[:space:]]\+$//' {} \+

and

find . -type f -name '*.tex' -exec sed --in-place 's/[[:space:]]\+$//' {} \+

were used to do so.
2015-10-14 14:25:34 +02:00

44 lines
1.2 KiB
TeX

\documentclass{article}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{2mm}
\usepackage{tikz}
\usetikzlibrary{fit,matrix,positioning}
\tikzset{%
highlight/.style={
rectangle,
rounded corners,
fill=#1!15,
draw,
fill opacity=0.5,
%thick,
inner sep=1pt
}
}
\newcommand{\tikzmark}[2]{
\tikz[overlay,remember picture,baseline=(#1.base)] \node (#1) {#2};
}
\newcommand{\Highlight}[3]{%
\tikz[overlay,remember picture]{
\node[highlight=#3,fit=(#1.north west) (#2.south east)] {};}
}
\begin{document}
\begin{preview}
$
A_{\lambda_i} =
\left(
\begin{array}{*5{c}}
\tikzmark{1}{$\lambda_i$} & 1 & 0 & & 0 \\
& \lambda_i & 1 & & \\
& & \lambda_i\tikzmark{2}{} & & \\
& & & \ddots & \\
0 & & & & \tikzmark{3}{$\lambda_i$} \tikzmark{4}{} \\
\end{array}
\right)
\Highlight{1}{2}{blue}
\Highlight{3}{4}{red}
$
\end{preview}
\end{document}