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.

Consider the following snippet:

\begin{tikzpicture}
    \def\ptRad{2pt}
    \fill (0,0) circle (\ptRad);
    \fill (1,1) circle (\ptRad);
    \draw[<->, shorten <=\ptRad,shorten >=\ptRad] (0,0) -- (1,1);  
\end{tikzpicture}

Is there a way to use only one shortening key for both ends at the same time?

share|improve this question
    
@Jake: This is for sure nicer then my code. Should I understand from this that there is no build in way (at least currently) to shorten both end at once? –  Dror Feb 18 '13 at 13:30
    
Yes, at the moment there is no built-in key for this. –  Jake Feb 18 '13 at 13:35
    
pstricks provides this shortening via the single key nodesep. Separate end shortening can be set using nodesepA (for the source) and nodesepB (for the target). –  Werner Feb 18 '13 at 15:02
add comment

1 Answer

up vote 6 down vote accepted

You can define your own style that sets the shorten for both ends at the same time:

\tikzset{ shorten <>/.style={ shorten >=#1, shorten <=#1 } }
share|improve this answer
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.