Pfeile zur Erläuterung der Tabellenüberschrift

Pfeile zur Erläuterung der Tabellenüberschrift

InDasDie Antwort von StackOverflow können wir im Diagramm unten sehen.

Diagramm

Ich würde gerne wissen, wie das in Tikz geht. Ich hätte lieber keine Kästchen und Pfeile, die direkt unter den Überschriften auf die Werte zeigen, aber das sind Details, die ich wahrscheinlich hinbekomme, wenn ich etwas habe, womit ich arbeiten kann.

Antwort1

Das Zeichnen ist nicht schwierig, aber es ist mühsam, all diese Dinge anhand eines Screenshot einzufügen (weshalb ich einfach Folgendes hinzugefügt habe can 1usw.; Sie können diese Texte durch alles ersetzen, was Sie für passender halten).

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{fit,positioning}
\begin{document}
\begin{tikzpicture}[font=\sffamily,node distance=2pt and 4pt]
 \begin{scope}[local bounding box=top]
  \node (c1) {d};
  \node[right=of c1] (c2) {l};
  \node[fit=(c1) (c2),label=above:type]{};
  \node[right=1cm of c2] (c3) {r};
  \node[right=of c3] (c4) {w};
  \node[right=of c4] (c5) {x};
  \node[fit=(c3) (c5),label=above:users]{};
  \node[right=1cm of c5] (c6) {r};
  \node[right=of c6] (c7) {w};
  \node[right=of c7] (c8) {x};
  \node[fit=(c6) (c8),label=above:groups]{};
  \node[right=1cm of c8] (c9) {r};
  \node[right=of c9] (c10) {w};
  \node[right=of c10] (c11) {x};
  \node[fit=(c9) (c11),label=above:others]{};
 \end{scope}
 \foreach \X [count=\Y,evaluate=\Y as \Z using {int(12-\Y)},
 remember=\Z as \LastZ]
  in {can 1,can 2,can 3,can 4,can 5,can 6,can 7,can 8,can 9,can 10,can 11}
  {\ifnum\Y=1
   \node[anchor=north west] (l\Z) at ([xshift=1em,yshift=-1ex]top.south east) 
    {\X};
  \else
   \node[anchor=north west] (l\Z) at ([yshift=-0.2ex]l\LastZ.south west) {\X};
  \fi
  \draw[latex-] (c\Z) |- (l\Z);
  }
\end{tikzpicture}
\end{document}

Bildbeschreibung hier eingeben

Antwort2

Ich schlage ein völlig anderes Layout vor, bei dem nur Formen \tablenotesin threeparttableKombination mit Farben verwendet werden, was meiner Meinung nach genauso ausdrucksstark ist wie Pfeile:

\documentclass[11pt]{article}
\usepackage{array, threeparttable, booktabs}
\usepackage[svgnames]{xcolor}
\newcommand{\dir}{\textcolor{Goldenrod}d}
\newcommand{\syl}{\textcolor{LightSteelBlue}l}
\newcommand{\rd}{\textcolor{Salmon}r}
\newcommand{\wri}{\textcolor{Gold}w}
\newcommand{\exc}{\textcolor{YellowGreen}x}
\begin{document}

\begin{table}[!htbp]
\centering\sffamily
\begin{threeparttable}
  \caption{Table}
  \label{}
\begin{tabular}{*{4} {>{\centering\arraybackslash}p{1.2cm}}}
\toprule
type & users & group & others \\
\cmidrule(lr){1-1}\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}
\dir \enspace\syl & \rd\enspace\wri\enspace\exc & \rd\enspace\wri\enspace\exc& \rd\enspace\wri\enspace\exc \\
\bottomrule
\end{tabular}
\smallskip
\begin{tablenotes}[flushleft, online]\small
\item[\dir\rlap{:}] Is a directory.
\item[\syl: ] Is a symbolic link.
\item[\rd: ] Can Read,\, Read files.
\item[\wri: ] $\!\!$Can Write,\, Create files.
\item[\exc: ] Can Execute,\, List files.
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document} 

Bildbeschreibung hier eingeben

verwandte Informationen