Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a particular reason why Stata under Linux doesn't export .wmf files?

    Fellow Statalisters (especially StataCorp):

    Is there a particular reason why, in Stata under Linux, the graph export command doesn't export Windows Metafiles (.wmf files)? It seems like a puzzling omission, given that there must be many users like me who frequently work under Linux and want to make their graphs available for colleagues who like to work with Microsoft Office (which seems to be popular among my UK primary-care medical colleagues). And, of course, import excel is available in Stata under Linux.

    And yes, I know that Microsoft Office applications are supposed to be able to import scalable vector graphics (.svg) pictures. However, in practice I find that (for whatever strange reason) these applications frequently import .svg graphics to have a few crucial lines missing, which were not missing when I viewed the same pictures earlier in Mozilla Firefox. So, it seems that .wmf files are sometimes necessary if I want to work with Microsoftist colleagues. So, I seem to have to graph save my graphs to Stata .gph files and then convert them to .wmf using Stata under Windows. (Correct me if you know of a better workaround.)

    Best wishes

    Roger

  • #2
    The same is the case with png files, as I found out while exploring the new replication facility, announced by Stata Corp., of Code Ocean (itself a promising alternative to make available dta and do files for replication of case studies etc.). So, possibly platform compatibility has it limitations...
    http://publicationslist.org/eric.melse

    Comment


    • #3
      The output of help graph export tells us that PNG format is available for all versions of Stata except Stata(console), so if used interactively on Linux PNG should be available.

      My guess regarding WMF is that Microsoft supplies libraries for creating WMF files as part of Windows, and Stata for Windows takes advantage of them, but StataCorp would have to roll its own libraries for other platforms, and has chosen instead to devote its efforts to platform-independent standards.

      Microsoft now fully supports SVG import and editing on a broad range of Office applications, so the problems with SVG in Office applications are not "by design". It may be due to problems corrected in newer versions of the Office applications.

      https://support.office.com/en-us/art...AAEAAA=Windows

      It is not clear if the SVG graphics were viewed in Firefox on the same (Windows? macOS?) computer on which Office rendered them incorrectly. That is, if Firefox for Windows renders an SVG correctly but Word on the same system imports it incorrectly, it would seem to lay the problem at Microsoft's doorstep.

      Comment


      • #4
        Thanks to Eric for drawing my attention to Code Ocean. And thanks to William for his thoughts about .wmf (which I think is probably the correct reason) and about .svg.

        I have been viewing my .svg files correctly in Firefox equally under Linux and under Microsoft Windows. The problem starts (for perhaps 1 .svg file in 10) when I try to import my Stata-generated .svg pictures into Microsoft Office documents. And it seems to go away when I convert my .gph files created under Linux to .wmf in Stata under Windows, and import the .wmf files into Microsoft Office. So, as William says, the problem is probably Microsoft Office's fault. Maybe it will be corrected next time I update my Microsoft Office, but my colleagues want to make Microsoft Office documents now, so it looks as if I will have to keep on porting .gph files from Linux to Windows and creating the .wmf files in Stata under Windows.

        Comment


        • #5
          Roger, if Office is not handling the odd SVG file correctly, the open-source image manipulation program, GIMP is cross-platform and handles SVG (and many other graphics formats) just fine. It's quite quick to import an SVG and export to your preferred format (though WMF is not among the supported export types). I'm given to understand that it can also be operated via command line and has a batch mode, though I have not personally tried it.

          Comment


          • #6
            Thanks for Leonardo for the tip about GIMP, which I will check out. As I am not allowed to install software on our Linux server, I would presumably have to install it on my desktop machine. I will find out what it can convert a .svg file to.

            Comment


            • #7
              PS to my previous remarks about Microsoft Office, I have just updated my Microsoft Office. And, it continues to mess up imported .svg pictures (or at least some of them), although these pictures are still visible correctly in Firefox, both under Linux and under Microsoft Windows. So, it seems that Microsoft Office only approves of us importing Microsoft-format pictures. (Fortunately, I can make these in Stata, at least under Windows, from .gph files created under Linux...)

              Comment


              • #8
                You're welcome, Roger. Maybe it will be useful for you.

                Comment

                Working...
                X