فهرست منبع

ox-latex: Introduce LATEX_HEADER_EXTRA keyword

* lisp/ox-latex.el (latex): Introduce new buffer keyword.
(org-latex-template): Use new keyword.
* lisp/ox-beamer.el (org-beamer-template): Use new keyword.
* lisp/org.el (org-create-formula--latex-header): Use new keyword.
* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Use new
  keyword.

Previewing of LaTeX snippets takes account of LATEX_HEADER keywords.
LATEX_HEADER_EXTRA keyword allows to specify some header lines that
will not be used for building snippets.
Nicolas Goaziou 12 سال پیش
والد
کامیت
ee9372653f
4فایلهای تغییر یافته به همراه13 افزوده شده و 8 حذف شده
  1. 2 1
      contrib/lisp/ox-koma-letter.el
  2. 1 1
      lisp/org.el
  3. 2 1
      lisp/ox-beamer.el
  4. 8 5
      lisp/ox-latex.el

+ 2 - 1
contrib/lisp/ox-koma-letter.el

@@ -194,7 +194,8 @@ holding export options."
              document-class-string
              org-latex-default-packages-alist ; defined in org.el
              org-latex-packages-alist nil     ; defined in org.el
-             (plist-get info :latex-header-extra)))
+	     (concat (plist-get info :latex-header)
+		     (plist-get info :latex-header-extra))))
            info)))))
    ;; Define "From" data.
    (format "\\setkomavar{fromname}{%s}\n"

+ 1 - 1
lisp/org.el

@@ -18159,7 +18159,7 @@ share a good deal of logic."
      (org-combine-plists
       (org-export--get-global-options 'latex)
       (org-export--get-inbuffer-options 'latex))
-     :latex-header-extra))))
+     :latex-header))))
 
 ;; This function borrows from Ganesh Swami's latex2png.el
 (defun org-create-formula-image-with-dvipng (string tofile options buffer)

+ 2 - 1
lisp/ox-beamer.el

@@ -860,7 +860,8 @@ holding export options."
 	       document-class-string
 	       org-latex-default-packages-alist
 	       org-latex-packages-alist nil
-	       (concat (plist-get info :latex-header-extra)
+	       (concat (plist-get info :latex-header)
+		       (plist-get info :latex-header-extra)
 		       (plist-get info :beamer-header-extra))))
 	     info)))))
      ;; 3. Insert themes.

+ 8 - 5
lisp/ox-latex.el

@@ -29,9 +29,10 @@
 ;; functions are available: `org-latex-publish-to-latex' and
 ;; `org-latex-publish-to-pdf'.
 ;;
-;; The library introduces three new buffer keywords: "LATEX_CLASS",
-;; "LATEX_CLASS_OPTIONS" and "LATEX_HEADER", and a new OPTIONS item:
-;; "textht".
+;; The library introduces four new buffer keywords: "LATEX_CLASS",
+;; "LATEX_CLASS_OPTIONS", "LATEX_HEADER" and "LATEX_HEADER_EXTRA" (the
+;; latter will not be used to build LaTeX snippets).  It also
+;; introduces a new OPTIONS item: "textht".
 ;;
 ;; Table export can be controlled with a number of attributes (through
 ;; ATTR_LATEX keyword).
@@ -177,7 +178,8 @@
 		  (:date-format nil nil org-latex-date-timestamp-format)
 		  (:latex-class "LATEX_CLASS" nil org-latex-default-class t)
 		  (:latex-class-options "LATEX_CLASS_OPTIONS" nil nil t)
-		  (:latex-header-extra "LATEX_HEADER" nil nil newline)
+		  (:latex-header "LATEX_HEADER" nil nil newline)
+		  (:latex-header-extra "LATEX_HEADER_EXTRA" nil nil newline)
 		  (:latex-hyperref-p nil "texht" org-latex-with-hyperref t)))
 
 
@@ -1149,7 +1151,8 @@ holding export options."
 	       document-class-string
 	       org-latex-default-packages-alist
 	       org-latex-packages-alist nil
-	       (plist-get info :latex-header-extra)))
+	       (concat (plist-get info :latex-header)
+		       (plist-get info :latex-header-extra))))
 	     info)))))
      ;; Possibly limit depth for headline numbering.
      (let ((sec-num (plist-get info :section-numbers)))