Hot answers tagged

34

The simplest way to tweak the formatting of a LaTeX export is by using the geometry package. Try something like this: #+LATEX_HEADER: \usepackage[margin=0.5in]{geometry}


31

Try openwith. The following code will enable it, and allow you to open PDFs with evince (change to your favorite PDF viewer): (require 'openwith) (openwith-mode t) (setq openwith-associations '(("\\.pdf\\'" "evince" (file))))


30

Switching from docview to pdf-tools happens 'automatically' when you install pdf-tools. Once you've done this, any time Emacs tries to open a pdf in Emacs, it will use pdf-tools. However, some packages will call out to the operating system, or use different config within Emacs, to decide if they should use Emacs or another program to open a pdf. So there is ...


19

If you want to view PDF with many features (highlighting search, highlighting selection, annotate, content tree), use pdf-tools. As you can see in the demo, I can using Isearch with highlighting. Emacs is now my favourite PDF reader. You can also bookmark specific PDF page by using Bookmark(+). EDIT: If you use helm and want to use external program, helm ...


18

OK, thanks to @wvxvw putting me on the right track I figured it out. You can get rid of the author and date with: #+OPTIONS: author:nil date:nil The Org Manual says that you can also toggle title with title:nil (org-export-with-title). However, this option didn't get rid of the title, and I couldn't find a variable or command org-export-with-title. ...


16

You can give a try to pdf-tools, which provides most of the requested functionality


16

Since Emacs 23, you can view PDF files as images just by opening them like normal files as long as you have Emacs running in X rather than a terminal. You can also see and edit the PDF directly, which will display the contents of the binary file as text (with lots of unprintable characters!). You can edit this text directly, but unless you can encode and ...


15

NOTE: You need to have ImageMagick installed on your system (convert executable) for this solution to work. How this solution is implemented The function org-include-img-from-pdf is the workhorse that does the PDF to Image format conversion using convert. If the org file contains # ()convertfrompdf:t, it will be assumed that the user has a pdf file that ...


14

Hyperlinks in pdfs exported from org documents are generated by the LaTeX hyperref package. This package is included by default, and options can be set in the customize interface for org-latex-default-packages-alist. For example, adding the option colorlinks=true to the entry for hyperref will switch from boxed links to coloured links. There are quite a few ...


12

You should disable linum-mode when opening a PDF file. Otherwise it will hang your Emacs. i.e. only add it to prog-mode for editing text: (add-hook 'prog-mode-hook 'linum-on) To install pdf-tools: You have to clone the repository: git clone https://github.com/politza/pdf-tools.git cd pdf-tools Run make. Then, it will produce a pdf-tools-${VERSION}.tar ...


12

Following the links given here, you can get rid of the ugly red boxes by adding the following line in the beginning of your org file: #+latex_header: \hypersetup{colorlinks=true} If red isn't your color, then add the following line: #+latex_header: \hypersetup{colorlinks=true,linkcolor=blue} for a blue color.


11

You asked about find-file. In addition to what others (e.g., Dan) say about that, it is worthwhile to also know about opening files using an application associated with the file type (e.g. extension) in option dired-guess-shell-alist-user. And if you use Emacs on MS Windows, then it is worthwhile knowing how to open a file using Windows file associations. ...


11

You can put the below in your init.el and bind the function to a binding of your choice. The function prints the file in current buffer as a PDF in the same folder by default. Here the function requires the binary ps2pdf for converting .ps to .pdf. But you can replace that with any available pdf generator on your system. (require 'ps-print) (when (...


11

From a LaTeX point of view, these are different cases. In the first case, LaTeX isn't going to wrap -- and it shouldn't! A "verbatim" environment, which is what source-code is set in, respects lines precisely and doesn't break paragraphs, because LaTeX simply can't know where to break them. If you want to wrap the lines, you have to wrap them in the source-...


10

Another way to achieve the same effect more permanently is to modify org-latex-packages-alist to add the geometry package, as follows: (setq org-latex-packages-alist '(("margin=2cm" "geometry" nil)))


10

For me, as of April 13, 2017, a reliable way to install pdf-tools on OS X (Mavericks/Sierra) is to use the following pdf-tools config and directions (in the comments): ;;; Install epdfinfo via 'brew install pdf-tools' and then install the ;;; pdf-tools elisp via the use-package below. To upgrade the epdfinfo ;;; server, just do 'brew upgrade pdf-tools' ...


10

This answer is focused on what I'm interested in, therefore it uses minted for source code listings with Org, and tikzmark as the package that can "mark" a place in your listing so that you can later refer to it from a Tikz picture. Here's a simple example (UPDATED): #+LATEX_HEADER: \usepackage{tikz} #+LATEX_HEADER: \usepackage{minted} #+LATEX_HEADER: \...


10

You may try something like this: #+ATTR_LATEX: :environment longtable :align |l|p{10cm}|l| | | <30> | | | Column | Wide Column | Column | |------------+----------------------------------------------------+--------| | Some stuff | Lots and lots of ...


9

That would require some notion of a cursor, which is currently not implemented. So marking by keyboard is not available (except the whole page).


9

You can also redefine LaTeX's \maketitle to do nothing: #+Title: Test title #+Author: Test Author #+Date: [2016-03-28 Mon] #+LATEX_HEADER: \renewcommand\maketitle{} * hello test text


8

The default resolution is probably around 90 dpi. (require 'doc-view) (setq doc-view-resolution 144) (Or set higher as you need.) You may need to run doc-view-clear-cache first for the change to be respected.


7

Try nov (installable via melpa). It is a reasonable start for reading ePUBs in Emacs.


7

Warning: dirty work-around ahead Since you "greatly prefer [pdf-tools] to DocView", is it safe to assume that using it to view all pdfs is acceptable? The following code snippet will switch the document to pdf-view-mode anytime doc-viewis entered with a pdf document. (defvar tv/prefer-pdf-tools (fboundp 'pdf-view-mode)) (defun tv/start-pdf-tools-if-pdf ()...


7

Getting inspiration from this answer, the following works. You must install the xcolor package as instructed there. #+LATEX_HEADER: \usepackage[table]{xcolor} * table test | hi | there | |------+------------------------------------| | this | @@latex:\cellcolor{blue!25}@@ that | | one | two |


7

Instead of #+LaTeX: you should try #+BEAMER_HEADER: for all beamer specific configuration lines. For example: #+BEAMER_HEADER: \setbeamertemplate{navigation symbols}{} removes navigation symbols in all slides including title page and toc.


6

If by "render larger" you mean that the dimensions of the rendered png image are larger, then you could use some of the doc-view functions to fit the image to your window: doc-view-fit-page-to-window, doc-view-fit-width-to-window, and doc-view-fit-height-to-window. In other words, increase the resolution of the rendered image as you did, and then fit (...


5

Running ag 'define.*pdf.*grep' (use grep instead of ag if you prefer) in the elpa/ directory returns this: helm-20150226.818/helm-locate.el 99: (define-key map (kbd "M-g p") 'helm-ff-run-pdfgrep) helm-20150226.818/helm-files.el 297: (define-key map (kbd "M-g p") 'helm-ff-run-pdfgrep) helm-20150226.818/helm-grep.el 229: (define-key map (...


5

I think you can do this with: #+latex_class_options: [10pt] and #+latex_header: \usepackage{setspace} #+latex_header: \onehalfspacing


4

I’m using Emacs for reading documentation, scientific papers and books — all of that without issues. My doc-view-mode uses mudraw (from mupdf) for rendering PDFs as you can see by checking doc-view-pdfdraw-program variable: doc-view-pdfdraw-program is a variable defined in `doc-view.el'. Its value is "mudraw" Documentation: Name of MuPDF's program ...


4

It worked! I am not 100% sure on the specifics as to what made it work. As commenters correctly point out, there was an issue with the packages/directories that were installed/compiled but it worked the next time I ran pdf-tools-install Things I tried/did I started/re-started my emacs --daemon server (ie turned on/off my computer) re-installed the pdf-...


Only top voted, non community-wiki answers of a minimum length are eligible