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 know that the TikZ Arrow Tip Library (arrows) defines a circle arrow [-o], however this circle is too large for me. Is there any way I can control the size of the circle on the end of line?

share|improve this question
    
I am interested at a solution too. What I do at this point is to define a circular node manually: \begin{tikzpicture} \def\radius{2pt} \draw (0,0) -- (1,0) node [circle,radius=\radius,draw,fill=white,inner sep=\radius] {}; \end{tikzpicture} –  hpesoj626 Oct 26 '12 at 14:48
    
@Pygmalion Do you had checked the pgflibraryarrows.code.tex? If you change there the line \pgfpathcircle{\pgfqpoint{4.5\pgfutil@tempdima}{0bp}}{4.5\pgfutil@tempdima} by other with a value less than 4.5 you will obtain what you want. –  rafaeldf Oct 26 '12 at 15:24
    
@rafaeldf I was thinking of that too, but I do not know where to find tikz codes. –  Pygmalion Oct 26 '12 at 16:15
    
@Pygmalion Try look at ...\tex\generic\pgf\libraries inside the folder that you had selected for installation (e.g., C:\Program Files\...). –  rafaeldf Oct 26 '12 at 16:29
2  
it would be great to see a solution using \tikzset{o=<options go here>}, similar to how one can change the arrows easily using \tikzset{>=stealth} for example –  cmhughes Oct 26 '12 at 19:26
show 3 more comments

1 Answer

up vote 8 down vote accepted

You can use the decorations.markings library to define a style (say, o) that takes an optional argument for changing the size:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}

\tikzset{
    o/.style={
        shorten >=#1,
        decoration={
            markings,
            mark={
                at position 1
                with {
                    \draw circle [radius=#1];
                }
            }
        },
        postaction=decorate
    },
    o/.default=2pt
}
\begin{tikzpicture}    
\draw [o] (0,1) -- (4,3);
\draw [o=1pt] (1,1) -- (4,2);
\end{tikzpicture}
\end{document}
share|improve this answer
    
This is not exaclty the same as [-o]. In [-o] circle touches the end of the path, while [o] draws circle on the end of the path... I know that I have to add 2* befor #1 on line 3 of the definition, but I do not know how to calculate new position... –  Pygmalion Oct 29 '12 at 19:07
    
You can use shorten >=2*#1 together with \draw circle [xshift=-#1,radius=#1];. The local coordinate system is rotated, so that xshift moves the mark in the direction of the line. –  Jake Oct 29 '12 at 19:31
    
Thanks! That's it. –  Pygmalion Oct 29 '12 at 19:51
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.