tikz intersection circle problem

Gespeichert von nedab am Mi., 19.02.2020 - 19:53

I do love LaTeX or to be more specific Xe(La)TeX. And it is really fun to create astonishing work sheets or tests with it.
On the other hand I also hate it! There are so many things that can go wrong and its a pain to find the culprit.

Like today e.g. I just wanted to adjust some tikZ to display pyramides but it did not work in my editor QtikZ or with XeTeX.

It finally worked with overleaf.com. But why?

I found this code once upon a time ago:

[latex]%rechter Winkel
\newcommand\markangle[6][red]{% [color] {X} {origin} {Y} {mark} {radius}
    % filled circle: red by default
        \path[clip] (#2) -- (#3) -- (#4);
        \fill[color=#1,fill = white,draw=#1,name path=circle] %opacity=0.5
        (#3) circle (#6mm);
    % middle calculation
    \path[name path=line one] (#3) -- (#2);
    \path[name path=line two] (#3) -- (#4);
    name intersections={of=line one and circle, by={inter one}},
    name intersections={of=line two and circle, by={inter two}}
    ] (inter one) -- (inter two) coordinate[pos=.5] (middle);
    % bissectrice definition
    name path=bissectrice
    ] (#3) -- (barycentric cs:#3=-1,middle=1.2);
    % put mark
    name intersections={of=bissectrice and circle, by={middleArc}}
    ] (#3) -- (middleArc) node[pos=0.6] {#5}; % node[pos=1.3]
%ende rechter Winkel

And it creates german style 90 degree angles in drawings, also in 3D-drawing!


After a short search I thought it was a version problem since I always have the latest software and overleaf.com might not.
But it was not that easy, although tikZ intersections changed some syntax over the years.

I could have been a version change in the end, because XeTeX could not find my named path circle.
I think tikZ overall got more strict with code because I discovered that names in a scope must be declared global in order to be accessed globally which makes total sence. There issues are very commong with languages like C++ or JAVA.

This line now has one word more and it works like a charm!

[latex]\fill[color=#1,fill = white,draw=#1,name path global=circle] %opacity=0.5[/latex]