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 use tkz-graph.sty from Altermundus. When I make an arrow from vertex A to vertex B, the arrow is too long: it goes from the center of A to the center of B. Can I shorten the arrow on both ends by a factor? In PSTricks, I used nodesep, but that doesn't work in a tikzpicture.

share|improve this question
4  
Welcome to TeX&Co! I hope you enjoy your stay! If you post a MWE (Minimal Working Example) it would encourage people to change your code so that it works, rather than have to try to guess the setup you are interested in....(just some friendly advice) –  Yossi Farjoun Nov 29 '10 at 21:20
1  
Without an example it's hard to answer, but have you tried the anchors? Each node in TikZ has a set of anchors (refer to the excellent pgf manual), like "north", "west", "southeast" and so on. –  Matten Nov 29 '10 at 22:10
add comment

1 Answer

You can use the shorten > and shorten < options. For example

\documentclass{minimal}  
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \fill (0,0) circle (0.05);
  \fill (2,0) circle (0.05);
  \draw[shorten >=0.5cm,shorten <=1cm,->] (0,0) -- (2,0);
\end{tikzpicture}
\end{document}

produces example.

However, there are few situations where you have to use that directly. Usually it is better to choose an anchor of the node (eg. mynode.east) and maybe set the inner sep and outer sep options of the nodes.

Maybe if you post an example of what you are trying to achieve, we can figure out what the best approach in that case is.

share|improve this answer
    
Thanks Caramdir, I used shorten and calculated my own factor- works perfectly, thanks –  Douglass Nov 29 '10 at 22:53
add comment

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.