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.

Why does this example only partially work?

\documentclass{minimal}
\usepackage{etex}
\usepackage{tikz}
\usetikzlibrary{shapes,calc,arrows,trees,positioning,through,intersections,fadings}
\begin{document}
    \begin{tikzpicture}[scale=0.5]
\coordinate (a) at (0,0);
\coordinate (b) at (6,0);
\coordinate (c) at (9,6);
\node(A)[label=$A$] at (a) {$\bullet$};
\node(B)[label=50:$B$] at (b)  {$\bullet$};
\node(C)[label=$C$] at (c) {$\bullet$};
\draw[thick] (a)--(b)--(c)--cycle;
%           \node(c1) at (a)[draw,circle through=(b)] {};
%           \coordinate(ac) at(intersection 1 of c1 and a--c);
%           
%           \node(c2) at (ac)[draw,circle through=(b)] {};
%           \node(c3) at (b)[draw,circle through=(ac)] {};
%           \coordinate(bta) at(intersection 1 of c2 and c3 );
%           \node(xx)[label=$C$] at (bta) {$\bullet$};
%       \coordinate(bisa) at(intersection 1 of a--bta and b--c);
%       \draw (a)--(bisa);
%%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%
        \node(c4) at (b)[draw,circle through=(a)] {};
            \coordinate(bc) at(intersection 1 of c4 and b--c);
            \node(xx)[label=$prova$] at (bc) {$\bullet$};
            \node(c5) at (bc)[draw,circle through=(a)] {};
            \node(c6) at (a)[draw,circle through=(bc)] {};
            \coordinate(btb) at(intersection 1 of c5 and c6 );
        \node(xx)[label=$prova$] at (btb) {$\bullet$};
        \coordinate(bisb) at(intersection 1 of b--btb and a--c);
        \draw (b)--(bisb);
%%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work%%%%%%%%%%%%%%%%%%
\node(c7) at (c)[draw,circle through=(b)] {};
\coordinate(ac) at(intersection 2 of c7 and a--c);
\node(xx)[label=$prova2$] at (ac) {$\bullet$};
%%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work %%%%%%%%%%%%%%%%%%

\end{tikzpicture}
\end{document}
share|improve this question
1  
Hi user13225, welcome to TeX.sx! I've formatted your code block for you, which can be done by selecting the block and pressing the {} button (or alternatively indenting each line by four spaces, but who wants to do that manually?). Could you add a bit more detail to your question? –  Jake Apr 3 '12 at 7:15
    
Why there is one extra brace } after the \end{document}? –  Harish Kumar Apr 3 '12 at 7:28
    
@HarishKumar: Sorry, I missed that when I formatted the code block. I believe it was an attempt by user13225 to format the code. –  Jake Apr 3 '12 at 7:49
    
@Jake: Oh, I thought it was a mistake which might have troubled user13225. Thanks –  Harish Kumar Apr 3 '12 at 7:53
    
You should always state what you try to achieve and what error or misbehavior you get instead. –  Martin Scharrer Apr 3 '12 at 10:29
show 1 more comment

1 Answer

First I think it would be best to use the new syntax with path name, name intersections etc. like in the Euclide's tutorial with pgf 2.1.

(c)--(a) instead of (a)--(c) solves the problem.

\documentclass{minimal}
\usepackage{etex}
\usepackage{tikz}
\usetikzlibrary{shapes,calc,arrows,through,intersections}
\begin{document}
\begin{tikzpicture}[scale=0.5]
\coordinate (a) at (0,0);
\coordinate (b) at (6,0);
\coordinate (c) at (9,6);
\node(A)[label=$A$] at (a) {$\bullet$};
\node(B)[label=50:$B$] at (b)  {$\bullet$};
\node(C)[label=$C$] at (c) {$\bullet$};
\draw[thick] (a)--(b)--(c)--cycle;
%%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%
            \node(c4) at (b) [draw,circle through=(a)] {};
            \coordinate(bc) at (intersection 1 of c4 and b--c);
            \node(xx) at (bc) {\color{red}$\bullet$};
            \node(c5) at (bc)[draw,circle through=(a)] {};
            \node(c6) at (a)[draw,circle through=(bc)] {};
            \coordinate(btb) at(intersection 1 of c5 and c6 );
            \node(xx) at (btb) {\color{green}$\bullet$};
            \node(bisb) at (intersection 1 of b--btb and a--c){\color{blue}$\bullet$};
            \draw[dashed] (b)--(bisb);     
%%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%
\node(c7) at (c)[draw,circle through=(b)] {};
\coordinate(ac) at (intersection 1 of c7 and c--a);
\node(xx) at (ac) {\color{orange}$\bullet$};

\end{tikzpicture}
\end{document}  

enter image description here

Update

With a more recent syntax, the code becomes

\documentclass{minimal}
\usepackage{etex}
\usepackage{tikz}
\usetikzlibrary{shapes,calc,arrows,through,intersections}
\begin{document}
\begin{tikzpicture}[scale=0.5]
  \tikzset{mark coordinate/.style={inner sep=0pt,
                                   outer sep=0pt,
                                   minimum size=3pt,
                                   fill=#1,
                                   circle}
                                   }
  \draw[thick] (0,0)  coordinate [mark coordinate=black,label=$A$]      (a) --
               (6,0)  coordinate [mark coordinate=black,label=50:$B$]   (b) --
               (9,6)  coordinate [mark coordinate=black,label=$C$]      (c) -- cycle ; 

  \node [name path=Circle1,draw,circle through=(a)] at (b) {};
  \path [name path=BC] (b) -- (c); 
  \path [name intersections={of=BC and Circle1, name=i}] 
        (i-1) coordinate [mark coordinate=red];
  \node [name path=Circle2,draw,circle through=(a)]   at (i-1)   {};
  \node [name path=Circle3,draw,circle through=(i-1)] at (a)     {};
  \fill [name intersections={of=Circle2 and Circle3, name=j}] 
        (j-1) coordinate [mark coordinate=green];
  \path [name path=AC]   (a) -- (c);
  \path [name path=Bj-1] (b) -- (j-1);
  \fill [name intersections={of=Bj-1 and AC, name=k}] 
        (k-1) coordinate [mark coordinate=blue];
  \draw [red] (b)--(k-1);      
  \node [name path=Circle4,draw,circle through=(b)] at (c)  {};
  \fill [name intersections={of=Circle4 and AC, name=l}] 
        (l-1) coordinate [mark coordinate=orange];    
\end{tikzpicture}
\end{document}
share|improve this answer
    
@MartinScharrer yes but I will try but my english is not good enough to add a lot of explanations. –  Alain Matthes Apr 3 '12 at 10:32
1  
This answer also begs for an example with tkz-euclide :) –  percusse Apr 3 '12 at 12:16
    
@percusse Yes it's possible for sure ! I need to update tkz- euclide to be able to use path namebut it's complicated because I use special tools to calculate the intersections. –  Alain Matthes Apr 3 '12 at 12:25
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.