Selaa lähdekoodia

org-latex.el: fix bug when using #+INCLUDE before the first heading.

The LaTeX looks for strings to export before the first headline.  Such
strings are defined as "before the first heading", so they normally never
match a heading regexp.  However, #+INCLUDE can insert lines before the
first heading matching a heading regexp, causing these lines to appear
twice: as first lines and as normal headings.

The fix is to never include first lines when they match a heading regexp.

This was reported by Rasmus <rasmus.pank@gmail.com>.
Bastien Guerry 14 vuotta sitten
vanhempi
commit
3b77c7ed57
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      lisp/org-latex.el

+ 1 - 1
lisp/org-latex.el

@@ -850,7 +850,7 @@ when PUB-DIR is set, use this as the publishing directory."
 	       "\n\n"))
 
     ;; insert lines before the first headline
-    (unless skip
+    (unless (or skip (string-match "^\\*" first-lines))
       (insert first-lines))
 
     ;; export the content of headlines