Have you tried using squiggle to export a series of frames? I found squiggle a pain to get your line just where I wanted it to be to properly set up a series of frames. However, once you have that, you can use imagemagick - apparently my favorite answer this week ;-) to transform it however you like.
Assuming each you save the frames off as frame01.svg, frame02.svg, etc. Then this:
convert -delay 5 -loop 0 frame??.svg animated.gif
will make a single animate gif from your frames that loops forever, 5 ms between frames.
convert will convert svg to , but imagemagick doesn't process the animateTransform tag, so any output is static.
Update:
I found squiggle so painful to work with (at least trying to stop the animation at just the right spot to grab an image, I was embarrassed to have even suggested it!
Here's a bash script using imagemagick to convert your svg into an animated gif:
Before running this script I split your example svg into 2 parts:
bg.svg contains the elipse and the 'pit' element and
hand.svg contains just the 'sec' element
`#!/bin/bash`
rm *.png
rm anim.gif
convert bg.svg -crop 200x200+0+0 +repage bg.png
convert hand.svg -crop 200x200+0+0 +repage -transparent white hand.png
for ((i=1; i<=359; i=i+3))
do
convert hand.png -gravity center -rotate $i tmp.png
n=`printf "%03d" $i`
composite -gravity center tmp.png bg.png hand${n}.png
rm tmp.png
done
convert -delay 1 -loop 0 hand*.png anim.gif
~
I'm sure someone more clever than me could figure out how to merge the convert and combine all in one step without also rotating the bg.png, but this is what you get for free ;-)
Also, wanted to keep this simple, just in case it needs to be reimplemented as a windows bat file.
The i=i+5 is a trade-off between how smooth the animation looks vs. file size.
Note:
Even with -delay 1 (1 ms between frames), firefox would not move the hand in a complete circle in 5 seconds. It was closer to 10 secs.
And here's what the script produced
The simplest way to do so would be to first generate a PDF or DVI with just the said diagram/equation and then convert it to a vector format.
If small page-size PDFs work fine for you, then you can use
* Use ghostscript:
gswin32c.exe -sDEVICE=pdfwrite -dMaxSubsetPct=100 -dPDFSETTINGS=/ebook -sOutputFile="outfile.pdf" -dNOPAUSE -dBATCH "infile.pdf"
where -dPDFSETTINGS is used to define how images are resampled. Using -dPDFSETTINGS=/screen will yield dpi=72. I just tried this with a sample pdf and it seems to work fine.
Otherwise, use any of the methods described at:
https://stackoverflow.com/questions/10288065/convert-pdf-to-clean-svg
Also, this answer for multiple pages:
https://stackoverflow.com/a/4502030
This resource is useful as well:
svgkit.sourceforge.net/SVGLaTeX.html
Of course, some of the mentioned commands would work fine with using MinGW implementations or will have native Windows implementations, which you'll have to download. And of course, then add the executable file's directory to the PATH variable environment (available in the advanced settings in the computer properties).
For inkscape, see this link: http://kaioa.com/node/42#inkcl_bat_usage
Here,you just place a batch file (InkCL.bat)in the inkscape directory. and use it instead of typing inkscape in the command-line.
inkcl
To sum it up, it is generally requires just 3 commands
Create a TeX file with an empty page style
Say, input.tex:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\thispagestyle{empty}
\begin{document}
\[
2 \pi f t
\]
\end{document}
Now, Use any of the following methods:
After Creating PDF:
pdflatex input.tex
This creates the file input.pdf
Now, Use any of the following methods:
from Inkscape:
inkscape -l output.svg input.pdf
(Same as above):
inkscape \
--without-gui \
--file=input.pdf \
--export-plain-svg=output.svg
For multiple pages (and single as well), use pdf2svg[cityinthesky.co.uk/opensource/pdf2svg/]. It uses poppler and Cairo to convert a pdf into SVG. This is particularly useful for bulk conversion:
pdf2svg <input.pdf> <output.svg> [<pdf page no. or "all" >]
Note: if you specify all the pages you must give a filename with %d in it (which will automatically be replaced by the appropriate page number). E.g.
pdf2svg input.pdf output_page%d.svg all
Fom DVI,
latex input.tex
This creates the file output.dvi
Then,
dvisvgm --no-fonts input.dvi output.svg
This works perfectly for instances with LaTeX formulas (with option --no-fonts)
Also soandos' answer (Including for comprehensiveness):
dvips -q -f -e 0 -E -D 10000 -x 10000 -o eqn.ps eqn.dvi
From the dvips man page (ma.utexas.edu/cgi-bin/man-cgi?dvips%201):
- [-q] Run in quiet mode.
- [-f] (filter) Read the .dvi file from standard input and write the PostScript to standard output.
- [-D] sets the resolution between 10 and 10000 (also affects positioning of letters)
- [-E] makes dvips attempt to generate an EPSF file with a tight bounding box.
- [-e num] Each character is placed at most this many pixels from its `true' resolution-independent position
- [-R] Run in secure mode.
- [-x] num Set the magnification ratio to num/1000 no matter what the dvi file says (between 10 and 100000)
- [-y] num Set the magnification ratio to num/1000 times the magnification specified in the .dvi file (between 10 and 100000)
- [-o] specifies the output file as eqn.ps
Then,
pstoedit -f plot-svg -dt -ssp eqn.ps eqn.svg
This creates the file eqn.svg
- [-f] specifies the format as plot-svg (direct svg does not work)
- [-dt] Draw text - Text is drawn as polygons.
- [-adt] Automatic Draw text - This option turns on the -dt option selectively for fonts that seem to be no normal text fonts, e.g. Symbol.
- [-ssp] simulate sub path for backends don't support PostScript pathes containing sub pathes, i.e. pathes with intermediate movetos.
- [-usebbfrominput] If specified, pstoedit uses the BoundingBox as is (hopefully) found in the input file instead of one that is calculated by its own. (Doesn't seem to make a difference for plot-svg)
- [ -noclip ] don't use clipping (relevant only if backend supports clipping at all)
In order to get good quality text to polygon conversion, we had to run dvips with a high magnification, so one will have to scale down the resulting SVG.
Best Answer
I suggest you use Inkscape to open the SVG file and print it from there. It has far better options on printing than Chrome does for SVG.
Shift + Ctrl + D will get you document options: