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

Wrong output size when generating a SVG (on Mac) #39

Open
Atcold opened this issue Oct 13, 2022 · 8 comments
Open

Wrong output size when generating a SVG (on Mac) #39

Atcold opened this issue Oct 13, 2022 · 8 comments

Comments

@Atcold
Copy link

Atcold commented Oct 13, 2022

IguanaTeX output (top) is 87% × 97% while LaTeXiT's (bottom) is 100% × 100%.

Screenshot 2022-10-13 at 15 36 53

@Atcold
Copy link
Author

Atcold commented Oct 13, 2022

I scaled it up to 100% × 100% manually.
The two outputs are now identical if not for the extended bounding box for IguanaTeX (perhaps that's what causes the wrong output size).

image

@Atcold
Copy link
Author

Atcold commented Oct 13, 2022

Something's really wrong…

image

@Atcold
Copy link
Author

Atcold commented Oct 13, 2022

I think this is due to the fact that the equation is converted to SVG.
Is there a way to leave it in PDF instead? This is what LaTeXiT does.

@Jonathan-LeRoux
Copy link
Owner

Hi! Are you using version 1.60.1 or newer? There should no longer be a big margin around the equation when generating a "Bitmap" (which on Mac is actually a PDF...).
This unfortunately results in the equation appearing cropped on Windows machines (bounding box stays the same but the content inside expands; most likely a PPT bug), but I haven't found a fix yet, short of moving to PNGs for Mac as well. Windows users can always regenerate the display as a PNG, it will get back to the same appearance as on Mac.

For you last example with colors, was that a "vector graphics" display? Those are indeed SVGs. The scale does look very strange...
The "Bitmap" displays are PDFs, although under the hood PPT is storing them as EMFs (even on Mac!). IguanaTex shouldn't be converting them to SVG.

@Atcold
Copy link
Author

Atcold commented Oct 13, 2022

Aaaaaaah!
PDF is not bitmap! LOL. 😅

Everything's perfect now.
I'd heartwarmingly suggest changing the word "Bitmap" to "PDF".

@Jonathan-LeRoux
Copy link
Owner

I agree, "Bitmap" is not a good term, it is used because that's what it is under Windows (PNG). The PDF ("Bitmap") displays on Mac also cannot have their paths edited or individual components tweaked independently, as the "Vector" displays can, so they are closer to the PNGs on Windows in that regard.

I'll have to think about how to handle this.
Easiest in terms of implementation would be to find a term that describes both PNG and PDF cases, but I can't see one.
Another option would be to adapt the terminology on Windows vs Mac, but I don't know if the ribbon text can be made adaptive on Mac vs Windows, as it is handled outside of VBA in an XML file; that may require having two separate versions of the add-in.
Yet another option would be to implement PNG on Mac for "Bitmap" displays, and provide PDF as a "Vector" option, with the caveat that it has the crispness of vector graphics format but cannot be edited.

@Atcold Atcold closed this as completed Oct 14, 2022
@Atcold
Copy link
Author

Atcold commented Oct 14, 2022

Vector graphics are digital art that is rendered by a computer using a mathematical formula. Raster images are made up of tiny pixels, making them resolution dependent and best used for creating photos.

See reference.

Vector graphics does not have anything to do with editability.

I'd suggest having the user choosing between "SVG", "PDF", and "PNG".

A PDF is a container. It can contain both a raster and / or a vector image.
PowerPoint cannot edit PDFs. This does not mean PDFs are not editable in their individual components.
Inkscape, Adobe Illustrator, and Adobe Acrobat have no issues with editing PDF paths.

@Atcold Atcold changed the title Wrong output size (on Mac) Wrong output size when generating a SVG (on Mac) Oct 17, 2022
@Atcold Atcold reopened this Oct 17, 2022
@Atcold
Copy link
Author

Atcold commented Oct 17, 2022

Reopening this because the bug persists, although it no longer affects me (as in I'm perfectly fine with generating PDFs instead of SVGs).
Let me know if I can help debug this.

So, the reported size is most of the time 100% × 100%.
If you click and unclick several times, you finally get the real wrong aspect ratio.

A workaround is generating a PDF first and then converting it to SVG (although it says sometimes it's 112% × 100%).

Screenshot 2022-10-17 at 12 51 28
Screenshot 2022-10-17 at 12 51 44
Screenshot 2022-10-17 at 12 51 06

About the version, I'm not sure. I don't see it written anywhere.
I've just installed everything via brew.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants