Math & ScienceHelp to make a matrix with tikz

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Matheux
Posts: 3
Joined: Mon Aug 18, 2014 5:23 pm

Help to make a matrix with tikz

Post by Matheux »

Hello there;
I would like to modify this code :

Code: Select all

\documentclass{article}
\usepackage{amsmath,mathrsfs}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning,fit}
\DeclareMathOperator{\Mat}{Mat}
\begin{document}
\begin{equation*}
\Mat_{\mathscr{B},\mathscr{B}'}(f)=
\begin{tikzpicture} [baseline=(m.center),every left delimiter/.style={xshift=2ex},
every right delimiter/.style={xshift=-2ex}] %,
column 6/.style={anchor=base east}]
\matrix (m)[matrix of math nodes,left delimiter=(,right delimiter=)]
{
a_{11} &[3mm] a_{12} & \dots & a_{1j} & \dots & a_{1n} \\
a_{21} & a_{22}      & \dots & a_{2j} & \dots & a_{2n} \\[-2mm]
\vdots & \vdots      &       & \vdots &       & \vdots \\
a_{i1} & a_{i2}      & \dots & a_{ij} & \dots & a_{in} \\[-2mm]
\vdots & \vdots      &       & \vdots &       & \vdots \\
a_{p1} & a_{p2}      & \dots & a_{pj} & \dots & a_{pn} \\
};
\begin{scope}[every node/.style={text=blue}]
\foreach \j/\sub in {1/1,2/2,4/i,6/p} \node[right=\tabcolsep of m-\j-6.east] {$\leftarrow f_{\sub}$};
\foreach \i/\sub in {1/1,2/2,4/j,6/n} \node[above=1.2\tabcolsep of m-1-\i.north] (a-\i) {$f(e_{\sub})$};
\foreach \i in {1,2,4,6} \draw[blue,->] (a-\i) -- (m-1-\i); 
\end{scope}
\node[line width=1pt,draw=blue,inner sep=-1pt,fit=(m-1-4) (m-6-4)](mfit){};
\draw[blue,->]  ([shift={(-5mm,-5mm)}]mfit.south) -| ([yshift=-1mm]mfit.south);
\node[below=2\tabcolsep of m-6-1.west,color=blue] {Composantes du vecteur $f(e_j)$ dans la base $\mathcal{B}'$};
\end{tikzpicture}
\end{equation*}
\end{document}

I want to remove the space between the matrix and

Code: Select all

\Mat_{\mathscr{B},\mathscr{B}'}(f)=
and adjust the sentence

Code: Select all

\node[below=2\tabcolsep of m-6-1.west,color=blue] {Composantes du vecteur $f(e_j)$ dans la base $\mathcal{B}'$};
written down.
Thank you for helping me.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Matheux
Posts: 3
Joined: Mon Aug 18, 2014 5:23 pm

Help to make a matrix with tikz

Post by Matheux »

I just do this:

Code: Select all

\node[color=blue](C) at ([shift={(-17mm,-5mm)}]m-6-1.south) {Composantes du vecteur $f(e_j)$ dans la base $\mathcal{B}'$};
I await your solutions concerant the other problem.
Thanks.
Matheux
Posts: 3
Joined: Mon Aug 18, 2014 5:23 pm

Help to make a matrix with tikz

Post by Matheux »

I do this :

Code: Select all

\node[color=black] at ([shift={(-17mm,-8mm)}]m-3-1.north) {$\Mat_{\mathscr{B},\mathscr{B}'}(f)=$};
Now my question is, that is what I have done is very correct?
Post Reply