From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug] two bugs: one with comments and with exporting inline tasks Date: Thu, 04 Nov 2010 08:41:08 +0100 Message-ID: <87mxppcz8r.wl%n.goaziou@gmail.com> References: <87iq0gknpg.fsf@pinto.chemeng.ucl.ac.uk> <87pqunv83v.wl%n.goaziou@gmail.com> <87iq0fla93.fsf@ucl.ac.uk> <8739rjl3s6.fsf@ucl.ac.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Thu_Nov__4_08:41:08_2010-1" Return-path: Received: from [140.186.70.92] (port=40764 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDuRb-0005V4-Pp for emacs-orgmode@gnu.org; Thu, 04 Nov 2010 03:41:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDuRa-0005DP-H1 for emacs-orgmode@gnu.org; Thu, 04 Nov 2010 03:41:11 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:44608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDuRa-0005DD-7T for emacs-orgmode@gnu.org; Thu, 04 Nov 2010 03:41:10 -0400 Received: by wwe15 with SMTP id 15so1733614wwe.30 for ; Thu, 04 Nov 2010 00:41:09 -0700 (PDT) In-Reply-To: <8739rjl3s6.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric S Fraga Cc: Emacs Org mode mailing list --Multipart_Thu_Nov__4_08:41:08_2010-1 Content-Type: text/plain; charset=US-ASCII Hello, >>>>> Eric S Fraga writes: > I have done so and there's some interesting behaviour. Here is a > summary of 4 different results exporting essentially the same > content for the attached org file: > 1. export the whole file (C-cC-ed) produces a document with all the > content but with the inline task defining a latex =\item= with a > strange label (as indicated in my earlier message). > 2. go to the headline and select the sub-tree (C-c@) and then export > (C-cC-ed) generates a PDF with only the text up to the start (but > not including) of the inline task. > 3. place the cursor on *point 1* and export the sub-tree (C-cC-e1d) > generates the same output as the previous point. > 4. finally, place the cursor on *point 2* and export the sub-tree > (C-cC-e1d) exports only the text *after* the inline task. I have made an attempt to solve the first problem. Please have a look at the provided patch. As I didn't know what inline tasks should like in latex, it is for now a description list separated from its body (if any) with a newline. This doesn't look so good but, well, if there is better as a default value, tell me. Note that, AFAICS, there is no way to configure the appearance either. The others problems look hairier to me. Regards, -- Nicolas --Multipart_Thu_Nov__4_08:41:08_2010-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="0001-inlinetasks-fix-latex-export-wrt-conversion-to-lists.patch" Content-Transfer-Encoding: 7bit >From de9453852106fbdb542fa4751c355fd02da052bd Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 4 Nov 2010 08:03:48 +0100 Subject: [PATCH 1/2] inlinetasks: fix latex export wrt conversion to lists * org-inlinetask.el (org-inlinetask-export-handler): Remove protection from @ so it can be removed during LaTeX export. Remove terminator as it is already handled by org-exp.el. --- lisp/org-inlinetask.el | 26 +++++++++++--------------- 1 files changed, 11 insertions(+), 15 deletions(-) diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index c000999..c305d56 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -183,15 +183,13 @@ Either remove headline and meta data, or do special formatting." (setq headline (concat (if (match-end 2) (concat - (org-add-props - (format - "@ %s@" - (if (member (match-string 2 headline) - org-done-keywords) - "done" "todo") - (match-string 2 headline) - (match-string 2 headline)) - nil 'org-protected t) + (format + "@ %s@" + (if (member (match-string 2 headline) + org-done-keywords) + "done" "todo") + (match-string 2 headline) + (match-string 2 headline)) " ") "") (match-string 4 headline))) (when content @@ -200,11 +198,11 @@ Either remove headline and meta data, or do special formatting." (if (string-match "[ \t\n]+\\'" content) (setq content (substring content 0 (match-beginning 0)))) (setq content (org-remove-indentation content)) - (if latexp (setq content (concat "\\quad \\\\\n" content))))) + (setq content (if latexp (concat "\\nbsp\\\\ \\quad " content))))) (insert (make-string (org-inlinetask-get-current-indentation) ?\ ) - "- ") + "- ") (setq indent (make-string (current-column) ?\ )) - (insert headline " ::") + (insert headline " :: ") (if content (insert (if htmlp " " (concat "\n" indent)) (mapconcat 'identity (org-split-string content "\n") @@ -212,7 +210,7 @@ Either remove headline and meta data, or do special formatting." (insert "\n")) (insert indent) (backward-delete-char 2) - (insert "THISISTHEINLINELISTTEMINATOR\n")))))) + (unless latexp (insert "THISISTHEINLINELISTTEMINATOR\n"))))))) (defun org-inlinetask-get-current-indentation () "Get the indentation of the last non-while line above this one." @@ -266,8 +264,6 @@ Either remove headline and meta data, or do special formatting." '(add-hook 'org-font-lock-hook 'org-inlinetask-fontify)) (eval-after-load "org-html" '(add-hook 'org-export-html-final-hook 'org-inlinetask-remove-terminator)) -(eval-after-load "org-latex" - '(add-hook 'org-export-latex-final-hook 'org-inlinetask-remove-terminator)) (eval-after-load "org-ascii" '(add-hook 'org-export-ascii-final-hook 'org-inlinetask-remove-terminator)) (eval-after-load "org-docbook" -- 1.7.3.2 --Multipart_Thu_Nov__4_08:41:08_2010-1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --Multipart_Thu_Nov__4_08:41:08_2010-1--