Re: [Risolto] TikZ e matrici

#67143
Up
0
Down
::


Puoi impostare la tikzpicture in modo opportuno:
`\begin{tikzpicture}[baseline=(current bounding box.center)]`
Ma il risultato non è ottimo, perché le spaziature sono diverse fra una matrice e l’altra.

C’è un altro metodo: scrivi questo nel preambolo
`\usetikzlibrary{calc}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\DrawBox}[1][]{%
\tikz[overlay,remember picture]{
\draw[opacity=.4,rounded corners=2mm, fill=#1]
($(left)+(-0.2em,0.9em)$) rectangle
($(right)+(1.2em,-0.4em)$);}
}`
e poi la tua matrice può diventare una normale bmatrix:
`\begin{equation}
\begin{bmatrix}
Y_{11}\\
Y_{21}\\
Y_{31}\\
Y_{41}\\
Y_{12}\\
\vdots\\
Y_{13}\\
\vdots\\
Y_{43}
\end{bmatrix}
=
\begin{bmatrix}
1 & \tikzmark{left} -1 & -1 & 1\\
1 & 1 & -1 & -1\\
1 & -1 & 1 & -1\\
1 & 1 & 1 & 1\\
\vdots & \vdots & \vdots & \vdots\\
1 & -1 & -1 &1\\
\vdots & \vdots & \vdots & \vdots\\
1 & 1 & \tikzmark{right} 1 & 1\\
\end{bmatrix}\DrawBox[black!10]
\end{equation}`
Aggiusta tu i parametri necessari.

Ciao
Enrico

Go to top