Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should /tikz/every cell style take two args instead of one? #1280

Open
muzimuzhi opened this issue Sep 22, 2023 · 3 comments
Open

Should /tikz/every cell style take two args instead of one? #1280

muzimuzhi opened this issue Sep 22, 2023 · 3 comments
Labels

Comments

@muzimuzhi
Copy link
Member

Brief outline of the bug

Current implementation and usage

\tikzset{every cell/.style= {}}%

matrix/inner style/every cell/.code={%
\tikzset{every cell/.try={\the\pgfmatrixcurrentrow}{\the\pgfmatrixcurrentcolumn}}%
},

Corresponding docs
image

\begin{stylekey}{/tikz/every cell=\marg{row}\marg{column} (initially \normalfont empty)}
This style is installed at the beginning of each cell picture with the two
parameters being the current \meta{row} and \meta{column} of the cell. Note
that setting this style to |draw| will \emph{not} cause all nodes to be
drawn since the |draw| option has to be passed to each node individually.
Inside this style (and inside all cells), the current \meta{row} and
\meta{column} number are also accessible via the counters
|\pgfmatrixcurrentrow| and |\pgfmatrixcurrentcolumn|.
\end{stylekey}

Minimal working example (MWE)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}
% current
% \tikzset{every cell/.style={}}

\tikz[cells={execute at begin cell={\texttt{<rol-col #1>}}}]
  \matrix[matrix of nodes] { a & b \\ };

% proposed
\tikzset{every cell/.style 2 args={}}

\tikz[cells={execute at begin cell={\texttt{<row #1 col #2>}}}]
  \matrix[matrix of nodes] { a & b \\ };
\end{document}

image

@hmenke
Copy link
Member

hmenke commented Sep 22, 2023

Looks like a reasonable change, but we should make sure that this doesn't break any package or existing document.

@muzimuzhi
Copy link
Member Author

Smelled a sense of another breaking change for pgf 4.0.0 #869.

@hmenke
Copy link
Member

hmenke commented Sep 22, 2023

Actually, it's not breaking at all, because right now the behavior is already broken since it contradicts the documentation. I think we can actually go ahead and fix it (like I did e.g. in 3.1.5 when I repaired intersection numbering).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants