您好,使用 WinEdt 10 PDFLaTeX 编译下面的代码后,我从附件菜单运行了 arara,但出现了错误I didn't get any directives in 'animated1.tex' , so didn't do anything...
你能告诉我如何使用 arara 来执行此代码吗:
%arara: animate: {density: 160, delay: 8}
\documentclass[tikz]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{pgfplots}
\pgfplotsset{compat=1.13}
\usepgfplotslibrary{fillbetween}
\begin{document}
\foreach \mainangle [count=\xx, evaluate=\mainangle as \mark using (\mainangle/45)] in {0,5,...,355,360}{
\begin{tikzpicture}
\begin{axis}[
set layers,
x=1.5cm,y=1.5cm,
xmin=-3.7, xmax=8.2,
ymin=-1.5, ymax=1.5,
axis lines=center,
axis on top,
xtick={2,4,6,8},
ytick={-1,-.5,.5,1},
xticklabels={$90^{\circ} (\pi/2)$, $180^{\circ} (\pi)$, $270^{\circ} (3\pi/2)$,$360^{\circ} (2\pi)$},
xticklabel style={font=\tiny},
yticklabels={-1,-0.5,0.5,1},
ylabel={$\sin(x)$}, y label style={anchor=west},
xlabel={$x$}, x label style={anchor=south},
]
\pgfonlayer{pre main}
\addplot [fill=white] coordinates {(-4,-2) (8.5,-2) (8.5,2) (-4,2)} \closedcycle;
\endpgfonlayer
\path[name path=xaxis] (axis cs:-4,0) -- (axis cs:8,0);
\coordinate (O) at (axis cs:0,0);
% plot and circle
\addplot [samples=100,domain=0:8, name path=myplot](\x,{3 * sin(\x*45)/pi});
\draw[name path=circle] (axis cs:-2.5,0) circle (1.5cm);
% fill in circle and plot
\draw[black,fill=blue!40] (axis cs:-2.5,0) -- (axis cs:-1.5,0) arc (0:\mainangle:1.5cm) coordinate (cc) -- cycle;
\path[name path=mark] (axis cs:\mark,-1) -- (axis cs:\mark,1);
% small circles
\draw (cc) circle (3pt);
\path[name intersections={of=mark and myplot,by=cp}];
\draw (cp) circle (3pt);
\draw (cc) -- (cp) -- (cp|-O);
\ifnum\mainangle<5
\else
\addplot[blue!30] fill between[of=xaxis and myplot, soft clip={domain=-1:\mark}];
\fi
\end{axis}
\end{tikzpicture}}
\end{document}
答案1
您忘记了 arara 指令中的空格。
正确的应该是:
% arara: animate: {density: 160, delay: 8}
animate.yaml
请记住,如果您有如下规则,则此指令有效这是 cmhughes 的回答和图像魔术师已安装(安装时请记住选中选项“安装旧版实用程序(例如转换)”,否则convert.exe
将无法安装)。
您还需要将源文件编译进去,.pdf
否则无法开始转换。
所以我建议你添加规则
% arara: pdflatex
在上述操作之前,让 arara 为您完成全部工作。
编辑
假设你要将你的放在animate.yaml
文件夹中C:\arara\myrules
,则的内容araraconfig.yaml
必须是
!config
paths:
- C:\arara\myrules
该文件araraconfig.yaml
必须放在文件夹中C:\Users\<Username>
,其中<Username>
是您的 Windows 用户帐户名称。