13

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?

3
  • @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
    Commented Feb 18, 2013 at 13:30
  • Yes, at the moment there is no built-in key for this.
    – Jake
    Commented Feb 18, 2013 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
    Commented Feb 18, 2013 at 15:02

1 Answer 1

14

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

\tikzset{ shorten <>/.style={ shorten >=#1, shorten <=#1 } }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .