From 8eee473f3760a3ccbdeea98e4de71d6a2464f9df Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 15 Dec 2010 12:37:45 +0100 Subject: [PATCH] Anchor outline regexp during LaTeX tree export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-latex.el (org-export-latex-first-lines): Anchor outline regexp during LaTeX tree export Jörg Hagmann writes: > - If you export the (new) minimal example below to latex (C-cC-e l), it works. > - If you only export a tree (Subtree in the example; C-cC-e 1 l), the first table ends at the horizontal line and everything between it and the next node (Subsubtree) is eliminated. The second (identical) table is exported correctly. > - If you remove the asterisk(s) in the first table, it works. > > This problem crept in in the last days or weeks before 7.4. > > It may not be a problem for most of you, but I happen to have a number of files where columns are automatically displayed as tables preceding the first subnode (#+BEGIN: columnview ...). An alternative would be to display %ITEM in column-view without the asterisks. > > Emacs 23.2.1 on OS X 10.6.5 > Org-mode version 7.4 (release_7.4.24.g48b11.dirty) > > Thanks, Jörg > > -------New minimal example------------ > * Subtree > > > | One | Two | Three | > |--------+------+-------| > | * Test | text | text | > | ** One | text | text | > > > Some text > > ** Subsubtree > > | One | Two | Three | > |--------+------+-------| > | * Test | text | text | > | ** One | text | text | --- lisp/org-latex.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index a29c9f374..a26117145 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1325,7 +1325,8 @@ If END is non-nil, it is the end of the region." (save-excursion (goto-char (or beg (point-min))) (let* ((pt (point)) - (end (if (re-search-forward (org-get-limited-outline-regexp) end t) + (end (if (re-search-forward + (concat "^" (org-get-limited-outline-regexp)) end t) (goto-char (match-beginning 0)) (goto-char (or end (point-max)))))) (prog1