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

Resizing and missing parts of vector displays #2

Closed flart closed 6 years ago

flart commented 6 years ago

Hi there,

thank you very much for providing us with this lovely tool. Since there is support for vector displays I like it even more.

Unfortunatelly I've got some trouble with the resizing. After adjusting the VectorX and VectorY options as mentioned in the FAQ the display looks fine when generated the first time. But after each regeneration the size changes slightly.

grafik There was no change made to the parts of the display before the regeneration.

Another problem is that form time to time the display is incomlete. Here is one example:

grafik

But this problem is unreproducible. When I create a new PowerPoint-Presentation and generate a new display with the same latex code, everything is fine...

These are my setting: grafik

I'm working on Windows7(x64) and Office 2013.

I would appreciate any help. Thanks in advance,

Ralf

Jonathan-LeRoux commented 6 years ago

Hi Ralf,

I'm not getting the resizing issue on my end, even with the same setting as yours for VectorX, VectorY, and dpi. Would you mind sending me a .pptx file with an example?

For the incomplete display, I used to get such issues when I was implementing the vector graphics support, but I thought I had fixed it. I'd suggest running in Debug mode, and have a look at the .emf file left in your temp folder. Try inserting it in PowerPoint using IguanaTex's "Insert vector graphics file", both with and without "Convert lines to freeforms" checked: in each case, is it complete? My guess is that the line somewhat gets deleted when I do some clean up. Please send me the .emf file so that I can do some tests.

Vector graphics support is honestly not super robust, and there is often not much I can do: TeX2img does a very good job at converting to EMF, but it's a really difficult task, and there are a few remaining issues; then, the way PowerPoint inserts EMF files can be very unpredictable.

Jonathan

flart commented 6 years ago

Hello Jonathan,

here you are.

When inserting the emf to the original presentation I get the missing lines. When I do insert the same emf to a new presentation, the lines are there. In the case of not checking the “convert lines to freeform”-option the lines are always there.

I will try the resizing issue on another computer, perhaps there is something wrong with my installation.

Thanks for your support,

Ralf

Jonathan-LeRoux commented 6 years ago

I didn't get the attachment. You may want to put it in a .zip file. If at all possible, please send me the presentation where the problem occurs, you can use email (leroux@merl.com) if you don't want to share it here.

Jonathan-LeRoux commented 6 years ago

Thanks for sending in the attachment. Interestingly, the display is not actually incomplete: the lines are there, but they are not filled. So you can click on them and apply a black fill to get them back. Second, I wasn't able to reproduce this on my machine. The lines get converted properly. They do "disappear" sometimes when moving the display around, but that's just a display/resolution issue that goes away if I zoom in. Why they disappear in your case is quite puzzling. I did notice that the two lines that sometimes disappear are listed as "Freihandform" in the selection pane, not "Freeform"; not sure that's relevant. Could you download the .pptm, copy your slide in it, and then run the "convert vector..." code in VBA debug mode? Press ALT+F11 to get to the editor. You can then follow the code and see at which point the lines disappear. My guess is that you should put a breakpoint at Line 284 of LoadVectorGraphicsForm.frm

flart commented 6 years ago

I followed your instructions and tried to debug the case. Unfortunately I can’t reproduce the disappearing of the two lines in the .pptm-Version from your homepage. I noticed that all other parts of the display don’t call the function LineToFreeform. The two disappearing lines are the only ones which call this function. They change their style (thicker line, gray color) in line 421 what is made invisible shortly after that. But the black line remains.

I’ll email you my original presentation since it seems to depend on the slide itself.

Do you have any idea about the resizing-by-regeneration-effect?

Jonathan-LeRoux commented 6 years ago

After debugging using the example provided by Ralf, I found that contrary to what I thought, newly created Freeforms do not always have their Fill set to Visible by default. This should be fixed by adding oSh.Fill.Visible = msoTrue under Line 422 of LoadVectorGraphicsForm.frm and Line 980 of LatexForm.frm. I will add these to the next release.

flart commented 6 years ago

Hello Jonathan,

thanks a lot for your efforts and explanations. I’ll test the next release and give you a feedback.

Would you please also have a look at the resizing problem?

It happens in Line 793 and 794 of LatexForm.frm https://github.com/Jonathan-LeRoux/IguanaTex/blob/master/LatexForm.frm#L793. The regenerated display is given a new size which doesn't match the old one.

Unfortunately, I can't figure out which of the different scaling factors applied during the regeneration process is the cause of this behaviour.

Thanks in advance,

Ralf

Jonathan-LeRoux commented 6 years ago

Unfortunately, I'm not able to reproduce the resizing issue, even within the slide you sent me. The Line you point to simply applies scaling factors that are computed earlier (around lines 500-530). In your case (EMF display regenerated as EMF display), the core should be at lines 518-525.

I do get a lot of strange running time errors when generating a display for the first time in that slide, but after that things seem to get better. I have honestly no idea what is going on, I think this is a bug in PowerPoint.

Jonathan-LeRoux commented 6 years ago

Closing this issue, please reopen if needed.