Revert "org-latex.el: Don't insert a linebreak when itemizing a subtree that is just a headline."

This reverts commit 6632ea95d3.
This commit is contained in:
Bastien Guerry 2012-03-26 22:56:02 +02:00
parent e7a3dd3750
commit 4637de726c
1 changed files with 11 additions and 15 deletions

View File

@ -1218,9 +1218,7 @@ numbered sections and lower levels as unnumbered sections."
org-export-latex-add-level))
(occur (number-to-string (cdr (assoc 'occur subcontent))))
(content (cdr (assoc 'content subcontent)))
(content-e (org-export-latex-content content))
(subcontent (cadr (assoc 'subcontent subcontent)))
(subcontent-e (org-export-latex-sub subcontent))
(label (org-get-text-property-any 0 'target heading))
(label-list (cons label (cdr (assoc label
org-export-target-aliases))))
@ -1264,11 +1262,11 @@ numbered sections and lower levels as unnumbered sections."
(when label
(insert (mapconcat (lambda (l) (format "\\label{%s}" l))
label-list "\n") "\n"))
(insert content-e)
(insert (org-export-latex-content content))
(cond ((stringp subcontent) (insert subcontent))
((listp subcontent)
(while (org-looking-back "\n\n") (backward-delete-char 1))
subcontent-e))
(org-export-latex-sub subcontent)))
(when (and end (string-match "[^ \t]" end))
(let ((hook (org-get-text-property-any 0 'org-insert-hook end)))
(and (functionp hook) (funcall hook)))
@ -1283,9 +1281,9 @@ numbered sections and lower levels as unnumbered sections."
(insert (format "\n\\item[%s]%s~\n"
heading
(if label (format "\\label{%s}" label) "")))
(insert content-e)
(insert (org-export-latex-content content))
(cond ((stringp subcontent) (insert subcontent))
((listp subcontent) subcontent-e))
((listp subcontent) (org-export-latex-sub subcontent)))
(insert "\\end{description} % ends low level\n"))
((memq org-export-latex-low-levels '(itemize enumerate))
(if (string-match "% ends low level$"
@ -1293,14 +1291,12 @@ numbered sections and lower levels as unnumbered sections."
(delete-region (point-at-bol 0) (point))
(insert (format "\\begin{%s}\n"
(symbol-name org-export-latex-low-levels))))
(insert (format (if (not (equal (replace-regexp-in-string "\n" "" content-e) ""))
"\n\\item %s\\\\\n%s%%"
"\n\\item %s\n%s%%")
(insert (format "\n\\item %s\\\\\n%s%%"
heading
(if label (format "\\label{%s}" label) "")))
(insert content-e)
(insert (org-export-latex-content content))
(cond ((stringp subcontent) (insert subcontent))
((listp subcontent) subcontent-e))
((listp subcontent) (org-export-latex-sub subcontent)))
(insert (format "\\end{%s} %% ends low level\n"
(symbol-name org-export-latex-low-levels))))
@ -1312,18 +1308,18 @@ numbered sections and lower levels as unnumbered sections."
(insert (format (nth 2 org-export-latex-low-levels)
heading
(if label (format "\\label{%s}" label) "")))
(insert content-e)
(insert (org-export-latex-content content))
(cond ((stringp subcontent) (insert subcontent))
((listp subcontent) subcontent-e))
((listp subcontent) (org-export-latex-sub subcontent)))
(insert (nth 1 org-export-latex-low-levels)
" %% ends low level\n"))
((stringp org-export-latex-low-levels)
(insert (format org-export-latex-low-levels heading) "\n")
(when label (insert (format "\\label{%s}\n" label)))
(insert content-e)
(insert (org-export-latex-content content))
(cond ((stringp subcontent) (insert subcontent))
((listp subcontent) subcontent-e))))))))
((listp subcontent) (org-export-latex-sub subcontent)))))))))
;;; Exporting internals:
(defun org-export-latex-set-initial-vars (ext-plist level)