Drawing arrows from one table cell reference to another The 2019 Stack Overflow Developer Survey Results Are In Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manaratikz matrix undefined control sequenceTikz equivalent of PSTricks commands ncbar and rnodeSeparating matrix elements by linesRotate a node but not its content: the case of the ellipse decorationHow to draw arrows from cell to cell at the borders of a tableHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?tables without tabular?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingHow to Create a Table in Tikz with Arrows from One Cell to Another?Label in table should cross another cellCentering one Table inside another
Does Parliament hold absolute power in the UK?
Match Roman Numerals
Would an alien lifeform be able to achieve space travel if lacking in vision?
Why can't devices on different VLANs, but on the same subnet, communicate?
Identify 80s or 90s comics with ripped creatures (not dwarves)
Using dividends to reduce short term capital gains?
How to support a colleague who finds meetings extremely tiring?
Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?
What to do when moving next to a bird sanctuary with a loosely-domesticated cat?
Sort list of array linked objects by keys and values
How do spell lists change if the party levels up without taking a long rest?
Sub-subscripts in strings cause different spacings than subscripts
Python - Fishing Simulator
Simulating Exploding Dice
1960s short story making fun of James Bond-style spy fiction
University's motivation for having tenure-track positions
Drawing vertical/oblique lines in Metrical tree (tikz-qtree, tipa)
Single author papers against my advisor's will?
Can each chord in a progression create its own key?
Mortgage adviser recommends a longer term than necessary combined with overpayments
ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?
Is there a writing software that you can sort scenes like slides in PowerPoint?
Deal with toxic manager when you can't quit
Visa regaring travelling European country
Drawing arrows from one table cell reference to another
The 2019 Stack Overflow Developer Survey Results Are In
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manaratikz matrix undefined control sequenceTikz equivalent of PSTricks commands ncbar and rnodeSeparating matrix elements by linesRotate a node but not its content: the case of the ellipse decorationHow to draw arrows from cell to cell at the borders of a tableHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?tables without tabular?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingHow to Create a Table in Tikz with Arrows from One Cell to Another?Label in table should cross another cellCentering one Table inside another
I use the following code to manually draw arrows from one table cell to another.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows, arrows.meta, positioning
begindocument
beginframe[t]
frametitle
beginminipagetextwidth
begintable
begintabular*6c
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
beginminipagetextwidth
begintikzpicture[overlay]
draw<2-> [ultra thick, blue, latex'-] (4.1,1.66) -- +(0:.4);
draw<3-> [ultra thick, red, -latex'] (5.2,2.66) -- +(-74:1.4);
endtikzpicture
endminipage
endminipage
endframe
enddocument
Is it possible to automate drawing the arrows from one table cell to another, using cell references instead of manually drawing them?
tikz-pgf tables
add a comment |
I use the following code to manually draw arrows from one table cell to another.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows, arrows.meta, positioning
begindocument
beginframe[t]
frametitle
beginminipagetextwidth
begintable
begintabular*6c
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
beginminipagetextwidth
begintikzpicture[overlay]
draw<2-> [ultra thick, blue, latex'-] (4.1,1.66) -- +(0:.4);
draw<3-> [ultra thick, red, -latex'] (5.2,2.66) -- +(-74:1.4);
endtikzpicture
endminipage
endminipage
endframe
enddocument
Is it possible to automate drawing the arrows from one table cell to another, using cell references instead of manually drawing them?
tikz-pgf tables
add a comment |
I use the following code to manually draw arrows from one table cell to another.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows, arrows.meta, positioning
begindocument
beginframe[t]
frametitle
beginminipagetextwidth
begintable
begintabular*6c
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
beginminipagetextwidth
begintikzpicture[overlay]
draw<2-> [ultra thick, blue, latex'-] (4.1,1.66) -- +(0:.4);
draw<3-> [ultra thick, red, -latex'] (5.2,2.66) -- +(-74:1.4);
endtikzpicture
endminipage
endminipage
endframe
enddocument
Is it possible to automate drawing the arrows from one table cell to another, using cell references instead of manually drawing them?
tikz-pgf tables
I use the following code to manually draw arrows from one table cell to another.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usepackagepgfplots
usetikzlibraryarrows, arrows.meta, positioning
begindocument
beginframe[t]
frametitle
beginminipagetextwidth
begintable
begintabular*6c
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
beginminipagetextwidth
begintikzpicture[overlay]
draw<2-> [ultra thick, blue, latex'-] (4.1,1.66) -- +(0:.4);
draw<3-> [ultra thick, red, -latex'] (5.2,2.66) -- +(-74:1.4);
endtikzpicture
endminipage
endminipage
endframe
enddocument
Is it possible to automate drawing the arrows from one table cell to another, using cell references instead of manually drawing them?
tikz-pgf tables
tikz-pgf tables
asked 1 hour ago
HanyHany
1,300417
1,300417
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Something like this?
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
endtikzpicture
enddocument
In beamer
, there may be some problems with matrix
, as described here. Taking solutions from that question we have for example
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibraryarrows, arrows.meta, positioning, matrix
begindocument
beginframe[fragile]
frametitle
beginminipagetextwidth
centering
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw<2-> [->] (x-2-1) -- (x-4-5);
endtikzpicture
endminipage
endframe
enddocument
Matrix is not really designed to draw a table, so drawing border lines is a bit tricky.
documentclass[tikz,margin=1mm]standalone
usetikzlibrarymatrix,calc
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
foreach i in 1,...,6
draw ($(x-1-i.north west)+(-.5em,.5em)$) -- ($(x-5-i.south west)+(-.5em,-.5em)$);
foreach i in 1,...,5
draw ($(x-i-1.south west)+(-.5em,-.5em)$) -- ($(x-i-6.south east)+(.5em,-.5em)$);
draw ($(x-1-1.north west)+(-.5em,.5em)$) -| ($(x-5-6.south east)+(.5em,-.5em)$);
endtikzpicture
enddocument
@JouleVThank you for your answer. Unfortunately when I inserted your code inside a frame it gave me error message "! Undefined control sequence. <argument> pgf@matrix@last@nextcell@options "
– Hany
1 hour ago
yes I added usetikzlibrarymatrix in the preamble
– Hany
1 hour ago
@JouleVShall I add the code into my post!
– Hany
58 mins ago
@JouleVYes. Thank you very much. That was the problem.
– Hany
51 mins ago
@JouleVJust one more request please. Can the matrix contain borders between elements so that it could look like a table with lines betwen cells
– Hany
41 mins ago
|
show 2 more comments
The obligatory tikzmark
and beamer-overlay-styles
answer. It might be more useful if you use more features of table, which are harder to reproduce with a tikz
matrix.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibrarytikzmark,overlay-beamer-styles
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintable
begintabular*6c
15.1 & 23.7 & tikzmarknodem1319.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & tikzmarknodem3226.1 & tikzmarknodem3315.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & tikzmarknodem4418.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
begintikzpicture[remember picture,overlay]
draw[ultra thick, blue, -latex',visible on=<2->] (m13.south east) -- (m44.north west);
draw[ultra thick, red, -latex',visible on=<3->] (m33) -- (m32);
endtikzpicture
endframe
enddocument
@marmotThank you very much for your answer. Unfortunately I can not install tikzmark package on my workplace computer for security reasons.
– Hany
38 mins ago
@Hany I understand. You could also use Torbjørn T.'stikznode
command. This answer is public and may help some who have a more complicated table with, say, right-aligned cells and so on to annotate their table. For your purposes Joule V.s nice answer does a great job (and has certain advantages over ordinary tables when it comes to other questions like fitting some nodes in an ellipse on the background).
– marmot
30 mins ago
@marmotThank you very much for your time
– Hany
26 mins ago
add a comment |
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%2f484598%2fdrawing-arrows-from-one-table-cell-reference-to-another%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
Something like this?
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
endtikzpicture
enddocument
In beamer
, there may be some problems with matrix
, as described here. Taking solutions from that question we have for example
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibraryarrows, arrows.meta, positioning, matrix
begindocument
beginframe[fragile]
frametitle
beginminipagetextwidth
centering
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw<2-> [->] (x-2-1) -- (x-4-5);
endtikzpicture
endminipage
endframe
enddocument
Matrix is not really designed to draw a table, so drawing border lines is a bit tricky.
documentclass[tikz,margin=1mm]standalone
usetikzlibrarymatrix,calc
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
foreach i in 1,...,6
draw ($(x-1-i.north west)+(-.5em,.5em)$) -- ($(x-5-i.south west)+(-.5em,-.5em)$);
foreach i in 1,...,5
draw ($(x-i-1.south west)+(-.5em,-.5em)$) -- ($(x-i-6.south east)+(.5em,-.5em)$);
draw ($(x-1-1.north west)+(-.5em,.5em)$) -| ($(x-5-6.south east)+(.5em,-.5em)$);
endtikzpicture
enddocument
@JouleVThank you for your answer. Unfortunately when I inserted your code inside a frame it gave me error message "! Undefined control sequence. <argument> pgf@matrix@last@nextcell@options "
– Hany
1 hour ago
yes I added usetikzlibrarymatrix in the preamble
– Hany
1 hour ago
@JouleVShall I add the code into my post!
– Hany
58 mins ago
@JouleVYes. Thank you very much. That was the problem.
– Hany
51 mins ago
@JouleVJust one more request please. Can the matrix contain borders between elements so that it could look like a table with lines betwen cells
– Hany
41 mins ago
|
show 2 more comments
Something like this?
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
endtikzpicture
enddocument
In beamer
, there may be some problems with matrix
, as described here. Taking solutions from that question we have for example
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibraryarrows, arrows.meta, positioning, matrix
begindocument
beginframe[fragile]
frametitle
beginminipagetextwidth
centering
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw<2-> [->] (x-2-1) -- (x-4-5);
endtikzpicture
endminipage
endframe
enddocument
Matrix is not really designed to draw a table, so drawing border lines is a bit tricky.
documentclass[tikz,margin=1mm]standalone
usetikzlibrarymatrix,calc
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
foreach i in 1,...,6
draw ($(x-1-i.north west)+(-.5em,.5em)$) -- ($(x-5-i.south west)+(-.5em,-.5em)$);
foreach i in 1,...,5
draw ($(x-i-1.south west)+(-.5em,-.5em)$) -- ($(x-i-6.south east)+(.5em,-.5em)$);
draw ($(x-1-1.north west)+(-.5em,.5em)$) -| ($(x-5-6.south east)+(.5em,-.5em)$);
endtikzpicture
enddocument
@JouleVThank you for your answer. Unfortunately when I inserted your code inside a frame it gave me error message "! Undefined control sequence. <argument> pgf@matrix@last@nextcell@options "
– Hany
1 hour ago
yes I added usetikzlibrarymatrix in the preamble
– Hany
1 hour ago
@JouleVShall I add the code into my post!
– Hany
58 mins ago
@JouleVYes. Thank you very much. That was the problem.
– Hany
51 mins ago
@JouleVJust one more request please. Can the matrix contain borders between elements so that it could look like a table with lines betwen cells
– Hany
41 mins ago
|
show 2 more comments
Something like this?
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
endtikzpicture
enddocument
In beamer
, there may be some problems with matrix
, as described here. Taking solutions from that question we have for example
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibraryarrows, arrows.meta, positioning, matrix
begindocument
beginframe[fragile]
frametitle
beginminipagetextwidth
centering
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw<2-> [->] (x-2-1) -- (x-4-5);
endtikzpicture
endminipage
endframe
enddocument
Matrix is not really designed to draw a table, so drawing border lines is a bit tricky.
documentclass[tikz,margin=1mm]standalone
usetikzlibrarymatrix,calc
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
foreach i in 1,...,6
draw ($(x-1-i.north west)+(-.5em,.5em)$) -- ($(x-5-i.south west)+(-.5em,-.5em)$);
foreach i in 1,...,5
draw ($(x-i-1.south west)+(-.5em,-.5em)$) -- ($(x-i-6.south east)+(.5em,-.5em)$);
draw ($(x-1-1.north west)+(-.5em,.5em)$) -| ($(x-5-6.south east)+(.5em,-.5em)$);
endtikzpicture
enddocument
Something like this?
documentclass[tikz]standalone
usetikzlibrarymatrix
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
endtikzpicture
enddocument
In beamer
, there may be some problems with matrix
, as described here. Taking solutions from that question we have for example
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibraryarrows, arrows.meta, positioning, matrix
begindocument
beginframe[fragile]
frametitle
beginminipagetextwidth
centering
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw<2-> [->] (x-2-1) -- (x-4-5);
endtikzpicture
endminipage
endframe
enddocument
Matrix is not really designed to draw a table, so drawing border lines is a bit tricky.
documentclass[tikz,margin=1mm]standalone
usetikzlibrarymatrix,calc
begindocument
begintikzpicture
matrix (x) [matrix of nodes,row sep=1em,column sep=1em] %
15.1 & 23.7 & 19.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & 26.1 & 15.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & 18.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\;
draw[->] (x-2-1) -- (x-4-5);
% Node names: (<name of matrix>-<row>-<column>)
foreach i in 1,...,6
draw ($(x-1-i.north west)+(-.5em,.5em)$) -- ($(x-5-i.south west)+(-.5em,-.5em)$);
foreach i in 1,...,5
draw ($(x-i-1.south west)+(-.5em,-.5em)$) -- ($(x-i-6.south east)+(.5em,-.5em)$);
draw ($(x-1-1.north west)+(-.5em,.5em)$) -| ($(x-5-6.south east)+(.5em,-.5em)$);
endtikzpicture
enddocument
edited 16 mins ago
answered 1 hour ago
JouleVJouleV
13k22663
13k22663
@JouleVThank you for your answer. Unfortunately when I inserted your code inside a frame it gave me error message "! Undefined control sequence. <argument> pgf@matrix@last@nextcell@options "
– Hany
1 hour ago
yes I added usetikzlibrarymatrix in the preamble
– Hany
1 hour ago
@JouleVShall I add the code into my post!
– Hany
58 mins ago
@JouleVYes. Thank you very much. That was the problem.
– Hany
51 mins ago
@JouleVJust one more request please. Can the matrix contain borders between elements so that it could look like a table with lines betwen cells
– Hany
41 mins ago
|
show 2 more comments
@JouleVThank you for your answer. Unfortunately when I inserted your code inside a frame it gave me error message "! Undefined control sequence. <argument> pgf@matrix@last@nextcell@options "
– Hany
1 hour ago
yes I added usetikzlibrarymatrix in the preamble
– Hany
1 hour ago
@JouleVShall I add the code into my post!
– Hany
58 mins ago
@JouleVYes. Thank you very much. That was the problem.
– Hany
51 mins ago
@JouleVJust one more request please. Can the matrix contain borders between elements so that it could look like a table with lines betwen cells
– Hany
41 mins ago
@JouleVThank you for your answer. Unfortunately when I inserted your code inside a frame it gave me error message "! Undefined control sequence. <argument> pgf@matrix@last@nextcell@options "
– Hany
1 hour ago
@JouleVThank you for your answer. Unfortunately when I inserted your code inside a frame it gave me error message "! Undefined control sequence. <argument> pgf@matrix@last@nextcell@options "
– Hany
1 hour ago
yes I added usetikzlibrarymatrix in the preamble
– Hany
1 hour ago
yes I added usetikzlibrarymatrix in the preamble
– Hany
1 hour ago
@JouleVShall I add the code into my post!
– Hany
58 mins ago
@JouleVShall I add the code into my post!
– Hany
58 mins ago
@JouleVYes. Thank you very much. That was the problem.
– Hany
51 mins ago
@JouleVYes. Thank you very much. That was the problem.
– Hany
51 mins ago
@JouleVJust one more request please. Can the matrix contain borders between elements so that it could look like a table with lines betwen cells
– Hany
41 mins ago
@JouleVJust one more request please. Can the matrix contain borders between elements so that it could look like a table with lines betwen cells
– Hany
41 mins ago
|
show 2 more comments
The obligatory tikzmark
and beamer-overlay-styles
answer. It might be more useful if you use more features of table, which are harder to reproduce with a tikz
matrix.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibrarytikzmark,overlay-beamer-styles
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintable
begintabular*6c
15.1 & 23.7 & tikzmarknodem1319.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & tikzmarknodem3226.1 & tikzmarknodem3315.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & tikzmarknodem4418.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
begintikzpicture[remember picture,overlay]
draw[ultra thick, blue, -latex',visible on=<2->] (m13.south east) -- (m44.north west);
draw[ultra thick, red, -latex',visible on=<3->] (m33) -- (m32);
endtikzpicture
endframe
enddocument
@marmotThank you very much for your answer. Unfortunately I can not install tikzmark package on my workplace computer for security reasons.
– Hany
38 mins ago
@Hany I understand. You could also use Torbjørn T.'stikznode
command. This answer is public and may help some who have a more complicated table with, say, right-aligned cells and so on to annotate their table. For your purposes Joule V.s nice answer does a great job (and has certain advantages over ordinary tables when it comes to other questions like fitting some nodes in an ellipse on the background).
– marmot
30 mins ago
@marmotThank you very much for your time
– Hany
26 mins ago
add a comment |
The obligatory tikzmark
and beamer-overlay-styles
answer. It might be more useful if you use more features of table, which are harder to reproduce with a tikz
matrix.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibrarytikzmark,overlay-beamer-styles
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintable
begintabular*6c
15.1 & 23.7 & tikzmarknodem1319.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & tikzmarknodem3226.1 & tikzmarknodem3315.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & tikzmarknodem4418.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
begintikzpicture[remember picture,overlay]
draw[ultra thick, blue, -latex',visible on=<2->] (m13.south east) -- (m44.north west);
draw[ultra thick, red, -latex',visible on=<3->] (m33) -- (m32);
endtikzpicture
endframe
enddocument
@marmotThank you very much for your answer. Unfortunately I can not install tikzmark package on my workplace computer for security reasons.
– Hany
38 mins ago
@Hany I understand. You could also use Torbjørn T.'stikznode
command. This answer is public and may help some who have a more complicated table with, say, right-aligned cells and so on to annotate their table. For your purposes Joule V.s nice answer does a great job (and has certain advantages over ordinary tables when it comes to other questions like fitting some nodes in an ellipse on the background).
– marmot
30 mins ago
@marmotThank you very much for your time
– Hany
26 mins ago
add a comment |
The obligatory tikzmark
and beamer-overlay-styles
answer. It might be more useful if you use more features of table, which are harder to reproduce with a tikz
matrix.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibrarytikzmark,overlay-beamer-styles
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintable
begintabular*6c
15.1 & 23.7 & tikzmarknodem1319.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & tikzmarknodem3226.1 & tikzmarknodem3315.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & tikzmarknodem4418.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
begintikzpicture[remember picture,overlay]
draw[ultra thick, blue, -latex',visible on=<2->] (m13.south east) -- (m44.north west);
draw[ultra thick, red, -latex',visible on=<3->] (m33) -- (m32);
endtikzpicture
endframe
enddocument
The obligatory tikzmark
and beamer-overlay-styles
answer. It might be more useful if you use more features of table, which are harder to reproduce with a tikz
matrix.
documentclassbeamer
beamertemplatenavigationsymbolsempty
usepackageverbatim
usepackagetikz
usetikzlibrarytikzmark,overlay-beamer-styles
usetikzlibraryarrows
begindocument
beginframe[t]
frametitle
begintable
begintabular*6c
15.1 & 23.7 & tikzmarknodem1319.7 & 15.4 & 18.3 & 23.0\
17.4 & 18.6 & 12.9 & 20.3 & 13.7 & 21.4\
10.3 & tikzmarknodem3226.1 & tikzmarknodem3315.7 & 14.0 & 17.8 & 33.8\
23.2 & 12.9 & 29.8 & tikzmarknodem4418.3 & 14.2 & 20.8\
13.5 & 17.1 & 20.7 & 27.1 & 18.9 & 16.6\
endtabular
endtable
begintikzpicture[remember picture,overlay]
draw[ultra thick, blue, -latex',visible on=<2->] (m13.south east) -- (m44.north west);
draw[ultra thick, red, -latex',visible on=<3->] (m33) -- (m32);
endtikzpicture
endframe
enddocument
answered 46 mins ago
marmotmarmot
117k5150283
117k5150283
@marmotThank you very much for your answer. Unfortunately I can not install tikzmark package on my workplace computer for security reasons.
– Hany
38 mins ago
@Hany I understand. You could also use Torbjørn T.'stikznode
command. This answer is public and may help some who have a more complicated table with, say, right-aligned cells and so on to annotate their table. For your purposes Joule V.s nice answer does a great job (and has certain advantages over ordinary tables when it comes to other questions like fitting some nodes in an ellipse on the background).
– marmot
30 mins ago
@marmotThank you very much for your time
– Hany
26 mins ago
add a comment |
@marmotThank you very much for your answer. Unfortunately I can not install tikzmark package on my workplace computer for security reasons.
– Hany
38 mins ago
@Hany I understand. You could also use Torbjørn T.'stikznode
command. This answer is public and may help some who have a more complicated table with, say, right-aligned cells and so on to annotate their table. For your purposes Joule V.s nice answer does a great job (and has certain advantages over ordinary tables when it comes to other questions like fitting some nodes in an ellipse on the background).
– marmot
30 mins ago
@marmotThank you very much for your time
– Hany
26 mins ago
@marmotThank you very much for your answer. Unfortunately I can not install tikzmark package on my workplace computer for security reasons.
– Hany
38 mins ago
@marmotThank you very much for your answer. Unfortunately I can not install tikzmark package on my workplace computer for security reasons.
– Hany
38 mins ago
@Hany I understand. You could also use Torbjørn T.'s
tikznode
command. This answer is public and may help some who have a more complicated table with, say, right-aligned cells and so on to annotate their table. For your purposes Joule V.s nice answer does a great job (and has certain advantages over ordinary tables when it comes to other questions like fitting some nodes in an ellipse on the background).– marmot
30 mins ago
@Hany I understand. You could also use Torbjørn T.'s
tikznode
command. This answer is public and may help some who have a more complicated table with, say, right-aligned cells and so on to annotate their table. For your purposes Joule V.s nice answer does a great job (and has certain advantages over ordinary tables when it comes to other questions like fitting some nodes in an ellipse on the background).– marmot
30 mins ago
@marmotThank you very much for your time
– Hany
26 mins ago
@marmotThank you very much for your time
– Hany
26 mins ago
add a comment |
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%2f484598%2fdrawing-arrows-from-one-table-cell-reference-to-another%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