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

feature request: how to make open external editor as the default behavior when double click the equation? #7

Closed archerc closed 5 years ago

archerc commented 5 years ago

IguanaTeX is so good a tool that I love it. However, I found the workflow could be improved to be more convenient.

As in the current version, when I edit the equation, it pops a dialog box to allow me edit the source and provide me with some buttons such as recompile. Of course, the editing capability is not so good, so I have the choice to open the temp file in external editor, and the editing dialog box provide a handy button to let me do that. After I modified the file in the opened external editor and switch back to PowerPoint, it ask me if want to reload the modified source and recompile. I will choose yes to complete the modification.

The above workflow works well. But when it happens repeatedly, it was a little annoying that I must click twice with mouse, once for opening external editor, the other for confirm reload and recompile. I want to avoid the two clicks, let it do the same thing automatically every time I edit the equation. Or at least, add an option to allow me set it as the default behavior.

I tried to modify the source code to do that on my own, but I have no experience in Visual Basic. I was confused on how the source code is compiled.

Jonathan-LeRoux commented 5 years ago

Thanks for the idea! I honestly almost never use the external editor, so this hadn't occurred to me as something potentially important.

I think we can indeed reduce the number of clicks, but probably not get rid of all of them.

Here is the updated version: IguanaTex_v1_57.zip

Please try it out and tell me what you think. If it's good and there are no new bugs, I'll release it on the website.

As a side note regarding compilation, it happens when you save the .pptm file as a .ppam (using "save as" in PowerPoint and selecting the .ppam file type in the file type drop down menu).

Thanks, Jonathan

Jonathan-LeRoux commented 5 years ago

Any thoughts?

archerc commented 5 years ago

Thank you for your reply! I am really happy and grateful for your rapid response. I apologize that I did not see the message and reply in time.

I tried your new version but did not found too much difference. Think about the problem, I believe that for this feature, both the external editor and the PowerPoint need to do the following things:

  1. Open the temporary file but do not lock it.
  2. Monitor if the file has been changed. If it is changed, it must be reload and/or do something more.

For the external editor, it is easy to get it reload the file when changed. Many editors can achieve that, I thinks. But some editor on some platform may lock the file. It's the user's duty to choose an appropriate editor if he wants to use external editor. We can assume the chosen external editor satisfy the above two requirements.

For the PowerPoint, it seems that you do not worry about the 1st requirement, but have no idea about how to achieve the 2nd requirement?
I don't know either. But if it can be implemented, we can avoid the "need some way to tell the add-in that we're done editing" problem.

The number of clicks we need to open the temporary file is not a problem. Because when it has been open, we can kept the editor running and switch between the editor and PowerPoint back and forth with out clicking again and again if the above two requirements were done.

I do not understand why we need a different temporary file path as before.

Jonathan-LeRoux commented 5 years ago

The need for a different temporary file is to avoid having conflicts between PPT and the external editor when dealing with the main temporary file.

I'm not sure I see why one would want to have both the external editor and the IguanaTeX edit window keep in sync continuously. The user should pick one way to edit the file, either the external editor or the IguanaTeX edit window, and when the user is done editing, she/he basically wants to compile the code to generate a display. The solution I provide achieves this:

It should be okay to leave the external editor open, and the file will get updated each time a new display is selected. Once the file has been modified and saved, the display can be generated in one click.

Were you envisioning a solution where the display would keep re-compiling as edits are made and saved in the external editor, without any IguanaTeX Edit window being open? That would be definitely beyond the scope of IguanaTeX as it is currently implemented.

archerc commented 5 years ago

No, I am not suggest keep re-compiling as edits are made, that would be too unnecessarily time-consuming. Instead, I expect the IguanaTeX or PowerPoint start to reload and compile automatically without any user click when it get focus, without any Edit window being open.

The working flow is just like using two editors say A and B to edit one single file. When you open the file with both editors, and change the file in one editor A, and then switch to the other editor B, you can get the file reloaded automatically without any click. Many editors support the behavior as B.

Jonathan-LeRoux commented 5 years ago

I see, thanks for the explanation. To be honest, this sounds both quite difficult to implement in a robust way, and not a major workflow improvement over the current state. What you are requesting is for compilation to occur when you get back to PowerPoint. To get back to PowerPoint, most often you will click somewhere on that window. Clicking on the currently provided compile button is not really much more work than clicking back somewhere inside the PowerPoint window. Furthermore, having the edit window open until compilation is finished clearly shows the user what's going on, which I think is important (because things sometimes crash, don't compile, hang, etc). I guess we could have an "ongoing compilation" window appear, but then there would be even less difference with the current status. I'm thus inclined to close this request. The proposed fix in version 1.47 is satisfactory in my opinion.