1

When I was trying to export the pdf file. It notifies me this. enter image description here And then I searched on Google. People suggest me check the method in the link below. https://github.com/purcell/exec-path-from-shell

But I got stuck on the first step, "add the following into your init.el." Where is init.el?? And how to evaluate (getenv "SHELL") ??

  • Which system are you working on? OS X as purcell? Give the output of emacs-version. Which version of auctex do you use? – Tobias Jul 22 '18 at 14:14
  • OS version: macOS High Sierra. Emacs version: 26.1 – Pengfei He Jul 22 '18 at 16:47
  • Do you have TeX installed? Open a terminal and enter the command which tex. What is the output? What is the output of echo $PATH? – MTS Aug 23 '18 at 16:32
  • init.el is a configuration file. It is usually located at ~/.emacs.d/init.el. If this file isn't there, you can create it. An alternative to init.el is to put this sort of stuff in a file ~/.emacs. – MTS Aug 23 '18 at 16:37
  • To evaluate (getenv "SHELL"), put that code into the emacs scratch buffer, put the cursor after the closing parenthesis, and type C-x C-e. – MTS Aug 23 '18 at 16:38
1

A short answer: for your path problem you can use of coarse the package exec-path-from-shell or, shorter, use the following shorter code snippet in your init.el file:

(setenv "PATH" (concat "/Library/TeX/texbin:"
                     (getenv "PATH")))
(add-to-list 'exec-path "/Library/TeX/texbin")

A for the init.el file: it is possible to already have it. Usually it is hidden, so it will not show up in your Finder. Try the follwings:

  • In your Finder, select your home folder and then type cmd + > to see all hidden files.
  • Check for a folder .emacs.d - if you don't already have it, then create it by choosing from menu File | Create New Folder and type in the name .emacs.d
  • Now open your Emacs and then create the file init.el, by opening with: C-x C-f and then from the minibuffer type ~/.emacs.d/init.el
  • Place here the above snippet and the rest of your configurations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.