TikZ matrix, why “every even row” doesn't work with “row sep” option?












7















please, consider the following mwe:



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
row sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={row sep=2pt},% doesn't insert row separation
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


meanwhile every even column/.style={column sep=2pt}, gives expected result, i.e. introduce additional column separation after each second column, the every even row/.style={row sep=2pt}, not. do i did something wrong or i misunderstand how it can work or this is bug in TikZ v3.1 (i never test this before, so i don't know if the same happen in v3.0.1)?



enter image description here



edit:



the same happens with for example



row 2/.style = {row sep=2pt} 


thus it might means, that every even row/.style=... and row <row number> works fine only when one like to change some properties of cells inside row, for example color of nodes borders:



every even row/.style={draw red},


but not when one like to change row separation (see @AndréC comment below). However it is interesting, that this is possible to do in every column sep ...



of course, as (temporary) work around is terminate each second row in matrix with for example [2pt], but his is annoying when matrix is huge, for example as is here.










share|improve this question

























  • If you write every even row/.style={blue} it works. Then ...

    – AndréC
    5 hours ago











  • @AndréC, it cover each second row with blue color. i expected that after each even row will be row separation 2pt as it is at columns.

    – Zarko
    5 hours ago











  • Yes, I know, my example suggests that the error may not be in the style, but in another place. Otherwise, the style would not work for the blue color either.

    – AndréC
    5 hours ago






  • 1





    The row sep option does not work with keys either row <number>, row <column number> column <column number>, every odd row

    – AndréC
    3 hours ago













  • Not related to the question: you initialized inner sep twice, the first time with 0pt and the second time with 1pt.

    – AndréC
    1 hour ago
















7















please, consider the following mwe:



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
row sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={row sep=2pt},% doesn't insert row separation
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


meanwhile every even column/.style={column sep=2pt}, gives expected result, i.e. introduce additional column separation after each second column, the every even row/.style={row sep=2pt}, not. do i did something wrong or i misunderstand how it can work or this is bug in TikZ v3.1 (i never test this before, so i don't know if the same happen in v3.0.1)?



enter image description here



edit:



the same happens with for example



row 2/.style = {row sep=2pt} 


thus it might means, that every even row/.style=... and row <row number> works fine only when one like to change some properties of cells inside row, for example color of nodes borders:



every even row/.style={draw red},


but not when one like to change row separation (see @AndréC comment below). However it is interesting, that this is possible to do in every column sep ...



of course, as (temporary) work around is terminate each second row in matrix with for example [2pt], but his is annoying when matrix is huge, for example as is here.










share|improve this question

























  • If you write every even row/.style={blue} it works. Then ...

    – AndréC
    5 hours ago











  • @AndréC, it cover each second row with blue color. i expected that after each even row will be row separation 2pt as it is at columns.

    – Zarko
    5 hours ago











  • Yes, I know, my example suggests that the error may not be in the style, but in another place. Otherwise, the style would not work for the blue color either.

    – AndréC
    5 hours ago






  • 1





    The row sep option does not work with keys either row <number>, row <column number> column <column number>, every odd row

    – AndréC
    3 hours ago













  • Not related to the question: you initialized inner sep twice, the first time with 0pt and the second time with 1pt.

    – AndréC
    1 hour ago














7












7








7


0






please, consider the following mwe:



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
row sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={row sep=2pt},% doesn't insert row separation
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


meanwhile every even column/.style={column sep=2pt}, gives expected result, i.e. introduce additional column separation after each second column, the every even row/.style={row sep=2pt}, not. do i did something wrong or i misunderstand how it can work or this is bug in TikZ v3.1 (i never test this before, so i don't know if the same happen in v3.0.1)?



enter image description here



edit:



the same happens with for example



row 2/.style = {row sep=2pt} 


thus it might means, that every even row/.style=... and row <row number> works fine only when one like to change some properties of cells inside row, for example color of nodes borders:



every even row/.style={draw red},


but not when one like to change row separation (see @AndréC comment below). However it is interesting, that this is possible to do in every column sep ...



of course, as (temporary) work around is terminate each second row in matrix with for example [2pt], but his is annoying when matrix is huge, for example as is here.










share|improve this question
















please, consider the following mwe:



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
row sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={row sep=2pt},% doesn't insert row separation
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


meanwhile every even column/.style={column sep=2pt}, gives expected result, i.e. introduce additional column separation after each second column, the every even row/.style={row sep=2pt}, not. do i did something wrong or i misunderstand how it can work or this is bug in TikZ v3.1 (i never test this before, so i don't know if the same happen in v3.0.1)?



enter image description here



edit:



the same happens with for example



row 2/.style = {row sep=2pt} 


thus it might means, that every even row/.style=... and row <row number> works fine only when one like to change some properties of cells inside row, for example color of nodes borders:



every even row/.style={draw red},


but not when one like to change row separation (see @AndréC comment below). However it is interesting, that this is possible to do in every column sep ...



of course, as (temporary) work around is terminate each second row in matrix with for example [2pt], but his is annoying when matrix is huge, for example as is here.







tikz-matrix






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago







Zarko

















asked 5 hours ago









ZarkoZarko

122k865158




122k865158













  • If you write every even row/.style={blue} it works. Then ...

    – AndréC
    5 hours ago











  • @AndréC, it cover each second row with blue color. i expected that after each even row will be row separation 2pt as it is at columns.

    – Zarko
    5 hours ago











  • Yes, I know, my example suggests that the error may not be in the style, but in another place. Otherwise, the style would not work for the blue color either.

    – AndréC
    5 hours ago






  • 1





    The row sep option does not work with keys either row <number>, row <column number> column <column number>, every odd row

    – AndréC
    3 hours ago













  • Not related to the question: you initialized inner sep twice, the first time with 0pt and the second time with 1pt.

    – AndréC
    1 hour ago



















  • If you write every even row/.style={blue} it works. Then ...

    – AndréC
    5 hours ago











  • @AndréC, it cover each second row with blue color. i expected that after each even row will be row separation 2pt as it is at columns.

    – Zarko
    5 hours ago











  • Yes, I know, my example suggests that the error may not be in the style, but in another place. Otherwise, the style would not work for the blue color either.

    – AndréC
    5 hours ago






  • 1





    The row sep option does not work with keys either row <number>, row <column number> column <column number>, every odd row

    – AndréC
    3 hours ago













  • Not related to the question: you initialized inner sep twice, the first time with 0pt and the second time with 1pt.

    – AndréC
    1 hour ago

















If you write every even row/.style={blue} it works. Then ...

– AndréC
5 hours ago





If you write every even row/.style={blue} it works. Then ...

– AndréC
5 hours ago













@AndréC, it cover each second row with blue color. i expected that after each even row will be row separation 2pt as it is at columns.

– Zarko
5 hours ago





@AndréC, it cover each second row with blue color. i expected that after each even row will be row separation 2pt as it is at columns.

– Zarko
5 hours ago













Yes, I know, my example suggests that the error may not be in the style, but in another place. Otherwise, the style would not work for the blue color either.

– AndréC
5 hours ago





Yes, I know, my example suggests that the error may not be in the style, but in another place. Otherwise, the style would not work for the blue color either.

– AndréC
5 hours ago




1




1





The row sep option does not work with keys either row <number>, row <column number> column <column number>, every odd row

– AndréC
3 hours ago







The row sep option does not work with keys either row <number>, row <column number> column <column number>, every odd row

– AndréC
3 hours ago















Not related to the question: you initialized inner sep twice, the first time with 0pt and the second time with 1pt.

– AndréC
1 hour ago





Not related to the question: you initialized inner sep twice, the first time with 0pt and the second time with 1pt.

– AndréC
1 hour ago










1 Answer
1






active

oldest

votes


















4














The issue is with scopes. In order to make sure that the style code for the current row only applies to the current row, the style code is executed inside of a scope that is local to the current row. This scope is closed prior to ending the row and adding the row separation, so the value is reverted before it is applied. The solution is to make the change to the row sep global. The key row sep stores the value in pgfmatrixrowsep so we globally define this to be the updated value. Because this change is global, it applies to all rows going forward, so we need an every odd row key setting the row sep to zero to switch it back.



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={/utils/exec=gdefpgfmatrixrowsep{2pt}},
every odd row/.style={/utils/exec=gdefpgfmatrixrowsep{-pgflinewidth}},
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer


























  • thank you for explanation. are this means, that column as treated differently (not in column scope). i expected, that rows and columns should have the same approach in executing code (this can be concluded from description of these options in manual).

    – Zarko
    1 hour ago






  • 1





    i took liberty and add picture and slightly change code. thank you again (+1 at writing the first comment :-), for accepting i will wait a while)

    – Zarko
    1 hour ago











  • In the code the matrices are processed rows first and then columns. Because of this, the way the style code for a row is executed once at the beginning of the row and goes out of scope at the end of the row. The style code for a column is executed many times, once for each cell in the column. I suspect the asymmetry has something to do with this, but I don't feel like reading the code carefully enough to track down the particulars.

    – Hood Chatham
    57 mins ago











  • Anyways, the point is that the symmetry between rows and columns is an abstraction that the authors of tikz tried to create for the sake of user sanity, but it isn't perfect.

    – Hood Chatham
    56 mins ago











  • This is a nice analysis, +1 for that. Note, however, that you set these values globally, so every subsequent matrix will have it. Note also that the matrix library has means of "smuggling" values out of the group, which avoids making them global. Why this has not been used for every row I do not know.

    – marmot
    20 mins ago











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469954%2ftikz-matrix-why-every-even-row-doesnt-work-with-row-sep-option%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














The issue is with scopes. In order to make sure that the style code for the current row only applies to the current row, the style code is executed inside of a scope that is local to the current row. This scope is closed prior to ending the row and adding the row separation, so the value is reverted before it is applied. The solution is to make the change to the row sep global. The key row sep stores the value in pgfmatrixrowsep so we globally define this to be the updated value. Because this change is global, it applies to all rows going forward, so we need an every odd row key setting the row sep to zero to switch it back.



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={/utils/exec=gdefpgfmatrixrowsep{2pt}},
every odd row/.style={/utils/exec=gdefpgfmatrixrowsep{-pgflinewidth}},
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer


























  • thank you for explanation. are this means, that column as treated differently (not in column scope). i expected, that rows and columns should have the same approach in executing code (this can be concluded from description of these options in manual).

    – Zarko
    1 hour ago






  • 1





    i took liberty and add picture and slightly change code. thank you again (+1 at writing the first comment :-), for accepting i will wait a while)

    – Zarko
    1 hour ago











  • In the code the matrices are processed rows first and then columns. Because of this, the way the style code for a row is executed once at the beginning of the row and goes out of scope at the end of the row. The style code for a column is executed many times, once for each cell in the column. I suspect the asymmetry has something to do with this, but I don't feel like reading the code carefully enough to track down the particulars.

    – Hood Chatham
    57 mins ago











  • Anyways, the point is that the symmetry between rows and columns is an abstraction that the authors of tikz tried to create for the sake of user sanity, but it isn't perfect.

    – Hood Chatham
    56 mins ago











  • This is a nice analysis, +1 for that. Note, however, that you set these values globally, so every subsequent matrix will have it. Note also that the matrix library has means of "smuggling" values out of the group, which avoids making them global. Why this has not been used for every row I do not know.

    – marmot
    20 mins ago
















4














The issue is with scopes. In order to make sure that the style code for the current row only applies to the current row, the style code is executed inside of a scope that is local to the current row. This scope is closed prior to ending the row and adding the row separation, so the value is reverted before it is applied. The solution is to make the change to the row sep global. The key row sep stores the value in pgfmatrixrowsep so we globally define this to be the updated value. Because this change is global, it applies to all rows going forward, so we need an every odd row key setting the row sep to zero to switch it back.



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={/utils/exec=gdefpgfmatrixrowsep{2pt}},
every odd row/.style={/utils/exec=gdefpgfmatrixrowsep{-pgflinewidth}},
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer


























  • thank you for explanation. are this means, that column as treated differently (not in column scope). i expected, that rows and columns should have the same approach in executing code (this can be concluded from description of these options in manual).

    – Zarko
    1 hour ago






  • 1





    i took liberty and add picture and slightly change code. thank you again (+1 at writing the first comment :-), for accepting i will wait a while)

    – Zarko
    1 hour ago











  • In the code the matrices are processed rows first and then columns. Because of this, the way the style code for a row is executed once at the beginning of the row and goes out of scope at the end of the row. The style code for a column is executed many times, once for each cell in the column. I suspect the asymmetry has something to do with this, but I don't feel like reading the code carefully enough to track down the particulars.

    – Hood Chatham
    57 mins ago











  • Anyways, the point is that the symmetry between rows and columns is an abstraction that the authors of tikz tried to create for the sake of user sanity, but it isn't perfect.

    – Hood Chatham
    56 mins ago











  • This is a nice analysis, +1 for that. Note, however, that you set these values globally, so every subsequent matrix will have it. Note also that the matrix library has means of "smuggling" values out of the group, which avoids making them global. Why this has not been used for every row I do not know.

    – marmot
    20 mins ago














4












4








4







The issue is with scopes. In order to make sure that the style code for the current row only applies to the current row, the style code is executed inside of a scope that is local to the current row. This scope is closed prior to ending the row and adding the row separation, so the value is reverted before it is applied. The solution is to make the change to the row sep global. The key row sep stores the value in pgfmatrixrowsep so we globally define this to be the updated value. Because this change is global, it applies to all rows going forward, so we need an every odd row key setting the row sep to zero to switch it back.



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={/utils/exec=gdefpgfmatrixrowsep{2pt}},
every odd row/.style={/utils/exec=gdefpgfmatrixrowsep{-pgflinewidth}},
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer















The issue is with scopes. In order to make sure that the style code for the current row only applies to the current row, the style code is executed inside of a scope that is local to the current row. This scope is closed prior to ending the row and adding the row separation, so the value is reverted before it is applied. The solution is to make the change to the row sep global. The key row sep stores the value in pgfmatrixrowsep so we globally define this to be the updated value. Because this change is global, it applies to all rows going forward, so we need an every odd row key setting the row sep to zero to switch it back.



documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{matrix}

begin{document}
begin{tikzpicture}
matrix (m) [matrix of math nodes,
nodes={draw, font=footnotesize, minimum size=1em,
anchor=center,inner sep=0pt},
column sep=-pgflinewidth,
every even column/.style={column sep=2pt},
every even row/.style={/utils/exec=gdefpgfmatrixrowsep{2pt}},
every odd row/.style={/utils/exec=gdefpgfmatrixrowsep{-pgflinewidth}},
inner sep=1pt,
left delimiter={[},right delimiter={]},
]
{
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
alpha & beta & gamma & delta \
};
end{tikzpicture}
end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 1 hour ago









Zarko

122k865158




122k865158










answered 1 hour ago









Hood ChathamHood Chatham

4,2291428




4,2291428













  • thank you for explanation. are this means, that column as treated differently (not in column scope). i expected, that rows and columns should have the same approach in executing code (this can be concluded from description of these options in manual).

    – Zarko
    1 hour ago






  • 1





    i took liberty and add picture and slightly change code. thank you again (+1 at writing the first comment :-), for accepting i will wait a while)

    – Zarko
    1 hour ago











  • In the code the matrices are processed rows first and then columns. Because of this, the way the style code for a row is executed once at the beginning of the row and goes out of scope at the end of the row. The style code for a column is executed many times, once for each cell in the column. I suspect the asymmetry has something to do with this, but I don't feel like reading the code carefully enough to track down the particulars.

    – Hood Chatham
    57 mins ago











  • Anyways, the point is that the symmetry between rows and columns is an abstraction that the authors of tikz tried to create for the sake of user sanity, but it isn't perfect.

    – Hood Chatham
    56 mins ago











  • This is a nice analysis, +1 for that. Note, however, that you set these values globally, so every subsequent matrix will have it. Note also that the matrix library has means of "smuggling" values out of the group, which avoids making them global. Why this has not been used for every row I do not know.

    – marmot
    20 mins ago



















  • thank you for explanation. are this means, that column as treated differently (not in column scope). i expected, that rows and columns should have the same approach in executing code (this can be concluded from description of these options in manual).

    – Zarko
    1 hour ago






  • 1





    i took liberty and add picture and slightly change code. thank you again (+1 at writing the first comment :-), for accepting i will wait a while)

    – Zarko
    1 hour ago











  • In the code the matrices are processed rows first and then columns. Because of this, the way the style code for a row is executed once at the beginning of the row and goes out of scope at the end of the row. The style code for a column is executed many times, once for each cell in the column. I suspect the asymmetry has something to do with this, but I don't feel like reading the code carefully enough to track down the particulars.

    – Hood Chatham
    57 mins ago











  • Anyways, the point is that the symmetry between rows and columns is an abstraction that the authors of tikz tried to create for the sake of user sanity, but it isn't perfect.

    – Hood Chatham
    56 mins ago











  • This is a nice analysis, +1 for that. Note, however, that you set these values globally, so every subsequent matrix will have it. Note also that the matrix library has means of "smuggling" values out of the group, which avoids making them global. Why this has not been used for every row I do not know.

    – marmot
    20 mins ago

















thank you for explanation. are this means, that column as treated differently (not in column scope). i expected, that rows and columns should have the same approach in executing code (this can be concluded from description of these options in manual).

– Zarko
1 hour ago





thank you for explanation. are this means, that column as treated differently (not in column scope). i expected, that rows and columns should have the same approach in executing code (this can be concluded from description of these options in manual).

– Zarko
1 hour ago




1




1





i took liberty and add picture and slightly change code. thank you again (+1 at writing the first comment :-), for accepting i will wait a while)

– Zarko
1 hour ago





i took liberty and add picture and slightly change code. thank you again (+1 at writing the first comment :-), for accepting i will wait a while)

– Zarko
1 hour ago













In the code the matrices are processed rows first and then columns. Because of this, the way the style code for a row is executed once at the beginning of the row and goes out of scope at the end of the row. The style code for a column is executed many times, once for each cell in the column. I suspect the asymmetry has something to do with this, but I don't feel like reading the code carefully enough to track down the particulars.

– Hood Chatham
57 mins ago





In the code the matrices are processed rows first and then columns. Because of this, the way the style code for a row is executed once at the beginning of the row and goes out of scope at the end of the row. The style code for a column is executed many times, once for each cell in the column. I suspect the asymmetry has something to do with this, but I don't feel like reading the code carefully enough to track down the particulars.

– Hood Chatham
57 mins ago













Anyways, the point is that the symmetry between rows and columns is an abstraction that the authors of tikz tried to create for the sake of user sanity, but it isn't perfect.

– Hood Chatham
56 mins ago





Anyways, the point is that the symmetry between rows and columns is an abstraction that the authors of tikz tried to create for the sake of user sanity, but it isn't perfect.

– Hood Chatham
56 mins ago













This is a nice analysis, +1 for that. Note, however, that you set these values globally, so every subsequent matrix will have it. Note also that the matrix library has means of "smuggling" values out of the group, which avoids making them global. Why this has not been used for every row I do not know.

– marmot
20 mins ago





This is a nice analysis, +1 for that. Note, however, that you set these values globally, so every subsequent matrix will have it. Note also that the matrix library has means of "smuggling" values out of the group, which avoids making them global. Why this has not been used for every row I do not know.

– marmot
20 mins ago


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469954%2ftikz-matrix-why-every-even-row-doesnt-work-with-row-sep-option%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Alcázar de San Juan

Griza ansero

Heinkel He 51