diff --git a/gifs/latex_basic.gif b/gifs/latex_basic.gif index 9be0927..f261606 100644 Binary files a/gifs/latex_basic.gif and b/gifs/latex_basic.gif differ diff --git a/src/Reanimate/Examples.hs b/src/Reanimate/Examples.hs index fc58fbf..729c39f 100644 --- a/src/Reanimate/Examples.hs +++ b/src/Reanimate/Examples.hs @@ -329,9 +329,15 @@ frequencies = proc () -> do latex_basic :: Ani () latex_basic = proc () -> do - duration 1 -< () + duration 2 -< () + s <- signalOscillate 0 1 -< () emit -< do rect_ [width_ "100%", height_ "100%", fill_ "black"] - g_ [transform_ $ translate 20 20] $ - g_ [transform_ $ scale 4 4, fill_ "white"] $ - latex "\\sum_{k=1}^\\infty {1 \\over k^2} = {\\pi^2 \\over 6}" + g_ [transform_ $ translate 20 15] $ + g_ [transform_ $ scale 4 4, stroke_ "white", fill_opacity_ "0", stroke_width_ "0.1"] $ + text + g_ [transform_ $ translate 20 15] $ + g_ [transform_ $ scale 4 4, fill_ "white", num_ fill_opacity_ s] $ + text + where + text = latex "\\sum_{k=1}^\\infty {1 \\over k^2} = {\\pi^2 \\over 6}" diff --git a/src/Reanimate/LaTeX.hs b/src/Reanimate/LaTeX.hs index 4b0d07a..6e95cc7 100644 --- a/src/Reanimate/LaTeX.hs +++ b/src/Reanimate/LaTeX.hs @@ -28,7 +28,11 @@ latexToSVG tex = handle (\(e::SomeException) -> return (failedSvg tex)) $ do appendFile tex_file tex appendFile tex_file tex_epilogue runCmd latex ["-interaction=batchmode", "-halt-on-error", "-output-directory="++tmp_dir, tex_file] - runCmd dvisvgm [dvi_file, "-n","-v", "0", "-o",svg_file] + runCmd dvisvgm [ dvi_file + , "--exact" -- better bboxes. + , "--bbox=1,1" -- increase bbox size. + , "--no-fonts" -- use glyphs instead of fonts. + ,"--verbosity=0", "-o",svg_file] svg_data <- readFile svg_file evaluate (length svg_data) return $ toHtmlRaw $ unlines $ drop 1 $ lines svg_data