How to put arrow head in latex?

by J.Doe   Last Updated June 13, 2019 06:23 AM

\documentclass[a4paper, 12pt]{article}

\usepackage{amsfonts}

\usepackage{tikz}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\newtheorem{example}[theorem]{Example}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=0.65,
       thick,
       acteur/.style={
         circle,
         fill=blue,
         thick,
         inner sep=0.5pt,
         minimum size=1.8mm
       }
     ] 



           \node (a3) at (0,0) [acteur,label=below:\scriptsize{3}]{};
           \node (a1) at (1.5,1)[acteur,label=below:\scriptsize{1}]{}; 
           \node (a2) at (0,2) [acteur,label=above:\scriptsize{2}]{}; 
           \node (a4) at (3,1) [acteur,label=right:\scriptsize{4}]{}; 


           \draw [<-] (a1) -- (a2); 
           \draw [<-] (a2) -- (a3); 
           \draw(a3) -- (a1);
           \draw [<-] (a1) -- (a4);






 \node at (-2.5,1) {\textit{$G$}};
\end{tikzpicture}
\end{center}
\end{document}

In this figure, I need the arrowhead in the middle of the edge. How to do this in Latex?

Tags : tikz-pgf


Answers 1


enter image description here

with help of decorations.markings library:

\documentclass[a4paper, 12pt]{article}
\usepackage{amsfonts}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}
\begin{center}
    \begin{tikzpicture}[%scale=0.65,
acteur/.style = {circle, fill=blue, thick,
                 inner sep=0.5pt, outer sep=0pt, minimum size=1.8mm},
   decoration = {markings, mark=at position 1cm with {\arrowreversed[semithick]{>}}},
every label/.append style = {font=\scriptsize},
     ]
\node (a3) at (0,0) [acteur,label=below:3]{};
\node (a1) at (1.5,1)[acteur,label=below:1]{};
\node (a2) at (0,2) [acteur,label=above:2]{};
\node (a4) at (3,1) [acteur,label=right:3]{};
%
\draw[postaction={decorate}] (a1) -- (a2);
\draw[postaction={decorate}] (a2) -- (a3);
\draw[postaction={decorate}] (a3) -- (a1);
\draw[postaction={decorate}] (a1) -- (a4);
%
\node at (-2.5,1) {\textit{$G$}};
\end{tikzpicture}
\end{center}
Zarko
Zarko
June 13, 2019 06:21 AM

Related Questions


Updated April 27, 2019 15:23 PM

Updated December 20, 2018 03:23 AM

Updated November 20, 2018 12:23 PM

Updated December 17, 2018 22:23 PM

Updated December 18, 2018 02:23 AM