Bladeren bron

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
Moritz Kiefer 10 jaren geleden
bovenliggende
commit
91eee36742
1 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  1. 6 0
      lisp/ox-latex.el

+ 6 - 0
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")
+                   (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)) "")