Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svg definitions not included in each page when exporting multipage #110

Closed
hchauvet opened this issue Jul 6, 2019 · 5 comments

Comments

@hchauvet
Copy link

commented Jul 6, 2019

Hi,
When I tried to output multiple pages from a dvi as one svg per page, dvisvgm does not always includes the definition of used parts in the svg ("xlink:href" point to a missing id in the file) when I force font to be written as path using the --no-fonts option. The missing svg element is written in an other file (for an other page of the dvi) where it is also used.

I use a .tex file which looks like that:

\documentclass[crop=true, multi=varwidth]{standalone}
\begin{document}

\begin{varwidth}{500pt}
$\bullet$ the first page stuff
\end{varwidth}

\newpage 
\begin{varwidth}{50pt}
 $\bullet$ the second page stuff
\end{varwidth}
[...]
\end{document}

And convert the dvi using

dvisvgm -n -p1- my_dvifile.dvi 

I have tried with v2.5 (which comes with debian 10) and the last version v2.7.2 of dvisvgm, and the results are the same.

Is there a way to force all definitions to be written at the beginning of each svg ? So that when exporting only a given page of the document all the svg definitions that is used in this page are written inside the .

For the moment I extract each page of the dvi using dviselect command and each dvi is then correctly rendered as svg but this adds a lots of files and largely slow down the conversion from latex to svg.

@mgieseki

This comment has been minimized.

Copy link
Owner

commented Jul 6, 2019

That sounds strange. Actually, dvisvgm is supposed to add all referenced glyphs to the corresponding SVG files. And it indeed does it for all the files I tested so far. So unfortunately, I can't reproduce your issue at the moment. Both SVG files created from your example contain all referenced paths.

Do you get any warning messages when running dvisvgm?

@mgieseki mgieseki self-assigned this Jul 6, 2019

@hchauvet

This comment has been minimized.

Copy link
Author

commented Jul 6, 2019

It does not bug for each multi page file, only some documents produce that. I add one file (it's .tex but I change the extension for the upload to github) where for the page 2 their is a missing definition to a green bullet on my computer.

test_tex_dvisvgm_bug.txt

I didn't get any warning from dvisvgm.

@mgieseki

This comment has been minimized.

Copy link
Owner

commented Jul 6, 2019

Thanks for providing the additional file. I was able to reproduce the issue and found the cause. I'll fix it with the next release.

@mgieseki mgieseki added bug and removed works for me labels Jul 6, 2019

@mgieseki mgieseki closed this in 85be48d Jul 6, 2019

@hchauvet

This comment has been minimized.

Copy link
Author

commented Jul 7, 2019

Thanks for your quick reply and for the bug fix. Dvisvgm is really a usefull tools !

@mgieseki

This comment has been minimized.

Copy link
Owner

commented Jul 7, 2019

Thanks, I'm glad you like dvisvgm. Let me know if you find any further issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.