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
851 stars 59 forks source link

How to add additional search paths to `IguanaTex`? #55

Closed mihaiconstantin closed 6 months ago

mihaiconstantin commented 10 months ago

I am trying to use IguanaTex in conjunction with minted that requires pygmentize.

Suppose I have the following path.tex document:

\documentclass{article}

\pagestyle{empty}

\begin{document}

\catcode`:=\active
\def:{\par}

\parindent0pt\tt

\input|"echo $PATH"

\bigskip

Is there pygmentize?

\input|"which pygmentize"

\end{document}

Running this document from my editor (i.e., or the terminal as pdftex --shell-escape path.tex) produces:

terminal

However, running the same code from within IguanaTex yields:

IguanaTex

My question for you is two-fold:

  1. I would like to be able to add /opt/homebrew/bin or /usr/local/bin to the paths IguanaTex can see, but I cannot see a way to do this via the Main Settings tab. Is there currently a way to achieve this?

  2. Is there a way I can instruct IguanaTex on what flags to use? For example, can I use the --shell-escape flag?

P.S. Thanks a lot for this amazing piece of software!

mihaiconstantin commented 10 months ago

My current workaround is to create a symbolic link to pygmentize in the /Library/TeX/texbin folder as follows:

ln -s /opt/homebrew/bin/pygmentize pygmentize

Then, running the path.tex in IguanaTex produces:

IguanaTex

The code is now properly formatted through minted. However, I think it could still be handy to have an option to allow IguanaTex to see non-standard user-specified paths.

Jonathan-LeRoux commented 10 months ago

Thanks for reporting this and for finding a workaround.

To answer question 2 first, --shell-escape is already used in the LaTeX calls.

I don't know why @tsung-ju coded it this way, maybe to circumvent the Mac sandbox, but there is a path export in ShellWait.bas that is currently set to be the same path as that of the LaTeX executables. One solution would be to offer in the Main Settings yet another path that could be included in there as well. Do you think that would be enough? One way to check this would be for you to edit the .pptx to hard-code the path to pygmentize and see if that works.

Jonathan-LeRoux commented 6 months ago

I've added the possibility to specify additional paths in the Main Settings on Mac. They're added to the PATH export when executing any command. Multiple paths can be specify by separating with ":". If I add /opt/homebrew/bin as additional path, then I get the correct behavior you describe, while it doesn't work if I don't add it. Please give it a shot: IguanaTex_v1_61_beta4.zip

mihaiconstantin commented 6 months ago

Thanks for making this change @Jonathan-LeRoux! Can you please include the .ppam in the archive so I can try it out on my Mac?

Jonathan-LeRoux commented 6 months ago

Sure, here it is: IguanaTex_v1_61_beta4_ppam.zip Note that you can easily get the .ppam from the .pptm by using "export" (on Mac, "save as" on Windows) and choose .ppam as the file format.

mihaiconstantin commented 6 months ago

It seems to work well—no need for creating symbolic links to external tools anymore! Thank you for adding this option.

image

Note that you can easily get the .ppam from the .pptm by using "export" (on Mac, "save as" on Windows) and choose .ppam as the file format.

Ah, I wasn't aware of this... useful to know!

Jonathan-LeRoux commented 6 months ago

Thanks for confirming! I'll close this issue when I make an official release in the next few days. In the meantime, if you see any bug, please let me know.

Jonathan-LeRoux commented 6 months ago

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