Browse Source

ox-beamer/latex/koma-letter: Fix missing newlines in header

* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Fix
  missing newlines in header.
* lisp/ox-beamer.el (org-beamer-template): Fix missing newlines in
  header.
* lisp/ox-latex.el (org-latex-template): Fix missing newlines in
  header.
Nicolas Goaziou 4 years ago
parent
commit
a2a5c8fd5b
3 changed files with 68 additions and 64 deletions
  1. 22 21
      contrib/lisp/ox-koma-letter.el
  2. 24 22
      lisp/ox-beamer.el
  3. 22 21
      lisp/ox-latex.el

+ 22 - 21
contrib/lisp/ox-koma-letter.el

@@ -176,27 +176,28 @@ holding export options."
    (and (plist-get info :time-stamp-file)
         (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
    ;; Document class and packages.
-   (let ((class (plist-get info :latex-class))
-         (class-options (plist-get info :latex-class-options)))
-     (org-element-normalize-string
-      (let* ((header (nth 1 (assoc class org-latex-classes)))
-             (document-class-string
-              (and (stringp header)
-                   (if (not class-options) header
-		     (replace-regexp-in-string
-		      "^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
-		      class-options header t nil 1)))))
-        (if (not document-class-string)
-	    (user-error "Unknown LaTeX class `%s'")
-          (org-latex-guess-babel-language
-           (org-latex-guess-inputenc
-            (org-splice-latex-header
-             document-class-string
-             org-latex-default-packages-alist ; defined in org.el
-             org-latex-packages-alist nil     ; defined in org.el
-	     (concat (plist-get info :latex-header)
-		     (plist-get info :latex-header-extra))))
-           info)))))
+   (let* ((class (plist-get info :latex-class))
+	  (class-options (plist-get info :latex-class-options))
+	  (header (nth 1 (assoc class org-latex-classes)))
+	  (document-class-string
+	   (and (stringp header)
+		(if (not class-options) header
+		  (replace-regexp-in-string
+		   "^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
+		   class-options header t nil 1)))))
+     (if (not document-class-string)
+	 (user-error "Unknown LaTeX class `%s'")
+       (org-latex-guess-babel-language
+	(org-latex-guess-inputenc
+	 (org-element-normalize-string
+	  (org-splice-latex-header
+	   document-class-string
+	   org-latex-default-packages-alist ; Defined in org.el.
+	   org-latex-packages-alist nil     ; Defined in org.el.
+	   (concat (org-element-normalize-string
+		    (plist-get info :latex-header))
+		   (plist-get info :latex-header-extra)))))
+	info)))
    ;; Define "From" data.
    (format "\\setkomavar{fromname}{%s}\n"
            (org-export-data (plist-get info :author) info))

+ 24 - 22
lisp/ox-beamer.el

@@ -856,28 +856,30 @@ holding export options."
      (and (plist-get info :time-stamp-file)
 	  (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
      ;; 2. Document class and packages.
-     (let ((class (plist-get info :latex-class))
-	   (class-options (plist-get info :latex-class-options)))
-       (org-element-normalize-string
-	(let* ((header (nth 1 (assoc class org-latex-classes)))
-	       (document-class-string
-		(and (stringp header)
-		     (if (not class-options) header
-		       (replace-regexp-in-string
-			"^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
-			class-options header t nil 1)))))
-	  (if (not document-class-string)
-	      (user-error "Unknown LaTeX class `%s'" class)
-	    (org-latex-guess-babel-language
-	     (org-latex-guess-inputenc
-	      (org-splice-latex-header
-	       document-class-string
-	       org-latex-default-packages-alist
-	       org-latex-packages-alist nil
-	       (concat (plist-get info :latex-header)
-		       (plist-get info :latex-header-extra)
-		       (plist-get info :beamer-header-extra))))
-	     info)))))
+     (let* ((class (plist-get info :latex-class))
+	    (class-options (plist-get info :latex-class-options))
+	    (header (nth 1 (assoc class org-latex-classes)))
+	    (document-class-string
+	     (and (stringp header)
+		  (if (not class-options) header
+		    (replace-regexp-in-string
+		     "^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
+		     class-options header t nil 1)))))
+       (if (not document-class-string)
+	   (user-error "Unknown LaTeX class `%s'" class)
+	 (org-latex-guess-babel-language
+	  (org-latex-guess-inputenc
+	   (org-element-normalize-string
+	    (org-splice-latex-header
+	     document-class-string
+	     org-latex-default-packages-alist
+	     org-latex-packages-alist nil
+	     (concat (org-element-normalize-string
+		      (plist-get info :latex-header))
+		     (org-element-normalize-string
+		      (plist-get info :latex-header-extra))
+		     (plist-get info :beamer-header-extra)))))
+	  info)))
      ;; 3. Insert themes.
      (let ((format-theme
 	    (function

+ 22 - 21
lisp/ox-latex.el

@@ -1069,27 +1069,28 @@ holding export options."
      (and (plist-get info :time-stamp-file)
 	  (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
      ;; Document class and packages.
-     (let ((class (plist-get info :latex-class))
-	   (class-options (plist-get info :latex-class-options)))
-       (org-element-normalize-string
-	(let* ((header (nth 1 (assoc class org-latex-classes)))
-	       (document-class-string
-		(and (stringp header)
-		     (if (not class-options) header
-		       (replace-regexp-in-string
-			"^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
-			class-options header t nil 1)))))
-	  (if (not document-class-string)
-	      (user-error "Unknown LaTeX class `%s'" class)
-	    (org-latex-guess-babel-language
-	     (org-latex-guess-inputenc
-	      (org-splice-latex-header
-	       document-class-string
-	       org-latex-default-packages-alist
-	       org-latex-packages-alist nil
-	       (concat (plist-get info :latex-header)
-		       (plist-get info :latex-header-extra))))
-	     info)))))
+     (let* ((class (plist-get info :latex-class))
+	    (class-options (plist-get info :latex-class-options))
+	    (header (nth 1 (assoc class org-latex-classes)))
+	    (document-class-string
+	     (and (stringp header)
+		  (if (not class-options) header
+		    (replace-regexp-in-string
+		     "^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
+		     class-options header t nil 1)))))
+       (if (not document-class-string)
+	   (user-error "Unknown LaTeX class `%s'" class)
+	 (org-latex-guess-babel-language
+	  (org-latex-guess-inputenc
+	   (org-element-normalize-string
+	    (org-splice-latex-header
+	     document-class-string
+	     org-latex-default-packages-alist
+	     org-latex-packages-alist nil
+	     (concat (org-element-normalize-string
+		      (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)))
        (when (integerp sec-num)