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
902 stars 62 forks source link

Workflow suggestion: edit LaTeX file somewhere else (Load file) #67

Open Splines opened 4 months ago

Splines commented 4 months ago

I am aware that there is the Open in external editor command. However, consider the following workflow I'd like to use:

\documentclass{article}
\input{preamble}
\input{defs}
\input{prettify-math}
\pagestyle{empty}
\begin{document}

Let $\epsilon > 0$.

\end{document}

Challenges/Wishes

Jonathan-LeRoux commented 4 months ago

It seems to me that setting the default Temp folder and load file path (as in #66) effectively implement this, apart from two differences: 1) the default Temp folder and file path are the same for all PowerPoint presentations, instead of depending on the presentation 2) one needs to click on New LaTeX Display then "Load File & Generate" (2 clicks) instead of having a dedicated button

Arguably, one typically works on a single presentation for a while, so it's not so bad to change the defaults once, and I'm thus not inclined to fix 1). It's also not clear how to save this setting "per .pptx" (or it would have to be a default inferred from the .pptx name). Re: 2), I'm also not sure it's a mainstream enough feature to expose a button to all users. I guess I could make it into a Macro without a button, which could be added to the Quick Access Toolbar (on Windows only for now, unfortunately).

Splines commented 4 months ago

1) Yeah, that's not so important to me either. As you said: typically, one "works on a single presentation for a while". Just being able to set a global default path is great.

2) That macro on Windows would be much appreciated ;) Then my workflow would literally be: change something in your favorite LaTeX editor and use one single shortcut to insert it in PowerPoint, that'd be blazing fast.

Jonathan-LeRoux commented 4 months ago

Please try this version: IguanaTex_v1_61_1_20240731.zip The macro is called "LoadDefaultFileAndGenerate".

Jonathan-LeRoux commented 4 months ago

Hmm, I realize this isn't going to work because the macros only show up when the .pptm is open🤦‍♂️ So there has to be a button in the ribbon if we want this to be feasible...

Jonathan-LeRoux commented 4 months ago

Alright, here is a version with a dedicated button: IguanaTex_v1_62.zip Please let me know how it works.

Splines commented 4 months ago

Thank you, works great and exactly what I needed!

The error when an invalid file path is set and you click on Generate from default .tex file is currently:

You need to set an existing LaTeX file as Default file path using "Make Default" in the Editor Window's "Read from file" pane.

Suggestions:

Splines commented 4 months ago

It seems to me that setting the default Temp folder and load file path (as in https://github.com/Jonathan-LeRoux/IguanaTex/issues/66) effectively implement this, apart from two differences: [...]

I think a third difference is that relative imports in the default file are not correctly resolved, e.g. \input{preamble} (where preamble.tex is sitting right next to the default file) will lead to the LaTeX error "File not found".


By the way: I see the "Error in LaTeX Code" popup and once I close it, I get the following error by Microsoft Visual Basic in PowerPoint:

Run-time error '2110':

Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.

This only happens with the new Load File & Generate button, not with the Load File button.

Jonathan-LeRoux commented 4 months ago

Thanks for these comments, they should be addressed in this version: IguanaTex_v1_62_20240801.zip Regarding the preamble, the Temp folder would have to be the folder where the default file is. I'll have to explain that somewhere.