I created a batch file animator.bat taking two parameters (a TeX input filename without extension and the number of pages).
rem animator.bat
rem %1 TeX filename without extension
rem %2 The number of pages
latex "%~1"
latex "%~1"
dvips "%~1"
gswin64c -dNOPAUSE -dBATCH -sDEVICE=ps2write -sOutputFile="%~1-%%d.ps" "%~1.ps"
latex --jobname="%~1" "\def\FileName{%~1-}\def\PageCount{%~2}\input{template}"
latex --jobname="%~1" "\def\FileName{%~1-}\def\PageCount{%~2}\input{template}"
dvisvgm --exact --font-format=woff --zoom=-1 --precision=1 "%~1"
for %%x in (aux log out toc ps dvi) do (if exist "%~1*.%%x" del "%~1*.%%x")
chrome "%~1.svg"
I also have a template template.tex as follows.
% template.tex
\documentclass[dvisvgm]{article}
\usepackage{animate,graphicx}
\begin{document}
\animategraphics[palindrome,controls,loop,autoplay,scale=1]{25}{\FileName}{1}{\PageCount}%
\end{document}
A test input file test.tex is given as follows.
% test.tex
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}
\def\f{x^2-x-6}
\psset{unit=3,algebraic}
\def\Atom#1{%
\begin{pspicture}(-1.5,-6.5)(1.75,-2.75)
\psplot[linecolor=blue]{-1}{1}{\f}
\psline[linecolor=green,linewidth=6\pslinewidth](-1,-3.5)(#1,-3.5)
\psline[linecolor=green,linewidth=6\pslinewidth](0,0|*-1 {\f})(0,0|*{#1 .5 gt {.5}{#1} ifelse} {\f})
\psline[linecolor=orange,linestyle=dashed](#1,-3.5)(*#1 {\f})(0,0|*#1 {\f})
\pscircle*[linecolor=red](*#1 {\f}){2pt}
\psaxes[linecolor=lightgray,Oy=-3.50,Dy=.25,Dx=.5]{->}(0,-3.5)(-1.49,-6.49)(1.5,-3)[$x$,0][$y$,90]
\end{pspicture}}
\begin{document}
\multido{\r=-1.0+.125}{17}{\Atom{\r}}
\end{document}
If I execute the batch
animator.bat test 17
it produces the following error.
processing page 1 PostScript error: undefined in resourcestatus
Operand stack: 10 --nostringval-- false CMSY10 CMSY10 Font CMSY10 CMSY10 CMSY10 false true
If I am not wrong, this error comes from the dvisvgm.
Question
How to fix it?
Last Update
And if I disable the \psaxes by commenting it, the error immediately vanishes.
Or by sandwiching with animateinline (that actually I don't like because it is not so flexible)
% example.tex
\documentclass[dvisvgm]{article}
\usepackage{pst-plot,animate}
\pagestyle{empty}
\psset{unit=3,algebraic}
\def\f{x^2-x-6}
\def\Atom#1{%
\psplot[linecolor=blue]{-1}{1}{\f}
\psline[linecolor=green,linewidth=6\pslinewidth](-1,-3.5)(#1,-3.5)
\psline[linecolor=green,linewidth=6\pslinewidth](0,0|*-1 {\f})(0,0|*{#1 .5 gt {.5}{#1} ifelse} {\f})
\psline[linecolor=orange,linestyle=dashed](#1,-3.5)(*#1 {\f})(0,0|*#1 {\f})
\pscircle*[linecolor=red](*#1 {\f}){2pt}
\psaxes[linecolor=lightgray,Oy=-3.50,Dy=.25,Dx=.5]{->}(0,-3.5)(-1.49,-6.49)(1.5,-3)[$x$,0][$y$,90]
}
\begin{document}
\begin{animateinline}[%
begin={\begin{pspicture}(-1.5,-6.5)(1.75,-2.75)},
end={\end{pspicture}},
controls,autoplay,loop]{25}
\newframe
\multiframe{17}{r=-1.0+.125}{\Atom{\r}}
\end{animateinline}
\end{document}
and invoked
latex example
latex example
dvisvgm --exact --font-format=woff --zoom=-1 example
the output looks really good.
The lastest update
If I produce a multipage PDF first, convert it to a bunch of separate PS files and then animate with the following batch (builder.bat)
rem builder.bat
rem %1 TeX filename without extension
rem %2 The number of pages
latex "%~1"
latex "%~1"
dvips "%~1"
ps2pdf "%~1.ps"
gswin64c -dNOPAUSE -dBATCH -sDEVICE=ps2write -sOutputFile="%~1-%%d.ps" "%~1.pdf"
latex --jobname="%~1" "\def\FileName{%~1-}\def\PageCount{%~2}\input{template}"
latex --jobname="%~1" "\def\FileName{%~1-}\def\PageCount{%~2}\input{template}"
dvisvgm --exact --font-format=woff --zoom=-1 "%~1"
for %%x in (aux log out toc ps dvi) do (if exist "%~1*.%%x" del "%~1*.%%x")
chrome "%~1.svg"
invoking builder test 17 produce as follows. Note that test.tex is the original input file without animateinline.
Now it has no labels.


preview, just add\pagestyle{empty}. – AlexG Jan 04 '19 at 08:01test.texandtemplate.texmanually works without a problem here (Linux). I am using Ghostscript-9.26. Note thatlatexshould be run at least twice in general. (I am told to do so, if I run it manually on your example files.) – AlexG Jan 04 '19 at 08:05test.psto PDF and see whether fonts are embedded as Type-1. – AlexG Jan 04 '19 at 16:46-font-format=woff– Jan 04 '19 at 17:43dvips -j1 <jobname>– Jan 04 '19 at 18:14dvisvgm --versionis for medvisvgm 2.3.5and GhostScript 9.26. With TL2018 and Linux no problem. – Jan 04 '19 at 18:20updmap-sys --forcein the command window and try again. – Jan 04 '19 at 18:22