Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to generate a snaked line with an arrow head at the end of the line, I can use the following code:

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{tikz}
\usetikzlibrary{snakes}

\begin{document}
\begin{tikzpicture}[decoration=snake] % used for wavy arrows
\draw[>=stealth, ->, snake=snake,segment amplitude = .4mm, segment length = 2mm] (1.5,6.5) -- (0,9.5);
\end{tikzpicture}

\end{document}

However, the placement of the arrowhead does not look correct in the sense that it is not in the center at the end of the line. How can I solve this?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

You can give a little room for the arrowhead computation by terminating the decoration a little earlier using post length key.

Also snake library is now obsolete and part of the decorations.pathmorphing library. So better switch to that or update your TikZ distribution if it's still the older version.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}
\begin{tikzpicture}
\draw[-stealth,
decoration={snake, 
    amplitude = .4mm,
    segment length = 2mm,
    post length=0.9mm},decorate] (1.5,6.5) -- (0,9.5);
\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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