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
This commit is contained in:
Moritz Kiefer 2014-07-31 17:45:36 +02:00 committed by Nicolas Goaziou
parent 296d82a383
commit 91eee36742
1 changed files with 6 additions and 0 deletions

View File

@ -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")
(org-string-match-p "\\`[0-9]+\\'" search-option)
(not (org-string-match-p "page=" options)))
(setq options (concat options ",page=" search-option))))
(setq image-code
(format "\\includegraphics%s{%s}"
(cond ((not (org-string-nw-p options)) "")