2

This question already has an answer here:

\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?

marked as duplicate by user121799 Jun 13 at 6:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

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 0.5 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}

edit: with defining edge styles you can make code a little bit shorter:

\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 0.5 with {\arrowreversed[semithick]{>}}},
every label/.append style = {font=\scriptsize},
every  edge/.append style = {postaction={decorate}}  % <----
     ]
\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   (a1) edge (a2) 
        (a2) edge (a3) 
        (a3) edge (a1) 
        (a1) edge (a4);
%
\node at (-2.5,1) {\textit{$G$}};
\end{tikzpicture}
\end{center}
\end{document}

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