From mboxrd@z Thu Jan 1 00:00:00 1970 From: Moritz Kiefer Subject: Re: Bug: pdf page numbers in links are ignored when exporting to latex [8.2.7b (8.2.7b-13-gd8a0ee-elpa @ /home/moritz/.emacs.d/elpa/org-20140728/)] Date: Fri, 01 Aug 2014 21:21:47 +0200 Message-ID: <87fvhgypxj.fsf@gmail.com> References: <87silj7vqg.fsf@gmail.com> <87silir3lp.fsf@nicolasgoaziou.fr> <87tx5xz2kr.fsf@gmail.com> <87lhr8womu.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDIQQ-0007n0-RU for emacs-orgmode@gnu.org; Fri, 01 Aug 2014 15:23:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDIQP-0000lW-Rl for emacs-orgmode@gnu.org; Fri, 01 Aug 2014 15:23:34 -0400 Received: from mail-vc0-x22f.google.com ([2607:f8b0:400c:c03::22f]:47155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDIQP-0000lP-Me for emacs-orgmode@gnu.org; Fri, 01 Aug 2014 15:23:33 -0400 Received: by mail-vc0-f175.google.com with SMTP id ik5so7341250vcb.20 for ; Fri, 01 Aug 2014 12:23:33 -0700 (PDT) In-reply-to: <87lhr8womu.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > Hello, > > It's not. Thanks for the patch. Some comments follow. > Hi, tried to fix those issues. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ox-latex.el-Add-page-number-of-link-when-exporting-t.patch >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 --=-=-=--