使用 ggb 文件在 Beamer 中制作动画

使用 ggb 文件在 Beamer 中制作动画

我可以用来beamer显示 GeoGebra 创建的动画吗?GeoGebra 可以将图形导出为 PGF/TikZ。

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{qqqqff}{rgb}{0.,0.,1.}
\definecolor{ffqqqq}{rgb}{1.,0.,0.}
\definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\draw[->,color=black] (-1.097777777777778,0.) -- (6.4044444444444455,0.);
\foreach \x in {-1.,-0.5,0.5,1.,1.5,2.,2.5,3.,3.5,4.,4.5,5.,5.5,6.}
\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->,color=black] (0.,-2.0044444444444456) -- (0.,2.1555555555555586);
\foreach \y in {-2.,-1.5,-1.,-0.5,0.5,1.,1.5,2.}
\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
\draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
\clip(-1.097777777777778,-2.0044444444444456) rectangle (6.4044444444444455,2.1555555555555586);
\draw [line width=2.pt] (0.,0.) circle (1.cm);
\draw [domain=-0.00:6.2918,color=ffqqqq] plot(\x,{sin(\x*360/6.2918)});
\draw [line width=1.2pt,dash pattern=on 2pt off 2pt,color=qqqqff] (0.9427546655283462,0.3334870921408144)-- (0.34,0.3334870921408144);
\begin{scriptsize}
\draw [fill=uuuuuu] (0.9427546655283462,0.3334870921408144) circle (1.5pt);
\draw[color=uuuuuu] (1.0088888888888892,0.4577777777777792) node {$P$};
\draw [fill=uuuuuu] (0.34,0.3334870921408144) circle (1.5pt);
\draw[color=uuuuuu] (0.40444444444444455,0.4577777777777792) node {$Q$};
\end{scriptsize}
\end{tikzpicture}
\end{document}

答案1

以下文字摘自http://texwelt.de/wissen/fragen/7875/kann-ich-eine-interaktive-geogebra-datei-in-ein-latex-beamer-dokument-einbinden

@HenriMenke 如果你想自己回答这个问题,我很乐意删除它


  1. 将动画保存为 gif 动画,请参阅https://www.geogebra.org/manual/en/Export_to_LaTeX_%28PGF,_PSTricks%29_and_Asymptote#Export_-_Graphics_View_as_Animated_GIF查看教程

  2. 将此 .gif 分成单独的帧。您可以使用以下命令行表达式来执行此操作:

    convert -density 100 animate.gif animate-%d.pdf
    

    这将生成单独的文件,名为 animate-0.pdf,例如 animate-200.pdf

  3. 要在 Beamer 中为这些文件制作动画:

    \documentclass{beamer}
    \usepackage{animate}
    \begin{document}
    \begin{frame}
      \animategraphics[
      autoplay,loop,
      width=.7\textwidth,
      height=.7\textheight
      ]{10}{animate/animate-}{0}{200}
    \end{frame}
    \end{document}
    
  4. 使用 Adob​​e Reader(或其他支持 JavaScript 的查看器)查看 pdf。

相关内容