From 82cb7209c912798b43a91b3dde1dd4428e09580e Mon Sep 17 00:00:00 2001 From: Moritz Kiefer Date: Thu, 31 Jul 2014 17:45:36 +0200 Subject: [PATCH] ox-latex.el: Add page number of link when exporting to latex * lisp/ox-latex.el (org-latex--inline-image): Use page number (:search-option) of pdf links as page option in includegraphics. TINYCHANGE --- lisp/ox-latex.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index ceea302..dd227ab 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1861,6 +1861,12 @@ used as a communication channel." (setq options (concat options ",width=" width))) (when (org-string-nw-p height) (setq options (concat options ",height=" height))) + (let ((search-option (org-element-property :search-option link))) + (when (and search-option + (equal filetype "pdf") + (string-match "\\`[0-9]+\\'" search-option) + (not (string-match "page=" options))) + (setq options (concat options ",page=" search-option)))) (setq image-code (format "\\includegraphics%s{%s}" (cond ((not (org-string-nw-p options)) "") -- 2.0.3