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:

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

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!

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