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
Girl Hackers - Logic Puzzle
How does the math work when buying airline miles?
Should a wizard buy fine inks every time he want to copy spells into his spellbook?
Is there hard evidence that the grant peer review system performs significantly better than random?
Is CEO the "profession" with the most psychopaths?
Putting class ranking in CV, but against dept guidelines
How to write capital alpha?
Prove that BD bisects angle ABC
Random body shuffle every night—can we still function?
What would you call this weird metallic apparatus that allows you to lift people?
Is there any word for a place full of confusion?
Is it possible for SQL statements to execute concurrently within a single session in SQL Server?
Why can't I install Tomboy in Ubuntu Mate 19.04?
What to do with repeated rejections for phd position
How many time has Arya actually used Needle?
Would it be easier to apply for a UK visa if there is a host family to sponsor for you in going there?
Co-worker has annoying ringtone
Google .dev domain strangely redirects to https
Sum letters are not two different
Why do early math courses focus on the cross sections of a cone and not on other 3D objects?
In musical terms, what properties are varied by the human voice to produce different words / syllables?
What is best way to wire a ceiling receptacle in this situation?
Is multiple magic items in one inherently imbalanced?
How does light 'choose' between wave and particle behaviour?
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 2 days ago
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
2 days ago
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
2 days ago
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
2 days ago
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
2 days ago
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
2 days ago
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
2 days ago
Thank you, because your answer is really elegant!
– CarLaTeX
2 days ago
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
yesterday
|
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
2 days ago
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
2 days ago
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
2 days ago
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
2 days ago
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
2 days ago
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
2 days ago
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 2 days ago
answered 2 days ago
CarLaTeXCarLaTeX
34.9k553145
34.9k553145
Thank you for your proposition.
– Fabrice
2 days ago
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
2 days ago
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
2 days ago
add a comment |
Thank you for your proposition.
– Fabrice
2 days ago
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
2 days ago
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
2 days ago
Thank you for your proposition.
– Fabrice
2 days ago
Thank you for your proposition.
– Fabrice
2 days ago
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
2 days ago
@Fabrice You're welcome and thank you for accepting my answer!
– CarLaTeX
2 days ago
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
2 days ago
@Fabrice However, Ignasi's answer is more elegant.
– CarLaTeX
2 days ago
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
2 days ago
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
2 days ago
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
2 days ago
Thank you, because your answer is really elegant!
– CarLaTeX
2 days ago
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
yesterday
|
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
2 days ago
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
2 days ago
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
2 days ago
Thank you, because your answer is really elegant!
– CarLaTeX
2 days ago
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
yesterday
|
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 22 hours ago
answered 2 days ago
IgnasiIgnasi
96.1k5176321
96.1k5176321
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
2 days ago
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
2 days ago
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
2 days ago
Thank you, because your answer is really elegant!
– CarLaTeX
2 days ago
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
yesterday
|
show 3 more comments
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
2 days ago
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
2 days ago
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
2 days ago
Thank you, because your answer is really elegant!
– CarLaTeX
2 days ago
@ Ignasi Could you explain this(A.south-|A-1-4.center)
? Thank you.
– Fabrice
yesterday
1
1
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
2 days ago
Awesome! It didn't come to my mind to name the node of the right delimeter, +1!
– CarLaTeX
2 days ago
1
1
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
2 days ago
But the horizontal arrow should be aligned with the ith row...
– CarLaTeX
2 days ago
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
2 days ago
@CarLaTeX you're right. I'll change as soon as I've a computer and Internet access at hand ;-)
– Ignasi
2 days ago
Thank you, because your answer is really elegant!
– CarLaTeX
2 days ago
Thank you, because your answer is really elegant!
– CarLaTeX
2 days ago
@ Ignasi Could you explain this
(A.south-|A-1-4.center)
? Thank you.– Fabrice
yesterday
@ Ignasi Could you explain this
(A.south-|A-1-4.center)
? Thank you.– Fabrice
yesterday
|
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