Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How allow renaming SageMath-x.y.app to SageMath.app for sagetex

When using the sagetex with LaTeX under MacTeX and the TeXShop front end, the suggested method (from the TeXShop docs) is to rename SageMath-x.y.app to just SageMath.app and then to create aliases for the executable sage and for sagetex.sty within the Contents of the app.

That works just fine to use sagetex in LaTeX.

However, once the renaming is done, the app itself no longer works! Once I open the renamed SageMath.app, I get a pop-up error message "Juypyter Server failed to start...", and inspecting the log reveals:

/Applications/SageMath.app/Contents/Resources/sage/src/bin/sage: line 617: /Applications/SageMath-9.1.app/Contents/Resources/sage/local/bin/python3: No such file or directory          
/Applications/SageMath.app/Contents/Resources/sage/src/bin/sage: line 617: exec: /Applications/SageMath-9.1.app/Contents/Resources/sage/local/bin/python3: cannot execute: No such file or directory

Apparently access to python3 has been hard-coded into the sage executable so that it is expect to be in the file tree with root the original name SageMath-x.y.

Is there some workaround so that one can both use sagetex in the way recommended by the MacTeX/TeXShop world and still be able to use the SageMath app normally to start the Jupyter server, etc.?

How allow renaming SageMath-x.y.app to SageMath.app for sagetex

When using the sagetex with LaTeX under MacTeX and the TeXShop front end, the suggested method (from the TeXShop docs) is to rename SageMath-x.y.app to just SageMath.app and then to create aliases symlinks for the executable sage and for sagetex.sty within the Contents of the app.

That works just fine to use sagetex in LaTeX.

However, once the renaming is done, the app itself no longer works! Once I open the renamed SageMath.app, I get a pop-up error message "Juypyter Server failed to start...", and inspecting the log reveals:

/Applications/SageMath.app/Contents/Resources/sage/src/bin/sage: line 617: /Applications/SageMath-9.1.app/Contents/Resources/sage/local/bin/python3: No such file or directory          
/Applications/SageMath.app/Contents/Resources/sage/src/bin/sage: line 617: exec: /Applications/SageMath-9.1.app/Contents/Resources/sage/local/bin/python3: cannot execute: No such file or directory

Apparently access to python3 has been hard-coded into the sage executable so that it is expect to be in the file tree with root the original name SageMath-x.y.

Is there some workaround so that one can both use sagetex in the way recommended by the MacTeX/TeXShop world and still be able to use the SageMath app normally to start the Jupyter server, etc.?