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
790 stars 57 forks source link

Bitmap is not bitmap (on Mac) #41

Closed Atcold closed 3 months ago

Atcold commented 1 year ago

Opening this issue following the discussion on #39 about the "bitmap" option generating "vectorial" graphics on Mac.

Suggested fix: let the user choose between SVG, PDF, and PNG. If PDF is not available (on Windows), then disable it in the menu.

Jonathan-LeRoux commented 7 months ago

Sorry for letting this open so long.

I think the real difference between all these formats is how PowerPoint handles the objects, and that's basically either as "Picture" or as "Shape". This changes how the user can interact with them, so I think it's still important to keep them separate. Plus, having PDF under "Picture" and SVG under "Shape" allows the user to use the trick you mentioned to obtain a good aspect ratio in SVG, i.e., first generate as PDF, then convert to SVG.

I'm thus thinking of implementing this as follows:

Does that sound reasonable?

Atcold commented 7 months ago

Yup, it does. Also, if there is space, you could have "convert selection to picture" and "convert selection to shape". Btw, I've been flexing your plug-in with countless colleagues at multiple institutions. I think I owe you a YouTube video tutorial. Let me know if you have a list of features you'd like me to showcase.

Jonathan-LeRoux commented 7 months ago

I tried both with and without "selection" and the version with it doesn't look as clean: convert_to_menu convert_selection_to_menu

Thanks a lot for popularizing IguanaTex! I admit that a YouTube video tutorial is something I should have done a long time ago, but never got to do (and probably don't have the necessary talent for...). So if you could do one, that would be fantastic! Apart from the obvious ones, some of the probably lesser known/used features are the batch edit under "Regenerate selection", the templates in the edit window, and the keyboard shortcuts ("accelerators"). There's also the fact that one can add some of the macros to the Quick Access Toolbar, but unfortunately that only works on Windows due to a Microsoft bug (I haven't checked recently but they hadn't fixed it a couple months ago).

Atcold commented 7 months ago

Maybe, let's create a draft over the Christmas break? How shall we coordinate?

Jonathan-LeRoux commented 7 months ago

Re: the video Let's maybe work on a script either in a Google Docs or Spreadsheet? I don't have much experience writing video scripts but we can at least come up with a list of points to hit (how to install on Mac/Win, basics, fancier things like psfrags, external editor, latexmk, templates, keyboard shortcuts...), and then start fleshing them out.

Re: Picture/Shape and PNG/PDF support on Mac I'm pretty much done implementing the PNG support on Mac. Doing this made me realize that ImageMagick was not always necessary, even on Windows, because most engines can be switched to output a DVI which can then be converted to PNG via dvipng. So I took the occasion to allow users on both Win/Mac not to specify a path to ImageMagick, in which case I just force DVI output. The only "major" case where PDF is absolutely needed is with platex (Japanese LaTeX), and of course if any package requiring PDF is used. I'll have to explain that clearly in the README.

I still need to do more tests, but it looks like the cropped PDF that is the default on Mac looks slightly different from the output of dvipng, with a different aspect ratio. I'll compare with LaTeXiT as well.

Jonathan-LeRoux commented 7 months ago

I spoke too fast. dvipng can't process the XDV files that xelatex outputs and chokes on fonts in the DVI files that lualatex outputs. This only leaves pdflatex for which we could force DVI output, but that is literally what "latex (DVI)" is. To avoid confusion, I'll just raise an error saying "ImageMagick is required with all engines except latex (DVI) for PNG output". At least the code won't break anymore if no ImageMagick path is specified.

Jonathan-LeRoux commented 7 months ago

Here is a beta version of v1.61, which includes the following changes:

Jonathan-LeRoux commented 3 months ago

Closing this issue as it is now fixed in Release v1.61.