#!/bin/bash # 1. Installation location of the Wolfram Engine WOLFRAMROOT=/usr/local/Wolfram/WolframEngine/12.1 # 2. MathLink path. Consider saving it for reasons in 4. MLINKROOT=$WOLFRAMROOT/SystemFiles/Links/MathLink/DeveloperKit/Linux-x86-64/CompilerAdditions # 3. Compile gcc -m64 -o ~/.TeXmacs/bin/tm_mathematica.bin \ /usr/share/TeXmacs/plugins/mathematica/src.lazy/tm_mathematica.c \ -I $MLINKROOT -L $MLINKROOT -lML64i4 -lrt -lm -lpthread -lstdc++ -ldl -luuid # 4. To get it to work we should additionally specify the following at TeXmacs launch time: export LD_LIBRARY_PATH=$MLINKROOT # 5. Launch. # Note: For new versions of Ubuntu with no TeXmacs in apt, # please change the above TeXmacs paths to your own binary installation. texmacs