1

I want to draw the figure using TIkZ in a beamer slide.

I have tried like this

\begin{figure} 
    \centering
    \begin{tikzpicture}[scale=0.47]
        \tikzset{%
            every matrix/.style={%
                inner sep=-\pgflinewidth,
                matrix of math nodes,
                column sep=-\pgflinewidth,
                nodes={draw=red,font=\color{blue}\footnotesize,minimum size=.55cm,anchor=center},
                ampersand replacement=\&}
        } 
        \matrix[above] (t1) at (0,0) {\cdots \& K \& \cdots\\};
        \matrix[below] (b1) at (0,0) {\cdots \& \bullet \& \bullet \& \& \cdots\\}; 
    \end{tikzpicture} 
\end{figure}

enter image description here

  • 1
    \begin{figure} \centering \begin{tikzpicture}[scale=0.47] \tikzset{every matrix/.style={inner sep=-\pgflinewidth,matrix of math nodes,column sep=-\pgflinewidth,nodes={draw=red,font=\color{blue}\footnotesize,minimum size=.55cm,anchor=center},ampersand replacement=\&}} \matrix[above] (t1) at (0,0) {\cdots \& K \& \cdots\\}; \matrix[below] (b1) at (0,0) {\cdots \& \bullet \& \bullet \& \& \cdots\\}; \end{tikzpicture} \end{figure} – SK Hafizul Islam Apr 15 at 7:55
  • 1
    Please add this to the question. – Henri Menke Apr 15 at 7:57
1

Something like this?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{figure} 
    \centering
    \begin{tikzpicture}[scale=0.47]
        \tikzset{%
            every matrix/.style={%
                inner sep=-\pgflinewidth,
                matrix of math nodes,
                column sep=-\pgflinewidth,
                nodes={draw=red,font=\color{blue}\footnotesize,minimum size=.55cm,anchor=center},
                ampersand replacement=\&}
        } 
        \matrix[above] (t1) at (0,0) {\cdots \& K \& \cdots\\};
        \matrix[below] (b1) at (0,0) {\cdots \& \bullet \& \bullet \& \& \cdots\\};
        \draw[blue] (b1-1-2.center) -- ++ (-1,-2) node[pos=1.25] {$A_i$};
        \draw[blue] (b1-1-3.center) -- ++ (1,-2) node[pos=1.25] {$A_j$};
        \node[align=left,blue] at (7,0) {%
        \begin{tabular}{@{}r@{:\ }l@{}}
            $K$ & key\\
            $A_i,A_j$ & something else
        \end{tabular}};
    \end{tikzpicture} 
\end{figure}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.