# Difference between using ⌘ - space vs 'open -a' in terminal?

I noticed a difference when compiling a latex document within emacs, but I think this is really a mac question.

When I open emacs via ⌘ - space and then type C-c C-c, instead of compiling with pdflatex, the minibuffer proposes 'Command[\doc-view]', and if I enter 'pdflatex', the TeX-shell (within emacs) tells me 'pdflatex: command not found'.

When I open emacs from a terminal window and type 'open -a emacs', it works fine.

Why is that?

• When you open terminal .bash_profile and .bashrc executes (session start) and that's the reason you have correct PATH to pdflatex. Add the pdflatex path to /etc/paths and it should work. Mar 7 '18 at 11:11