mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-22 07:09:47 +00:00
Fix and improve list exporting to latex.
* lisp/org-latex.el: items are no longer skipped when their first line ends on a protected element. * lisp/org-list.el: protected environments looking like lists are not exported anymore. Thanks to Nicolas Goaziou <n.goaziou@gmail.com> for this patch.
This commit is contained in:
parent
512ad1e30d
commit
47996c02cb
@ -2188,21 +2188,20 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
|
||||
"Convert plain text lists in current buffer into LaTeX lists."
|
||||
(let (res)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward org-list-beginning-re nil t)
|
||||
(org-if-unprotected
|
||||
(beginning-of-line)
|
||||
(setq res (org-list-to-latex (org-list-parse-list t)
|
||||
org-export-latex-list-parameters))
|
||||
(while (string-match "^\\(\\\\item[ \t]+\\)\\[@start:\\([0-9]+\\)\\]"
|
||||
res)
|
||||
(setq res (replace-match
|
||||
(concat (format "\\setcounter{enumi}{%d}"
|
||||
(1- (string-to-number
|
||||
(match-string 2 res))))
|
||||
"\n"
|
||||
(match-string 1 res))
|
||||
t t res)))
|
||||
(insert res "\n")))))
|
||||
(while (org-re-search-forward-unprotected org-list-beginning-re nil t)
|
||||
(beginning-of-line)
|
||||
(setq res (org-list-to-latex (org-list-parse-list t)
|
||||
org-export-latex-list-parameters))
|
||||
(while (string-match "^\\(\\\\item[ \t]+\\)\\[@start:\\([0-9]+\\)\\]"
|
||||
res)
|
||||
(setq res (replace-match
|
||||
(concat (format "\\setcounter{enumi}{%d}"
|
||||
(1- (string-to-number
|
||||
(match-string 2 res))))
|
||||
"\n"
|
||||
(match-string 1 res))
|
||||
t t res)))
|
||||
(insert res "\n"))))
|
||||
|
||||
(defconst org-latex-entities
|
||||
'("\\!"
|
||||
|
@ -1170,7 +1170,7 @@ sublevels as a list of strings."
|
||||
(match-beginning 0)) end))))
|
||||
(item (buffer-substring
|
||||
(point)
|
||||
(or (and (re-search-forward
|
||||
(or (and (org-re-search-forward-unprotected
|
||||
org-list-beginning-re end t)
|
||||
(goto-char (match-beginning 0)))
|
||||
(goto-char end))))
|
||||
|
Loading…
Reference in New Issue
Block a user