Jonathan-LeRoux / IguanaTex

A PowerPoint add-in allowing you to insert LaTeX equations into PowerPoint presentations on Windows and Mac
http://www.jonathanleroux.org/software/iguanatex/
Other
851 stars 59 forks source link

Bitmap displays inserted on Mac appear cropped (in versions < v1.60) or resized (v1.60) when viewed on Windows #32

Open Jonathan-LeRoux opened 2 years ago

Jonathan-LeRoux commented 2 years ago

Bitmap displays on Mac are actually PDFs, not PNGs as in Windows. I have been doing this because Office on Mac supports inserting PDFs, and PDFs don't suffer from resolution issues.

Under the hood, Office actually stores them as EMF files (despite not supporting insertion of EMF!!) which you can see by unzipping the .pptm file, but there seems to be a bug with this conversion. We noticed that such displays appeared cropped when viewed on Windows in versions of IguanaTex prior to v1.60. Interestingly, PDFs generated with LaTeXiT do not suffer from this issue: image

In IguanaTex v1.60, as a temporary workaround, I am adding a bigger margin around the content when cropping the PDF. The downside of that is that the size of the display does not exactly match the size of the visible content, and also that there is still a discrepancy between the size of the display as viewed on Mac vs Windows.

I have tried various options when cropping with Ghostscript, to no avail so far. I have reached out to LaTeXiT's author to ask for advice, as he's clearly doing something better than Ghostscript. I will use this issue to keep everyone updated on my progress. Please feel free to chime in if you have suggestions.

Jonathan-LeRoux commented 2 years ago

I just realized there was an even worse consequence, which is that the extra margin added in (PDF) "Bitmap" displays messes up the scaling when using the "vectorize" function, which fixes the size of the Vector display to that of the Bitmap display from which it was converted... So it's better to just "edit" and switch to "Vector" without checking the "fix size" box (which "vectorize" does under the hood), at least the aspect ratio won't be messed up.

Jonathan-LeRoux commented 2 years ago

In the new v.1.60.1 release, I have reverted to using a tight cropping box. I will keep working on fixing this issue. One option would be to use PNG instead of PDF for Mac as well. It is of course a bit of a shame to move to a non-vector format, but at least that would be consistent with Windows.

Atcold commented 1 year ago

One option would be to use PNG instead of PDF for Mac as well.

Please, don't.