4

I am trying to achieve something like this in TikZ with LaTeXiT to use it in a non TeX environment as an .svg or .png:

enter image description here

With this code:

\documentclass[11pt]{standalone}

\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}[x=1cm,y=1cm]
    %Center
    \coordinate[label=below:Z] (Z) at (3.5,1);
    \fill[black] (Z) circle (0.875mm);
    \fill[white, label=hi] (Z) circle (0.625mm);

    %Original triangle
    \coordinate[label=right:A](A) at (2,2);
    \coordinate[label=below:B](B) at (1,0);
    \coordinate[label=below:C](C) at (0,0);
    \draw[black,line width=0.5mm] (A) -- (B) -- (C) -- cycle node at (-0.5,0) [black,above left] {Original};

    %Rotated triangle
    \begin{scope}[rotate around={-160:(Z)}]
        \coordinate[label=below:A'](A) at (2,2);
        \coordinate[label=below left:B'](B) at (1,0);
        \coordinate[label=right:C'](C) at (0,0);
        \draw[black,line width=0.5mm,dashed] (A) -- (B) -- (C) -- cycle node at (0.5,1) [black,right] {Bild};
    \end{scope}
\end{tikzpicture}
\end{document}

And with help of this post (and lots of trying around before finding this..) I got this far, but I have no idea how to proceed to connect those coordinates with an arc. Or is my approach completely wrong?

enter image description here

0

1 Answer 1

4

Solution

After just a bit more of googling, I found out that I can simply use the names of the coordinates in the scope environment.

So this code emerged and solved my issue:

\documentclass[11pt]{standalone} % Remove font size option when using LaTeXiT, or you'll risk the clipping problem I encountered (see below)

\usepackage{tikz,tkz-euclide}
\usetkzobj{all}

\begin{document}
\begin{tikzpicture}[x=1cm,y=1cm]
    %Center
    \coordinate[label=below:Z] (Z) at (3.5,1);
    \fill[black] (Z) circle (0.875mm);
    \fill[white] (Z) circle (0.625mm);

    %Original triangle
    \coordinate[label=right:A](A) at (2,2);
    \coordinate[label=below:B](B) at (1,0);
    \coordinate[label=below:C](C) at (0,0);
    \draw[black,line width=0.5mm] (A) -- (B) -- (C) -- cycle node at (-0.5,0) [black,above left] {Original};

    %Rotated triangle
    \begin{scope}[rotate around={-160:(Z)}]
        \coordinate[label=below:A'](A2) at (2,2);
        \coordinate[label=below left:B'](B2) at (1,0);
        \coordinate[label=right:C'](C2) at (0,0);
        \tkzMarkAngle[size=2.693cm,arc=l,helpline](B2,Z,B);
        \tkzMarkAngle[size=3.640cm,arc=l,helpline](C2,Z,C);
        \tkzMarkAngle[size=1.803cm,arc=l,helpline](A2,Z,A);
        \draw[black,line width=0.5mm,dashed] (A2) -- (B2) -- (C2) -- cycle node at (0.5,1) [black,right] {Bild};
    \end{scope}
\end{tikzpicture}
\end{document}

Resulting in this:

enter image description here

And yes the radius of the arc is calculated by hand.

And now I have to find out why the f* C' and "Bild" isn't showing?

5
  • 1
    After adding \usetkzobj{all}, I get the C' and Bild nodes, but the dashed triangle is drawn above the original one. I needed to draw the dashed lines between A2, B2 and C2, not A, B and C, to get it in the correct place. (Edit: With TeX Live 2016, TikZ version 3.0.1a, tkz-euclide version 1.16c.) Oct 23, 2016 at 23:34
  • Oh man, i used A2, B2 and C2 too of course. I'll edit it. And yea you're right \usetkzobj{all} is used too. But when I use TexShop or similar I also get the Bild and C' but using LaTeXiT I don't? (also Tex Live 2016 and TikZ 3.0.1a and tkz-euclide 1.16c)
    – ToshMatik
    Oct 24, 2016 at 8:25
  • Hmm.. adding a further coordinate at around (8,0) fixes the problem for LaTeXiT.. I'll go with that botched method until I have a better solution :)
    – ToshMatik
    Oct 24, 2016 at 8:42
  • I don't know LaTeXit, but seems like it is a bit too aggressive when it comes to cropping. Oct 24, 2016 at 15:20
  • Wow.. LaTeXiT has an option to define the font size. Now when I define the font size in the preamble with \documentclass[11pt]{standalone} AND in LaTeXiT I get those cropped svg's. But using \documentclass{standalone} and setting the font size only in LaTeXiT removes the clipping problem. Glad I got it working though.
    – ToshMatik
    Oct 24, 2016 at 16:03

You must log in to answer this question.

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