3

I want to draw an image given in the picture. Till now I have been able to draw only

\documentclass{beamer}
\usepackage{mathtools}
\usepackage{array}
\usepackage{amsmath}
%\usetheme{Boadilla}
\usetheme{Madrid}
\usepackage{bibentry}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\setbeamertemplate{theorems}[numbered]
\usepackage{tikz}

\usepackage{graphicx}
\usepackage[section]{placeins}
\usepackage[utf8]{inputenc}

 \begin{document}
 \begin{frame}
 \begin{tikzpicture}
 \draw (0,0) -- (3,0) -- (3,4) -- (0,4) -- (0,0);
 \end{tikzpicture}
 \end{frame}

 \end{document}

Question : How to draw the image given below?

enter image description here

Sebastiano
  • 54,118
  • 1
    All you need for this are nodes and edges, all single elements (m, text, k) are nodes, all arrows are edges. See for example https://www.coga.tu-berlin.de/fileadmin/i26/download/AG_DiskAlg/FG_KombOptGraphAlg/kappmeier/talks/How_to_TikZ.pdf for a tutorial, e.g., page 8 (6/38 as numbered on the slide). – Marijn Jul 31 '19 at 11:12
  • See also https://tex.stackexchange.com/questions/15779/materials-for-learning-tikz. – Marijn Jul 31 '19 at 11:22
  • 1
    \begin{tikzpicture}[bullet/.style={fill,circle,inner sep=1.5pt}] \draw (0,0) rectangle (3,4) ; \path foreach \X [count=\Y]in {0.3,0.7,1.1,1.5,2.9,3.3,3.7} {(1.5,\X) node[bullet] (b\Y) {} }; \node (m) at (-1.5,2) {$m$}; \foreach \X in {1,...,7} {\draw[-stealth] (m) to[out=0,in=180] (b\X);} \end{tikzpicture} –  Jul 31 '19 at 11:33

1 Answers1

4

Wishing to be a starting point for TiKz.

\documentclass{beamer}
\usepackage{mathtools}
\usepackage{array}
\usepackage{amsmath}
%\usetheme{Boadilla}
 \usetheme{Madrid}
 \usepackage{bibentry}
 \usepackage[linesnumbered,ruled,vlined]{algorithm2e}
  \setbeamertemplate{theorems}[numbered]
  \usepackage{tikz}

     \usepackage{graphicx}

    \usepackage[section]{placeins}
   \usepackage[utf8]{inputenc}

 \begin{document}
 \begin{frame}
 \begin{center}
 \begin{tikzpicture}[dot/.style={
draw,
fill,
circle,
minimum size=4pt,
inner sep=0pt, outer sep=0pt,
},
>=stealth]
\node [draw,cyan,ultra thick,rectangle,minimum height=4cm,minimum width=3cm](rect){};
\draw[<->] ([xshift=3mm] rect.north east) -- ([xshift=3mm] rect.south east)node[fill=white,midway]{K};
\draw[ultra thick,<-] ([xshift=3mm] rect.north)--++(90:1)node[right]{text};
\begin{scope}[xshift={-4mm}]
\foreach \y/\k in {1.5/a,1/b,0.5/c}
\node [dot] at (0,\y) (\k) {};
\node at(0,0){\vdots}; 
\foreach \y/\k in {1.5/d,1/e,0.5/f}
\node [dot] at (0,-\y) (\k) {};
\end{scope}
\node at ([xshift=-10mm] rect.west)(m){m};
\draw [->](m) to[bend left](a);
\draw [->](m) to[bend left](b);
\draw [->](m) to[bend right](d);

 \end{tikzpicture}
 \end{center}
 \end{frame}

  \end{document}

enter image description here

  • Very nice and my compliments. But for the label, what is the font that have you used? – Sebastiano Aug 03 '19 at 22:11
  • 1
    @Sebastiano, thank you. As you seen, I did not change anything in OP code. It is from bemaer Madrid theme. –  Aug 03 '19 at 22:16
  • Oh, I get it. In your opinion, what font is the one used if you remember. If you don't remember it, it doesn't do anything. Thank you for your answer. – Sebastiano Aug 03 '19 at 22:18