Matrices and TikZ : arrows inside the matrix Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)TikZ: How to connect nodes and specify line direction?Difference between -| and |- in TikZRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideTikz matrix arrows alignmentTikZ: Drawing an arc from an intersection to an intersectionLine up nested tikz enviroments or how to get rid of themProblems with nested TikZpicturesTikz matrix inside foreach
Was the pager message from Nick Fury to Captain Marvel unnecessary?
What is the proper term for etching or digging of wall to hide conduit of cables
"Destructive power" carried by a B-52?
Diophantine equation 3^a+1=3^b+5^c
What are some likely causes to domain member PC losing contact to domain controller?
Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?
Where and when has Thucydides been studied?
Are there any irrational/transcendental numbers for which the distribution of decimal digits is not uniform?
Keep at all times, the minus sign above aligned with minus sign below
Short story about astronauts fertilizing soil with their own bodies
How does TikZ render an arc?
Does a random sequence of vectors span a Hilbert space?
How can I prevent/balance waiting and turtling as a response to cooldown mechanics
Determine whether an integer is a palindrome
Vertical ranges of Column Plots in 12
What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?
Did any compiler fully use 80-bit floating point?
Is a copyright notice with a non-existent name be invalid?
Baking rewards as operations
Did pre-Columbian Americans know the spherical shape of the Earth?
Statistical analysis applied to methods coming out of Machine Learning
What can we say about Classical Nahuatl <z>?
Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?
How to make triangles with rounded sides and corners? (squircle with 3 sides)
Matrices and TikZ : arrows inside the matrix
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)TikZ: How to connect nodes and specify line direction?Difference between -| and |- in TikZRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideTikz matrix arrows alignmentTikZ: Drawing an arc from an intersection to an intersectionLine up nested tikz enviroments or how to get rid of themProblems with nested TikZpicturesTikz matrix inside foreach
In the example below, the arrows fit inside the matrix but I would like them to stop at the limit of the delimiters.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- (A-4-6);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
tikz-pgf
add a comment |
In the example below, the arrows fit inside the matrix but I would like them to stop at the limit of the delimiters.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- (A-4-6);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
tikz-pgf
add a comment |
In the example below, the arrows fit inside the matrix but I would like them to stop at the limit of the delimiters.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- (A-4-6);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
tikz-pgf
In the example below, the arrows fit inside the matrix but I would like them to stop at the limit of the delimiters.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- (A-4-6);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
tikz-pgf
tikz-pgf
asked Apr 17 at 9:31
FabriceFabrice
1,4931922
1,4931922
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Add an xshift
:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- ([xshift=12pt]A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
Or shorten the arrow:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->, shorten > =12pt](L.east)-- (A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
And by the way why do you need fit
?
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix, positioning
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[right =30pt of A-4-6.east](L) $i$-ième ligne;
node[below=20pt of A-6-4.south](C) $j$-ième colonne;
draw[->, shorten > =12pt](L.west)-- (A-4-6.east);
draw[->](C.north)-- (A-6-4.south);
endtikzpicture
enddocument
Thank you for your proposition.
– Fabrice
Apr 17 at 10:17
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
Apr 17 at 10:31
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
Apr 17 at 10:34
add a comment |
Matrix delimiters are nodes
but unnamed by default. Therefore, if you add a name you can use them as reference like any other node and lines will stop on their borders.
In following code, I've used every right delimiter
style to add a name which is used later on.
A matrix is an special kind of node which contains other nodes. So if you want to stop a line on matrix
border you can use the matrix name as reference. Matrix elements have their own border. I've used intersection points between column center and south matrix border to place the vertical arrow and row center and east anchor on right delimiter to place the horizontal arrow. If you need to understand -|
(or |-
) syntax, look at https://tex.stackexchange.com/a/481234/1952 or https://tex.stackexchange.com/a/22954/1952.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline,
every right delimiter/.append style=name=rd,
]
matrix [matrix of math nodes,
left delimiter=(,
right delimiter=),
](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
draw[<-] (rd.east|-A-4-1.center)--++(0:6mm) node[right]$i$-ième colonne;
draw[<-] (A.south-|A-1-4.center) --++(-90:6mm) node[below]$j$-ième colonne;
endtikzpicture
enddocument
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
Apr 17 at 10:33
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
Apr 17 at 12:42
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
Apr 17 at 17:51
Thank you, because your answer is really elegant!
– CarLaTeX
Apr 17 at 18:12
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
Apr 18 at 9:06
|
show 3 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f485254%2fmatrices-and-tikz-arrows-inside-the-matrix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add an xshift
:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- ([xshift=12pt]A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
Or shorten the arrow:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->, shorten > =12pt](L.east)-- (A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
And by the way why do you need fit
?
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix, positioning
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[right =30pt of A-4-6.east](L) $i$-ième ligne;
node[below=20pt of A-6-4.south](C) $j$-ième colonne;
draw[->, shorten > =12pt](L.west)-- (A-4-6.east);
draw[->](C.north)-- (A-6-4.south);
endtikzpicture
enddocument
Thank you for your proposition.
– Fabrice
Apr 17 at 10:17
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
Apr 17 at 10:31
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
Apr 17 at 10:34
add a comment |
Add an xshift
:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- ([xshift=12pt]A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
Or shorten the arrow:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->, shorten > =12pt](L.east)-- (A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
And by the way why do you need fit
?
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix, positioning
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[right =30pt of A-4-6.east](L) $i$-ième ligne;
node[below=20pt of A-6-4.south](C) $j$-ième colonne;
draw[->, shorten > =12pt](L.west)-- (A-4-6.east);
draw[->](C.north)-- (A-6-4.south);
endtikzpicture
enddocument
Thank you for your proposition.
– Fabrice
Apr 17 at 10:17
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
Apr 17 at 10:31
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
Apr 17 at 10:34
add a comment |
Add an xshift
:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- ([xshift=12pt]A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
Or shorten the arrow:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->, shorten > =12pt](L.east)-- (A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
And by the way why do you need fit
?
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix, positioning
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[right =30pt of A-4-6.east](L) $i$-ième ligne;
node[below=20pt of A-6-4.south](C) $j$-ième colonne;
draw[->, shorten > =12pt](L.west)-- (A-4-6.east);
draw[->](C.north)-- (A-6-4.south);
endtikzpicture
enddocument
Add an xshift
:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->](L.east)-- ([xshift=12pt]A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
Or shorten the arrow:
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[
fit=(A-4-6)(A-4-6),
inner xsep=20pt,inner ysep=0,
label=right: $i$-ième ligne
](L) ;
node[
fit=(A-6-4)(A-6-4),
inner xsep=20pt,inner ysep=20pt,
label=below: $j$-ième colonne
](C) ;
draw[->, shorten > =12pt](L.east)-- (A-4-6.east);
draw[->](C.south)-- (A-6-4);
endtikzpicture
enddocument
And by the way why do you need fit
?
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix, positioning
begindocument
begintikzpicture[>=stealth,thick,baseline]
matrix [matrix of math nodes,left delimiter=(,right delimiter=)](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
node[right =30pt of A-4-6.east](L) $i$-ième ligne;
node[below=20pt of A-6-4.south](C) $j$-ième colonne;
draw[->, shorten > =12pt](L.west)-- (A-4-6.east);
draw[->](C.north)-- (A-6-4.south);
endtikzpicture
enddocument
edited Apr 17 at 10:03
answered Apr 17 at 9:41
CarLaTeXCarLaTeX
35.2k554148
35.2k554148
Thank you for your proposition.
– Fabrice
Apr 17 at 10:17
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
Apr 17 at 10:31
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
Apr 17 at 10:34
add a comment |
Thank you for your proposition.
– Fabrice
Apr 17 at 10:17
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
Apr 17 at 10:31
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
Apr 17 at 10:34
Thank you for your proposition.
– Fabrice
Apr 17 at 10:17
Thank you for your proposition.
– Fabrice
Apr 17 at 10:17
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
Apr 17 at 10:31
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
Apr 17 at 10:31
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
Apr 17 at 10:34
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
Apr 17 at 10:34
add a comment |
Matrix delimiters are nodes
but unnamed by default. Therefore, if you add a name you can use them as reference like any other node and lines will stop on their borders.
In following code, I've used every right delimiter
style to add a name which is used later on.
A matrix is an special kind of node which contains other nodes. So if you want to stop a line on matrix
border you can use the matrix name as reference. Matrix elements have their own border. I've used intersection points between column center and south matrix border to place the vertical arrow and row center and east anchor on right delimiter to place the horizontal arrow. If you need to understand -|
(or |-
) syntax, look at https://tex.stackexchange.com/a/481234/1952 or https://tex.stackexchange.com/a/22954/1952.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline,
every right delimiter/.append style=name=rd,
]
matrix [matrix of math nodes,
left delimiter=(,
right delimiter=),
](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
draw[<-] (rd.east|-A-4-1.center)--++(0:6mm) node[right]$i$-ième colonne;
draw[<-] (A.south-|A-1-4.center) --++(-90:6mm) node[below]$j$-ième colonne;
endtikzpicture
enddocument
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
Apr 17 at 10:33
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
Apr 17 at 12:42
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
Apr 17 at 17:51
Thank you, because your answer is really elegant!
– CarLaTeX
Apr 17 at 18:12
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
Apr 18 at 9:06
|
show 3 more comments
Matrix delimiters are nodes
but unnamed by default. Therefore, if you add a name you can use them as reference like any other node and lines will stop on their borders.
In following code, I've used every right delimiter
style to add a name which is used later on.
A matrix is an special kind of node which contains other nodes. So if you want to stop a line on matrix
border you can use the matrix name as reference. Matrix elements have their own border. I've used intersection points between column center and south matrix border to place the vertical arrow and row center and east anchor on right delimiter to place the horizontal arrow. If you need to understand -|
(or |-
) syntax, look at https://tex.stackexchange.com/a/481234/1952 or https://tex.stackexchange.com/a/22954/1952.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline,
every right delimiter/.append style=name=rd,
]
matrix [matrix of math nodes,
left delimiter=(,
right delimiter=),
](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
draw[<-] (rd.east|-A-4-1.center)--++(0:6mm) node[right]$i$-ième colonne;
draw[<-] (A.south-|A-1-4.center) --++(-90:6mm) node[below]$j$-ième colonne;
endtikzpicture
enddocument
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
Apr 17 at 10:33
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
Apr 17 at 12:42
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
Apr 17 at 17:51
Thank you, because your answer is really elegant!
– CarLaTeX
Apr 17 at 18:12
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
Apr 18 at 9:06
|
show 3 more comments
Matrix delimiters are nodes
but unnamed by default. Therefore, if you add a name you can use them as reference like any other node and lines will stop on their borders.
In following code, I've used every right delimiter
style to add a name which is used later on.
A matrix is an special kind of node which contains other nodes. So if you want to stop a line on matrix
border you can use the matrix name as reference. Matrix elements have their own border. I've used intersection points between column center and south matrix border to place the vertical arrow and row center and east anchor on right delimiter to place the horizontal arrow. If you need to understand -|
(or |-
) syntax, look at https://tex.stackexchange.com/a/481234/1952 or https://tex.stackexchange.com/a/22954/1952.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline,
every right delimiter/.append style=name=rd,
]
matrix [matrix of math nodes,
left delimiter=(,
right delimiter=),
](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
draw[<-] (rd.east|-A-4-1.center)--++(0:6mm) node[right]$i$-ième colonne;
draw[<-] (A.south-|A-1-4.center) --++(-90:6mm) node[below]$j$-ième colonne;
endtikzpicture
enddocument
Matrix delimiters are nodes
but unnamed by default. Therefore, if you add a name you can use them as reference like any other node and lines will stop on their borders.
In following code, I've used every right delimiter
style to add a name which is used later on.
A matrix is an special kind of node which contains other nodes. So if you want to stop a line on matrix
border you can use the matrix name as reference. Matrix elements have their own border. I've used intersection points between column center and south matrix border to place the vertical arrow and row center and east anchor on right delimiter to place the horizontal arrow. If you need to understand -|
(or |-
) syntax, look at https://tex.stackexchange.com/a/481234/1952 or https://tex.stackexchange.com/a/22954/1952.
documentclass[border=5pt]standalone
usepackagetikz
usetikzlibrarymatrix,decorations.pathreplacing, calc, positioning,fit
begindocument
begintikzpicture[>=stealth,thick,baseline,
every right delimiter/.append style=name=rd,
]
matrix [matrix of math nodes,
left delimiter=(,
right delimiter=),
](A)
a_1,1 & a_1,2 & dots & a_1,j & dots & a_1,n\
a_2,1 & a_2,2 & dots & a_2,j & dots & a_2,n\
vdots & vdots & & vdots & & vdots\
a_i,1 & a_i,2 & dots & a_i,j & dots & a_i,n\
vdots & vdots & & vdots & & vdots\
a_n,1 & a_n,2 & dots & a_n,j & dots & a_n,n\
;
draw[<-] (rd.east|-A-4-1.center)--++(0:6mm) node[right]$i$-ième colonne;
draw[<-] (A.south-|A-1-4.center) --++(-90:6mm) node[below]$j$-ième colonne;
endtikzpicture
enddocument
edited 2 days ago
answered Apr 17 at 10:19
IgnasiIgnasi
96.1k5176321
96.1k5176321
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
Apr 17 at 10:33
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
Apr 17 at 12:42
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
Apr 17 at 17:51
Thank you, because your answer is really elegant!
– CarLaTeX
Apr 17 at 18:12
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
Apr 18 at 9:06
|
show 3 more comments
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
Apr 17 at 10:33
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
Apr 17 at 12:42
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
Apr 17 at 17:51
Thank you, because your answer is really elegant!
– CarLaTeX
Apr 17 at 18:12
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
Apr 18 at 9:06
1
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
Apr 17 at 10:33
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
Apr 17 at 10:33
1
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
Apr 17 at 12:42
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
Apr 17 at 12:42
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
Apr 17 at 17:51
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
Apr 17 at 17:51
Thank you, because your answer is really elegant!
– CarLaTeX
Apr 17 at 18:12
Thank you, because your answer is really elegant!
– CarLaTeX
Apr 17 at 18:12
@ Ignasi Could you explain this
(A.south-|A-1-4.center)
? Thank you.– Fabrice
Apr 18 at 9:06
@ Ignasi Could you explain this
(A.south-|A-1-4.center)
? Thank you.– Fabrice
Apr 18 at 9:06
|
show 3 more comments
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f485254%2fmatrices-and-tikz-arrows-inside-the-matrix%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown