3

MWE:

\documentclass[12pt]{article}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}
    \draw [line width=1pt] (0,5)-- (0,0);
    \draw [line width=1pt] (5,0)-- (0,5);
    \draw [line width=1pt] (0,0)-- (5,0);
    \draw [fill=black] (0,5) circle (1.5pt);
    \draw[color=black] (0.0,5.5) node {$A$};
    \draw [fill=black] (0,0) circle (1.5pt);
    \draw[color=black] (0.0,-0.5) node {$B$};
    \draw [fill=black] (5,0) circle (1.5pt);
    \draw[color=black] (5.0,-0.5) node {$C$};
    \end{tikzpicture}
\end{document}

Question:

How can I draw direction arrow on each lines of triangle? (all possible style of arrows)

5

Maybe I misread the question, but if you want to vary the type of the arrow you may want to use

\documentclass[12pt]{article} 
\usepackage{tikz} 
\usetikzlibrary{decorations.markings}
\begin{document}
% based on https://tex.stackexchange.com/a/39282/121799
\tikzset{->-/.style n args={2}{decoration={
  markings,
  mark=at position #1 with {\arrow{#2}}},postaction={decorate}}}
\begin{tikzpicture}[bullet/.style={circle,inner sep=1.5pt,fill}] 
 \path  (0,5) node[bullet,label=above:$A$](A){}
  (0,0) node[bullet,label=below:$B$](B) {}
  (5,0) node[bullet,label=below:$C$](C) {};
  \foreach \X/\Arrow [remember=\X as \LastX (initially C)]in
  {A/latex,B/stealth,C/>}
  {\draw[line width=1pt,->-={0.5}{\Arrow}] (\LastX) -- (\X);}
\end{tikzpicture} 
\end{document}

enter image description here

As for your comment: this draws three triangles. Is that what you are looking for?

\documentclass[12pt]{article} 
\usepackage{tikz} 
\usetikzlibrary{decorations.markings}
\begin{document}
% based on https://tex.stackexchange.com/a/39282/121799
\tikzset{->-/.style n args={2}{decoration={
  markings,
  mark=at position #1 with {\arrow[line width=1pt]{#2}}},postaction={decorate}}}
\begin{tikzpicture}[bullet/.style={circle,inner sep=1.5pt,fill}] 
 \begin{scope}
  \path  (0,5) node[bullet,label=above:$A$](A){}
   (0,0) node[bullet,label=below:$B$](B) {}
   (5,0) node[bullet,label=below:$C$](C) {};
   \foreach \X [remember=\X as \LastX (initially C)] in  {A,B,C}
   {\draw[line width=1pt,->-={0.5}{latex}] (\LastX) -- (\X);}
  \end{scope} 
 \begin{scope}[xshift=6cm]
  \path  (0,5) node[bullet,label=above:$A$](A'){}
   (0,0) node[bullet,label=below:$B$](B') {}
   (5,0) node[bullet,label=below:$C$](C') {};
   \foreach \X [remember=\X as \LastX (initially C')]in  {A',B',C'}
   {\draw[line width=1pt,->-={0.5}{stealth}] (\LastX) -- (\X);}
  \end{scope} 
  \begin{scope}[yshift=-6.6cm]
  \path  (0,5) node[bullet,label=above:$A$](A''){}
   (0,0) node[bullet,label=below:$B$](B'') {}
   (5,0) node[bullet,label=below:$C$](C'') {};
   \foreach \X [remember=\X as \LastX (initially C'')]in  {A'',B'',C''}
   {\draw[line width=1pt,->-={0.5}{>}] (\LastX) -- (\X);}
  \end{scope} 
\end{tikzpicture} 
\end{document}

enter image description here

10
  • No friend, you understand my question better And the answer that I had hoped for almost got to be found. Only one request is please give me three different codes with arrows(three triangle with arrows) that you mentioned.
    – Math-Man
    Mar 14 '19 at 4:27
  • Should i increase size of arrows? i am waiting.......
    – Math-Man
    Mar 14 '19 at 4:31
  • @Sandy The three different arrows are already in \foreach \X/\Arrow [remember=\X as \LastX (initially C)]in {A/latex,B/stealth,C/>}, where they are set as latex, stealth and standard types. Yes, you can make the arrows thicker e.g. by saying {\arrow[line width=2pt]{#2}}} instead of {\arrow{#2}}}.
    – user121799
    Mar 14 '19 at 4:34
  • 1
    @Sandy Yes, I will be happy to follow your request if I understand it. You want three triangles? If so, do they all have the same dimensions? Are the next to each other? Or do you want 3 arrow heads on a given edge?
    – user121799
    Mar 14 '19 at 4:45
  • 2
    @Sandy Just for additional information, here is a (quite complete) list of available arrow tips.
    – user156344
    Mar 14 '19 at 5:08
4

Using TikZ: How to draw an arrow in the middle of the line?

%\documentclass[border=2mm]{standalone}
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}

    \draw [fill=black] (0,5) circle (1.5pt);
    \draw[color=black] (0.0,5.5) node {$A$};
    \draw [fill=black] (0,0) circle (1.5pt);
    \draw[color=black] (0.0,-0.5) node {$B$};
    \draw [fill=black] (5,0) circle (1.5pt);
    \draw[color=black] (5.0,-0.5) node {$C$};

\begin{scope}[very thick,decoration={
    markings,
    mark=at position 0.5 with {\arrow{>}}}
    ] 
    \draw [line width=1pt,postaction={decorate}] (0,5)-- (0,0);
    \draw [line width=1pt,postaction={decorate}] (5,0)-- (0,5);
    \draw [line width=1pt,postaction={decorate}] (0,0)-- (5,0);
\end{scope}
\end{tikzpicture}
\end{document}
4
  • Is it possible of article document type?
    – Math-Man
    Mar 14 '19 at 4:36
  • @Sandy Yes...sure
    – sandu
    Mar 14 '19 at 4:37
  • Would you please modified your codes for article?
    – Math-Man
    Mar 14 '19 at 5:07
  • @Sandy done... see the code above....
    – sandu
    Mar 14 '19 at 5:14

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.