浏览代码

adding new :headers header argument for latex code blocks

* lisp/ob-latex.el (org-babel-execute:latex): adding new :headers
  header argument for latex code blocks
Eric Schulte 14 年之前
父节点
当前提交
c52ccaefa7
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      lisp/ob-latex.el

+ 7 - 0
lisp/ob-latex.el

@@ -75,6 +75,7 @@ This function is called by `org-babel-execute-src-block'."
 	     (fit (or (cdr (assoc :fit params)) border))
 	     (height (and fit (cdr (assoc :pdfheight params))))
 	     (width (and fit (cdr (assoc :pdfwidth params))))
+	     (headers (cdr (assoc :headers params)))
 	     (in-buffer (not (string= "no" (cdr (assoc :buffer params)))))
 	     (org-export-latex-packages-alist
 	      (append (cdr (assoc :packages params))
@@ -102,6 +103,12 @@ This function is called by `org-babel-execute-src-block'."
 	     (if border (format "\\setlength{\\PreviewBorder}{%s}" border) "")
 	     (if height (concat "\n" (format "\\pdfpageheight %s" height)) "")
 	     (if width  (concat "\n" (format "\\pdfpagewidth %s" width))   "")
+	     (if headers
+		 (concat "\n"
+			 (if (listp headers)
+			     (mapconcat #'identity headers "\n")
+			   headers) "\n")
+	       "")
 	     (if org-format-latex-header-extra
 		 (concat "\n" org-format-latex-header-extra)
 	       "")