![adicione sobrescrito à chave `\matrix (m) [tabela]` no tikzpicture](https://rvso.com/image/472796/adicione%20sobrescrito%20%C3%A0%20chave%20%60%5Cmatrix%20(m)%20%5Btabela%5D%60%20no%20tikzpicture.png)
Gostaria de adicionar um sobrescrito a uma chave existente em um arquivo \matrix (m) [table]
. Isso denotará a transposta. Preciso decorar o aparelho para preservar o espaçamento com outro \matrix (m) [table]
.
Minha matriz e tentativa são dadas por
\documentclass{article}
%%% tikz
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{arrows}
\usetikzlibrary{decorations.text,decorations.pathreplacing,matrix,calc,positioning}
\usetikzlibrary{calligraphy}% AFTER decorations.text
\tikzset{
table/.style={
matrix of math nodes,
row sep=-\pgflinewidth,
column sep=-\pgflinewidth,
nodes={rectangle,text width=3em,align=center},
text depth=1.25ex,
text height=2.5ex,
nodes in empty cells,
left delimiter=[,
right delimiter={]},
ampersand replacement=\&
}
}
\newcommand*{\connectorH}[4][]{
\draw[#1] (#3) -| ($(#3) !#2! (#4)$) |- (#4);% https://hugoideler.com/wp-content/uploads/2013/01/connector.tex
}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[baseline,decoration=brace]
\matrix (m) [table] {
%1 %2 %3 %4 %5 %6 %7
A_{1,:}^\top\\
A_{2,:}^\top\\
};
\node at (m-1-1.north east) {$\qquad\quad{\top}$};
\end{tikzpicture}
\end{figure}
\end{document}
mas a transposta só termina no meio da matriz, não decorando a chave direita da matriz. Existe uma boa maneira de fazer isso enquanto ainda estiver usando \matrix (m) [table]
?
Responder1
Você poderia usar algo como \node[anchor=west, xshift=0.67em] at (m-1-1.north east) {$\top$};
, mas também poderia simplesmente substituir o delimitador correto (que também renderizaria o sobrescrito no tamanho de fonte correto):
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}
\tikzset{
table/.style={
matrix of math nodes,
row sep=-\pgflinewidth,
column sep=-\pgflinewidth,
nodes={
text width=3em,
align=center
},
text depth=1.25ex,
text height=2.5ex,
nodes in empty cells,
left delimiter={[},
right delimiter={]},
ampersand replacement=\&
}
}
\begin{document}
\begin{tikzpicture}
\matrix (m) [table, right delimiter={]^{\top}}] {
A_{1,:}^{\top} \\
A_{2,:}^{\top} \\
};
\end{tikzpicture}
\end{document}