sunnyhasija / Academic-Doom-Emacs-Config

My doom emacs configuration files
296 stars 31 forks source link

Installing pdf-tools in doom-emacs on MacOS #9

Closed roastedoolong closed 3 years ago

roastedoolong commented 3 years ago

Hi,

Thanks so much for this guide, I was able to adapt your config to get everything working except loading PDFs. I've tried lots of things (including uninstall-reinstall emacs) but have not got it to work yet. Briefly, when I enter a note for a bibliography entry, navigate to the line for the PDF, and call 'M-x org-noter', I'm prompted to install epdfinfo. I accept this and it builds fine, then I call 'M-x pdf-info-check-epdfinfo' and it says it's working. But when I try the 'M-x org-noter' step again (after quitting emacs, doom sync, starting emacs), the pdf file just loads as a bunch of text.

There are lots of workarounds to get pdf-tools working online but I haven't found one that has worked with your setup

What OS do you use? How did you install emacs (I've installed using homebrew with either emacsport or emacs-plus)? How did you install doom-emacs? Have you encountered and solved issues with pdf-tools with your config?

sunnyhasija commented 3 years ago

I am sorry that you are having issues with loading pdfs.

I use fedora and manjaro (desktop and laptop).

I installed emacs using the native comp branch (this got merged into main emacs yesterday, but I have not updated).

I installed DOOM using

git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install 

I had to rebuild pdf-tools a couple of times, but eventually it ended up working. Try installing pdf-tools manually from a repo.

roastedoolong commented 3 years ago

Thanks!

Installing to MacOS from a repo seemed a bit tricky (Dunn/emacs can't be tapped currently), but I was able to install pdf-tools in doom emacs after following this: https://github.com/politza/pdf-tools/issues/645#issuecomment-780326732. I thought I'd post this in case others on MacOS are interested in your setup but have the same problem. I can now open PDFs from the file explorer, but 'M-x org-noter' still does not work. When I first entered it, it prompted me to build the epdfinfo program, which I accepted. This built epdfinfo in my ~/.emacs.d/.local/straight/build-## folder, possibly overwriting what was there. I'd be grateful for any suggestions. EDIT: building epdfinfo did not cause a problem, but 'M-x org-noter' still just creates a note without opening a pdf. I'm a noob but I noticed your init file does not use the (require 'package) syntax. Do I need to install org-noter and pdf-tools dependencies from within emacs to get this to work? EDIT2: I realised packages are installed via package.el. I've figured out that when I hit TAB+f2 to directly open the PDF from the bib file, the pdf opens fine. So the issue is just with org-noter. EDIT3: Got it to work! I had to comment out your setq doom-font block which I had copied into my config file (to see what the fonts would look like, I'm surprised this caused a problem). I didn't have the font Iosevka Term SSO4 and somehow this was messing things up.

sunnyhasija commented 3 years ago

I am glad you got it to work @brendanterry !