2015-06-13 24 views

Trả lời

14

Một giải pháp, rất nhanh chóng, chỉ cần mở rộng quy mô đầu mũi tên là số %2 trong những điều sau đây:

\documentclass[multi=false,tikz,border=2mm]{standalone} 
\usetikzlibrary{arrows,decorations.markings} 

\begin{document} 

\begin{tikzpicture} 
%1 
\draw [->,>=stealth] (0,.5) -- (2,.5); 
%2 
\draw [decoration={markings,mark=at position 1 with 
    {\arrow[scale=3,>=stealth]{>}}},postaction={decorate}] (0,0) -- (2,0); 
\end{tikzpicture} 

\end{document} 

này tạo ra:

enter image description here

(xin lỗi vì zoom quá mức).

Nhiều hơn nữa trong câu trả lời cho this question và trong this answer, that I used as a source.

Phụ Lục

\tikzset cách tiếp cận. Mã này:

\documentclass[multi=false,tikz,border=2mm]{standalone} 
\usetikzlibrary{arrows,decorations.markings} 

\begin{document} 

\begin{tikzpicture} 
\tikzset{myptr/.style={decoration={markings,mark=at position 1 with % 
    {\arrow[scale=3,>=stealth]{>}}},postaction={decorate}}} 
%1 
\draw [->,>=stealth] (0,.5) -- (2,.5); 
%2 
\draw [myptr] (0,0) -- (2,0); 
\end{tikzpicture} 

\end{document} 

sản xuất cùng một đầu ra như trên (nguồn: PGF Manual, phần 2.8).

Rõ ràng bạn có thể sử dụng -Latex thay vì stealth.

+1

Định nghĩa ban đầu của tôi là \ tikzset {myptr/.style = -latex}. Tôi muốn thay đổi nó một cách đơn giản bởi vì nó được sử dụng ở nhiều nơi. Tôi đã cố gắng thay đổi nó thành một cái gì đó như \ tikzset {myptr/.style = {- Latex [length = 3mm, width = 5mm]}} nhưng nó tạo ra một lỗi: "Tôi không biết chiều dài của khóa [..." . BTW kiến ​​thức của tôi về tikz là khá nghèo. – Tsf

+1

Tôi chỉ thích những người sử dụng "myptr", nếu có thể. – Tsf

Các vấn đề liên quan