Categories
emacs

View PDF in Emacs

Be default PDF files are opened by Docviewer in Ubuntu distributes. Yet, there is a more convenient PDF tool, aptly named pdf-tools that works well with Emacs. The installation of pdf-tools is straight forward. Below is what I did.

sudo apt install libpng-dev zlib1g-dev
sudo apt install libpoppler-glib-dev
sudo apt install libpoppler-private-dev

After that, go to Emacs and use the package-install to install

package-refresh-contents
package-install pdf-tools

Finally, add the following line to the .emacs file. And make sure that if you are displaying line numbers in emacs, make sure it is disabled in pdf-view-mode. Here what I used is to just enable line number display in prog-mode.

(pdf-tools-install)
(add-hook 'prog-mode-hook 'linum-on)

Leave a Reply

Your email address will not be published.