[Tex/LaTex] How to draw images in Latex

draw

I'm trying to draw the following picture in LaTeX but I'm having trouble understanding what I should use. I've seen a few examples, but it's hard to adapt them into what I'm looking for.

enter image description here

If you could help, I'd be truly grateful.

Best Answer

Welcome to TeX.SE!

Here is a simple prototype of what you need. Hopefully, you may apply your desired customizations to it.

\documentclass[border=1pt]{standalone}
\usepackage{tikz}  %TikZ central library is called.
\usetikzlibrary{automata,positioning} % automata and positioning libraries are required to use nodes and coordinates in addition to placement propetries.
\begin{document}
    \begin{tikzpicture}[shorten >=1pt,node distance=1.0cm,on grid,auto] % Some customizations related to the size and the discatnce between nodes and arrow heads
    \node[state,rectangle, align=center] (q_r) [] {This is a \\ square}; % Here the nodes and coordinates are defined
    \node[coordinate] (q_0) [right=of q_r, xshift=3cm]   {};
    \node[coordinate] (q_1) [left=of q_r, xshift=-3cm, yshift=1mm]   {};
    \node[coordinate] (q_2) [left=of q_r, xshift=-3cm, yshift=-1mm]   {};
    \path[->] % path and draw commands connect the nodes and coordinates to each other.
    (q_r) edge [] node  {This is an arrow} (q_0);   
    \draw[->] ([yshift=-3mm]q_1) -- ([yshift=-2mm]q_r.west) node[midway,swap] {This is an arrow};
    \draw[->] ([yshift=3mm]q_2) -- ([yshift=2mm]q_r.west) node[midway] {This is an arrow};
    \end{tikzpicture}
\end{document}  

enter image description here

Related Question