MATLAB environment variables issue with MacTeX 2020
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yuanqing Xue
am 29 Okt. 2020
Beantwortet: Walter Roberson
am 31 Okt. 2020
Hello
I'm running several matlab script include using xelatex to compile LaTex code and export to pdf. I downloaded c from the official website and installed successfully, but I keep having this error when I run my script. I use Mac system in MacOS High Sierra and the code was run locally using matlab2020
/bin/bash: xelatex: command not found
...
LaTeX compilation failed.
I searched for lots of answers, the one I found the most useful is this one: https://www.mathworks.com/matlabcentral/answers/850-matlab-environment-variables
I used the suggestion from the answer to set :
setenv([getenv('PATH') ':/usr/texbin']);
setenv([getenv('PATH') ':/usr/local/bin']);
also
setenv('PATH', [getenv('PATH') '::/usr/local/bin']);
then I thought the installation path for MacTeX 2020 might changed, I found this: "The default installation directory is /usr/local/texlive/2020 on Unix"
after change the path and run this
setenv('PATH', [getenv('PATH') ':/usr/local/texlive/2020/']);
Still does not work and the same error showed up
Does anyone know how to fix this? Thanks!
4 Kommentare
Walter Roberson
am 30 Okt. 2020
/Library/TeX/texbin/xelatex is the fully qualified path of the executable, not just the directory name. So you should be using
setenv('PATH', [getenv('PATH') '/Library/TeX/texbin']);
Akzeptierte Antwort
Walter Roberson
am 31 Okt. 2020
(summarizing)
setenv('PATH', [getenv('PATH') '/Library/TeX/texbin']);
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Adding custom doc finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!