答案1
根据 Alain Matthes 的回答这里,你可以这样做
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\tikzset{->-/.style={decoration={
markings,
mark=at position #1 with {\arrow{>}}},postaction={decorate}}}
\begin{tikzpicture}
\draw (4,0) -- (4,2);
\draw[->-=.5] (4,0) -- (6,-2);
\draw[->-=.5] (2,-2) -- (4,0);
\end{tikzpicture}
\end{document}
答案2
或者不使用装饰
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, positioning}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (4,0);
\draw (A) -- (4,2);
\draw (2,-2) -- (A) node [sloped, pos=.5] {>} -- (6,-2) node [sloped, pos=.5] {>};
\fill (A) circle [radius=2pt];
\node [right=3pt of A] {$A$};
\node [below=3ex of A] {\large$X$};
\node [above left=3ex of A] {\large$O$};
\node [above right=3ex of A] {\large$O$};
\end{tikzpicture}
\end{document}
答案3
此外,使用pstricks-add
包非常简单。使用 进行编译xelatex
。
\documentclass[12pt]{article}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}
\psset{arrowsize=4pt 3}
\psline {*-}(4,0)(4,2)
\psline [ArrowInside=->,ArrowInsidePos=0.5](2,-2)(4,0)(6,-2)
\uput{07pt}[0](4,0){$A$}
\uput{20pt}[45](4,0){$O$}
\uput{20pt}[135](4,0){$O$}
\uput{20pt}[-90](4,0){$X$}
\end{pspicture}
\end{document}