latex-math runs wrong on my mac. I set the path to klatexformula correctly, but it still doesn't work.
@r00tr4v3n, @Aganel hello, latex-math runs wrong on my mac. I set the path to klatexformula correctly, but it still doesn't work. I debugged myself and found that the command generated by the script bash -c "kalatexformula" -f xxx; I can generate the file when I run it in the terminal, but the script runs correctly and does not generate the corresponding image file.
Originally posted by @jwli6 in https://github.com/qownnotes/scripts/issues/154#issuecomment-1153428986
Maybe something with #2299?
Where is #2299? Can you give me a link? Thanks!
Ah, sorry. I fixed the link.
Thank u very much! I have checked it, and found that execute open /bin/bash --args -c xxx on the terminal, where bash cannot receive arguments, but only open -a /bin/bash --args -c xxx can work. In addition, the --args parameter of command open in macOS12.3.1 has not changed. So how to make script.startDetachedProcess execute with open -a?
So the image generation works with different parameters? You could make a pull request to differentiate arguments between operating systems or just modify it in your script folder for a quick fix.
So how to make script.startDetachedProcess execute with open -a
I don't think there currently still is a real solution for https://github.com/pbek/QOwnNotes/issues/2299.
You could make a pull request to differentiate arguments between operating systems or just modify it in your script folder for a quick fix.
Yes, I downloaded the script file and added the log to debug locally.
So the image generation works with different parameters?
No, I replaced the print log with log(`exec:${exec} param:${param}`), then its output is exec:zsh param:-c,'"/Applications/klatexformula.app/Contents/MacOS/klatexformula" -f "#RRGGBB" -b "-" --base64arg --preamble="XHVzZXBhY2thZ2V7YW1zbWF0aH1cdXNlcGFja2FnZXthbXNzeW1ifVx1c2VwYWNrYWdle2Ftc2ZvbnRzfQ==" --base64arg --latexinput="XGJmICB4X2kgPSBcZnJhY3sxfXsyfQ==" --dpi 400 --quiet 1 --output /Users/UserMe/Library/Caches/PBE/QOwnNotes/scripts/latex-math/34a904272f48aae2fa7b8ce61c157228.png'.
The whole process did not report any errors, but the latex image could not be displayed, and no image files were seen in the corresponding path/to/scripts/latex-math. I tried to enter the command zsh -c '"/Applications/klatexformula.app/Contents/MacOS/klatexformula" -f "#RRGGBB" -b "-" --base64arg --preamble="XHVzZXBhY2thZ2V7YW1zbWF0aH1cdXNlcGFja2FnZXthbXNzeW1ifVx1c2VwYWNrYWdle2Ftc2ZvbnRzfQ==" --base64arg --latexinput="XGJmICB4X2kgPSBcZnJhY3sxfXsyfQ==" --dpi 400 --quiet 1 --output /Users/UserMe/Library/Caches/PBE/QOwnNotes/scripts/latex-math/34a904272f48aae2fa7b8ce61c157228.png' in the terminal, and then check that there are corresponding image files in the path/to/scripts/latex-math folder, and the latex images are also displayed normally.
Why use zsh instead of bash, because I found that the above command on the command line will prompt if bash is used: getcwd cannot access the parent directory: No such file or directory
I don't think there currently still is a real solution for pbek/QOwnNotes#2299.
Maybe as @ckayr said, let the developer decide how to open other programs?😊
@r00tr4v3n And, do you thinking this is a bug? 😉
Could be. I cannot test it though.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.