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 am not sure if code will do much good here. I have included many standalone TikZ pictures but this pictures is the only one to act differently.

Here is the picture in compiled from the standalone .tex code.

enter image description here

Now here is the picture in the main .tex file. Notice the location of the alpha_2 and the arc in the main file which I just compiled again to verify everything was updated.

enter image description here

I don't know what to do about this discrepancy and how to correct it. The image is a previous run of the standalone that was incorrect. However, it refuses to update. This has never been an issue before.


In the main file, I am using the following code to include the TikZ picture. Additionally, I have \usepackage{standalone} in the preample of the main file.

\begin{figure*}
  \centering
  \includestandalone{flybytrailingside}
  \caption[Trailing Side Flyby]{A trailing side (or sunlit side) planetary           
    flyby.}
  \label{trailingflyby}
\end{figure*}

For the TikZ picture, I am using the document class standalone and then drawing the picture.

The code for \alpha_2 is

\draw (3.285, 2.15) arc[radius = .125, start angle = 90, end angle = -90]
  node[left, font = \tiny, inner sep = 0] {\(\alpha_2\)};

\documentclass[convert = false]{standalone}

\usepackage[utf8]{inputenc}          
\renewcommand{\rmdefault}{ppl}                   
\linespread{1.05}                
\usepackage[scaled]{helvet}                                              
\usepackage{courier}                                                           
\usepackage{eulervm}                      
\normalfont
\usepackage[T1]{fontenc}
\usepackage{textcomp}

\usepackage{tikz}
\usepackage{fp}

\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{backgrounds}
\usetikzlibrary{intersections}
\usetikzlibrary{fixedpointarithmetic}

\begin{document}
\begin{tikzpicture}[
  every label/.append style = {font = \tiny},
  line join = round, line cap = round, >=triangle 45,
  %scale = .04, transform shape                                                     
  ]
  \def\angle{45}
  \def\peri{.5}
  \def\planet{.4}
  \def\a{1}
  \def\circrad{3.5}
  \def\dom{3.15}

  \pgfmathsetmacro{\b}{\a / (tan(\angle))}

  \coordinate (O) at (0, 0);

  \draw[-latex] (O) -- (\circrad, 0) node[below left, font = \tiny]
  {\(\mathbf{V}\)};
  \draw[-latex] (\circrad, 0) -- +({1}, 0) node[right, font = \tiny]
  {\(\hat{\mathbf{u}}_V\)};
  \draw[-latex] (0, \circrad) -- +(0, {1}) node[above, font = \tiny]
  {\(\hat{\mathbf{u}}_S\)};
  \draw[thick, gray, name path global = soi] (O)
  circle[radius = \circrad];

  \begin{scope}[rotate = {-110}, shift = {(0, {-\a - \peri})},
    decoration = {markings,
      mark = at position 0.20 with {\arrow{latex reversed}},
      mark = at position 0.80 with {\arrow{latex reversed}}
    }]
    \draw[red, postaction = decorate, name path global = hyper]
    plot[domain = -\dom:\dom, samples = 500]
    ({\x}, {\a * sqrt(1 + (\x / \b)^2)});
    \draw[dashed] plot[domain = 0:\dom, samples = 100] ({\x}, {\a / \b * \x})
    coordinate (P1);

    \path plot[domain = 0:-\dom, samples = 100] ({\x}, {-\a / \b * \x})
    coordinate (P2);

    \draw[dashed] plot[domain = -\dom:0, samples = 100] ({\x}, {-\a / \b * \x})
    coordinate (I);
    \draw plot[domain = 0:.5, samples = 100] ({\x}, {-\a / \b * \x})
    coordinate (P3);
    \draw[dashed] (O) -- (I);

    \shadedraw[gray, inner color = blue!40!green,
    outer color = black!50!blue!50] (O) circle[radius = \planet];

    \draw[fixed point arithmetic, latex-latex] let
      \p0 = (I),
      \p1 = (O),
      \p2 = (P1),
      \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
      \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
      \n3 = {.75cm},
      \n4 = {(\n1 + \n2) / 2}
    in (I) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]
    node[fill = white, inner sep = 0, font = \tiny] at (\n4:.5cm) {\(\beta\)};

    \draw[fixed point arithmetic, latex-latex] let
      \p0 = (I),
      \p1 = (O),
      \p2 = (P2),
      \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
      \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
      \n3 = {.75cm},
      \n4 = {(\n1 + \n2) / 2}
    in (I) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]
    node[fill = white, inner sep = 0, font = \tiny] at (\n4:.5cm) {\(\beta\)};

    \draw[fixed point arithmetic, -latex] let
      \p0 = (I),
      \p1 = (P3),
      \p2 = (P1),
      \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
      \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
      \n3 = {.75cm},
      \n4 = {(\n1 + \n2) / 2}
    in (I) +(\n1:\n3) arc[radius = \n3, start angle = \n1, end angle = \n2]
    node[fill = white, inner sep = 0, font = \tiny] at (\n4:\n3) {\(\delta\)};
  \end{scope}

  \node[name intersections = {of = soi and hyper}] (P4) at
  ($(intersection-2)$) {};

  \draw[-latex] (P4.center) -- +(1.5, 0) node[font = \tiny, below left]
  {\(\mathbf{V}\)} coordinate (P5);
  \draw (P5) -- +(.5, 0) coordinate (P6);

  \path[name path global = circ] (P4.center) circle[radius = 1bp];
  \path[name intersections = {of = circ and hyper}] (P4.center) --
  ($(intersection-2)!.75cm!(intersection-1)$) coordinate (P7);

  \draw[-latex] (P5) -- +($(P7) - (P4)$) node[font = \tiny, right]
  {\(\mathbf{v}_{\infty_1}\)} coordinate (P8);
  \draw[-latex] (P4.center) -- (P8) node[font = \tiny, above,
  inner sep = 0, pos = .65] {\(\mathbf{V}_1^{(v)}\)};

  \node[name intersections = {of = soi and hyper}] (P9) at ($(intersection-1)$)
  {};

  \draw[-latex] (P9.center) -- +(1.5, 0) node[font = \tiny, below left]
  {\(\mathbf{V}\)} coordinate (P10);
  \draw (P10) -- +(.65, 0) coordinate (P11);

  \path[name path global = circ2] (P9.center) circle[radius = 1bp];
  \path[name intersections = {of = circ2 and hyper}] (P9.center) --
  ($(intersection-2)!.75cm!(intersection-1)$) coordinate (P12);

  \draw[-latex] (P10) -- +($(P12) - (P9)$) node[font = \tiny, pos =1.25]
  {\(\mathbf{v}_{\infty_2}\)} coordinate (P13);
  \draw[-latex] (P9.center) -- (P13) node[font = \tiny, fill = white,
  inner sep = 0, pos = .5, above = .1cm] {\(\mathbf{V}_2^{(v)}\)};

  \draw[fixed point arithmetic, -latex] let
    \p0 = (P4.center),
    \p1 = (P5),
    \p2 = (P8),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {.75cm},
    \n4 = {(\n1 + \n2) / 2}
  in (P4.center) +(\n1:\n3) arc[radius = \n3, start angle = \n1,
  end angle = \n2] node[fill = white, inner sep = 0, font = \tiny] at
  ([shift = (P4.center)] \n4:1cm) {\(\alpha_1\)};

  \draw[fixed point arithmetic, -latex] let
    \p0 = (P5),
    \p1 = (P6),
    \p2 = (P8),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {.45cm},
    \n4 = {(\n1 + \n2) / 2}
  in (P5) +(\n1:\n3) arc[radius = \n3, start angle = \n1,
  end angle = \n2] node[fill = white, inner sep = 0, font = \tiny] at
  ([shift = (P5)] \n4:\n3) {\(\phi_1\)};
  %{\pgfmathparse{\n2 - \n1}%                                                       
  %  $\pgfmathprintnumber{\pgfmathresult}^{\circ}$                                  
  %};                                                                               

  \draw[fixed point arithmetic] let
    \p0 = (P9.center),
    \p1 = (P10),
    \p2 = (P13),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {.5cm},
    \n4 = {(\n1 + \n2) / 2}
  in (P9.center) +(\n1:\n3) arc[radius = \n3, start angle = \n1,
  end angle = \n2];

  \draw[fixed point arithmetic] let
    \p0 = (P10),
    \p1 = (P11),
    \p2 = (P13),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {.5cm},
    \n4 = {(\n1 + \n2) / 2}
  in (P10) +(\n1:\n3) arc[radius = \n3, start angle = \n1,
  end angle = \n2] node[fill = white, inner sep = 0, font = \tiny] at
  ([shift = (P10)] \n4:.7cm) {\(\phi_2\)};
  %{\pgfmathparse{\n2 - \n1}%                                                       
  %  $\pgfmathprintnumber{\pgfmathresult}^{\circ}$                                  
  %};                                                                               

  \begin{scope}[on background layer]
    \draw[dashed] (O) -- +($(O) - 0.65*(I)$) coordinate (P14);
  \end{scope}

  \draw[latex-] (P14) -- +($(P4) - (P7)$) node[font = \tiny, left]
  {\(\mathbf{v}_{\infty_1}\)} coordinate (P15);
  \draw[-latex] (P15) -- +($(P12) - (P9)$) node[font = \tiny, below]
  {\(\mathbf{v}_{\infty_2}\)} coordinate (P16);
  \draw[-latex] (P14) -- (P16) node[font = \tiny, pos = .75, above]
  {\(\Delta\mathbf{V}^{(v)}\)};

  \draw[fixed point arithmetic] let
    \p0 = (P15),
    \p1 = (P14),
    \p2 = (P16),
    \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
    \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
    \n3 = {.25cm},
    \n4 = {(\n1 + \n2) / 2}
  in (P15) +(\n1:\n3) arc[radius = \n3, start angle = \n1,
  end angle = \n2] node[inner sep = 0, font = \tiny, inner sep = 0,
  fill = white] at ([shift = (P15)] \n4:\n3) {\(\delta\)};

  \draw (3.285, 2.15) arc[radius = .125, start angle = 90, end angle = -90]
  node[left, font = \tiny, inner sep = 0] {\(\alpha_2\)};
\end{tikzpicture}
\end{document}

I would like to add that this problem just occurred again with a new standalone. Here is the picture compiled from the standalone:

enter image description here

and here is the picture in the document:

This picture was just created, compiled, then added to the main document, and compiled. The code can be found here:

TikZ: drawing an evolution of an ellipse to a hyperbola with the same focus

enter image description here

share|improve this question
3  
I don't think someone will have a chance to help without the code. I think something wrong with the sizes: used absolute values (pt, px) insted of relative (em, ex). –  m0nhawk Jul 31 '13 at 13:37
3  
(unrelated: That's a really nice image, by the way. Very clear and organised!) –  Jake Jul 31 '13 at 13:44
    
@dustin: Well then there's something wrong with how you place \alpha_2 and the arc, as m0nhawk said. You will need to post the code in this case. –  Jake Jul 31 '13 at 13:45
    
@dustin: And how do you generate and position the small angle that \alpha_2 refers to? –  Jake Jul 31 '13 at 13:51
    
@dustin: Hehe, I'm not particularly fond of the arcs for the labels either, I would probably just have used a straight line that points to the small angle. –  Jake Jul 31 '13 at 13:52
show 4 more comments

1 Answer

up vote 1 down vote accepted

You should calculate the coordinate of the arc of $\alpha_2$ instead of providing a fixed number.

The corresponding arc is

\draw[fixed point arithmetic] let
  \p0 = (P9.center),
  \p1 = (P10),
  \p2 = (P13),
  \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
  \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
  \n3 = {.5cm},
  \n4 = {(\n1 + \n2) / 2}
    in (P9.center) +(\n1:\n3) arc[radius = \n3, start angle = \n1,
    end angle = \n2];

If you can copy this section and use \n4 for the position of the arc:

\draw[fixed point arithmetic] let
  \p0 = (P9.center),
  \p1 = (P10),
  \p2 = (P13),
  \n1 = {atan2(\x1 - \x0, \y1 - \y0)},
  \n2 = {atan2(\x2 - \x0, \y2 - \y0)},
  \n3 = {.5cm},
  \n4 = {(\n1 + \n2) / 2}
    in (P9.center) +(\n4:\n3) coordinate (test);
  \draw (test)
     %(3.285cm, 2.15cm) 
     arc[radius = .125, start angle = 90, end angle = -90]
     node[left, font = \tiny, inner sep = 0] {\(\alpha_2\)};

BTW.: If you try to scale the figure even by small amounts (factor 0.96) you get “interesting” results.

So propably you are using different TikZ settings as in the standalone file.

share|improve this answer
    
I am not scaling the figures at all. –  dustin Aug 26 '13 at 13:11
    
I just tried your answer, and I like using this method here. I believe I have an open question to automating this process. Your answer here would solve that question. I need to now check if it fixes the standalone issue. –  dustin Aug 26 '13 at 13:17
    
I can mimic your answer to solve this question but you should get the credit. So if you want you can provide the answer there. The problem is different but similar. –  dustin Aug 26 '13 at 13:21
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.