Empty svg files

I am using engine=tikz to produce a figure, which works fine for PDF.

However, If I want dev=svg, something goes wrong; the .svg file is basically just a skeleton. The .dvi file seems to be ok. I get the following message (on MacOS 10.15):

processing of PostScript specials is disabled (Ghostscript not found)
pre-processing DVI file (format version 2)
processing page 1
WARNING: 209 PostScript specials ignored. The resulting SVG might look wrong.
page is empty
graphic size: 0pt x 0pt (0mm x 0mm)
output written to path/to/myimage.svg

Same result with dev=svglite.

Do I need to install ghostscript? Any help appreciated!

EDIT:

This FAQ says that the above message is likely indicative of using Ghostscript version>=9.56.0 together with dvisvgm version<2.13.4, but I have:

$ gs --version
9.55.0

$ dvisvgm --version
2.13.3

We need a FAQ: How to do a minimal reproducible example ( reprex ) for beginners

A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need.

Thank you.

I just compiled the document on my Ubuntu 22.04 machine, and there the svg works just fine.

So, I am not sure how to make a reproducible example in this case, since it seems to be an issue with my MacOS environment.

If it works on Ubuntu I'd just flag the thread as solved as it is more or less.
https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-Statehttps://forum.posit.co/t/faq-how-do-i-mark-a-solution/5633

If it looks like an idiosyncratic MAc environment it is probably not worth pursuing at the moment.

Glad to hear of a solution, especially as I use Ubuntu 22.04 :slight_smile:

Well, I would not really call "use a different computer" a solution :slightly_smiling_face:
Still hoping to fix it on my mac.

1 Like

A problem on a particular type of machine, when that machine is supported (a Mac) is still a problem. I use a Mac. If you have an example you can share, I'll try it on my Mac, and see if it is indeed a general problem on Mac's or if it's something related to just your machine. That will go a long way to helping figure it out either way.

2 Likes

Thank you, what would be a good way of sharing it?
Simply pasting the contents of the .Rmd in a post here?

That's one way. Or Pastebin.com and link to it here.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.