Comments (5)
@jamiek Thanks for the information provided. You are absolutely right. Previously, I simply symbol link all the required programs to Applications/Inkscape.app/Contents/Resources/bin
.
App launching from .app bundle does not use the same shell as Terminal. In the case where default shell for user is bash
, the variable may be set in .bash_profile
and several other places. I do not know whether there is a proper way to set the shell used to launch .app bundle, or to load user's PATH settings of the default shell used in Terminal. Any idea?
from writetex.
@wanglongqi I've done some digging and have some more info.
So when launched from the Finder by double clicking an .app bundle the path is set by launchd
which has the default PATH of /usr/bin:/bin:/usr/sbin:/sbin apprently prepended by predefined locations inside the bundle (e.g. /Applications/Inkscape.app/Contents/MacOS:/Applications/Inkscape.app/Contents/MacOS/../Resources/bin)
launchctl
can be used to modify the default PATH, but note that this updates the PATH for ALL apps launched via the finder.
sudo launchctl config user path /usr/bin:/bin:/usr/sbin:/usr/local/bin:/Library/TeX/texbin
followed by a reboot has added the locations of pdflatex
and pdf2svg
to the PATH seen by processes spawned by inkscape. The extension runs fine after doing this and is indeed seeing the updated PATH /Applications/Inkscape.app/Contents/MacOS:/Applications/Inkscape.app/Contents/MacOS/../Resources/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin:/Library/TeX/texbin
I will caution that the launchctl
command above will overwrite any previously set custom PATH for launchd. This can be addressed by using launchctl getenv PATH
to get the existing path and then append the locations for pdflatex
etc.
This seems like a reasonable solution but my only hesitation is that it affects all apps launched via the finder. That said, these apps tend to look inside the .app bundle first so this should't risk breaking things.
An alternative might be to try to use python to set the appropriate PATH using os.environ
and try to read the path from the "usual" locations, or read from a writeTex configuration file.
One other possibility is to modify the info.plist file in the .app bundle to include the updated PATH. i've tested this and it works, but requires a restart.
from writetex.
Maybe another way is to add a text field for user to set additional search paths. Inkscape will remember the field value used for last run, so user also only need to set that field once.
from writetex.
User configurable text fields sounds like a clean way to handle it. Especially if you could put the config settings on a separate tab. It would keep the UI looking clean.
from writetex.
I tried to add a settings tab in this commit 85458b1, when have time please help do some tests.
from writetex.
Related Issues (20)
- Windows: unknown encoding: string-escape HOT 6
- WriteText won't output Figure HOT 5
- Won't render equations HOT 7
- error HOT 7
- update the "Latex source" field with the current selected equation in the drawing. HOT 2
- Add the option to use the "pdftocario" as the pdf to svg converter HOT 5
- ImportError: No module named inkex HOT 1
- update needed for Inkscape version 1.0 HOT 3
- 建议直接使用 mathjax 进行公式渲染 HOT 7
- dvisvgm maybe another possibility to convert dvi/pdf to svg
- Latex error : writetex.log not found HOT 4
- Does not work with inkscape HOT 2
- Traceback after WriteTeX installation on Ubuntu HOT 4
- is there an option to re-edit latex? HOT 2
- FileNotFoundError HOT 2
- WriteTeX and Inkscape 1.2 HOT 8
- IndexError on use HOT 1
- Problem using the fourier package HOT 6
- Error reading temp file HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from writetex.