1

I am pretty new to latex and pgfplots. I am trying to make a gif. Can anyone please explain what is the function of <\fr> in pgfonlayer section of the following code?

gif-image

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usepackage{lmodern}

\usepackage{tikz}
\usetikzlibrary{arrows,shapes}


\tikzstyle{selected edge} = [draw,line width=5pt,-,red!50]

\usetheme{Frankfurt}

\setbeamertemplate{navigation symbols}{}%
\tikzset{
   error_00/.style={color=blue,thin},
}
\begin{document}
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}

\begin{frame}
    \begin{figure}
        \begin{tikzpicture}[scale=1]

\foreach \pos/\name in {{(-12.117,45.857)/a}, {(-12.117,45.857)/b}, {(-7.809,45.857)/c}}
                \node (\name) at \pos {};


\draw[x=1 cm,y=1 cm,error_00] (-10.628,45.857) -- (-7.809,45.857);
\begin{pgfonlayer}{background}
                \foreach \source / \dest / \fr in {a/b/1/, b/c/2/}
                    \path<\fr>[selected edge] (\source.center) edge (\dest.center);
\end{pgfonlayer}
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}

I compile the file from this link: https://martin-thoma.com/how-to-visualize-graph-algorithms-with-latex . Additionally, I do not want to make the red line blink. I just want it to appear. Any ideas to achieve it with minimal amount of change. Thanks in advance.

tt_pre
  • 47
  • 1
    \source / \dest / \fr / \pos are variables within the loop. They will be in {a/b/1/, b/c/2/}. So \fr will loop as 1 and 2 and so make sense to use it in <> overlay specification. – Sigur Jul 01 '17 at 15:29
  • thanks for explaining. Is it possible to make it not blink. The red line would just appear and then stay there. – tt_pre Jul 01 '17 at 15:34
  • Make it <\fr->. – TeXnician Jul 01 '17 at 15:51
  • @TeXnician what does "-" do? it does not stop the blinking. I am struggling. It's a gif. and I am not sure whether it makes sense to search for answers that would stop the blinking... – tt_pre Jul 01 '17 at 15:56
  • I can not help anymore since I have no idea what you want. Your code contains only 2 pages with a lot of commands to produce a simple rule?! – Sigur Jul 01 '17 at 15:59
  • 1
    @Sigur I tried with <1->, it does not work. I just get one page. I want the red line to appear first and then stay there forever. removing <> leads to compilation error. Thanks. – tt_pre Jul 01 '17 at 15:59
  • Do you really need a loop to produce the red line? – Sigur Jul 01 '17 at 16:00
  • 1
    @tt you need to provide a MWE, otherwise it would be difficult to trace your code. I always found it useful to prepare a MWE, because it always help to understand the problem better, and sometimes, it solved the problem. – berkus Jul 01 '17 at 16:07
  • Hi I provided the MWE with output. Now, I want that red line to appear and stay there forever. I do not need a loop for that. But, when I create a big picture, I will need a loop. I am trying this on a single line, so it's easier to trace. I hope the problem is clear now. If not, please ask again. I will be happy to explain. – tt_pre Jul 01 '17 at 16:12
  • If \fr is the third and last variable, you do not want 1/ and 2/ but just 1 and 2. Otherwise, you get 1/- which isn't valid. Also, this has nothing to do with any GIF, as far as I can tell. And \tikzstyle is deprecated and ought not be used. – cfr Jul 01 '17 at 23:45
  • Maybe have a look to this example: Tikz animated figure in Beamer – Bobyandbob Jul 02 '17 at 08:52

0 Answers0