From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Custom latex environments using properties Date: Tue, 30 Aug 2011 12:51:15 +0530 Message-ID: <81r543cql0.fsf@gmail.com> References: <81k49vtovt.fsf@gmail.com> <8062lfxuhz.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyIeY-0002I1-6M for emacs-orgmode@gnu.org; Tue, 30 Aug 2011 03:22:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyIeX-00071B-CN for emacs-orgmode@gnu.org; Tue, 30 Aug 2011 03:22:34 -0400 Received: from plane.gmane.org ([80.91.229.3]:57546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyIeX-00070V-3p for emacs-orgmode@gnu.org; Tue, 30 Aug 2011 03:22:33 -0400 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1QyIeU-0003wJ-Ib for emacs-orgmode@gnu.org; Tue, 30 Aug 2011 09:22:30 +0200 In-Reply-To: <8062lfxuhz.fsf@somewhere.org> (Sebastien Vauban's message of "Tue, 30 Aug 2011 08:51:04 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org > But, the problem asked by Suvayu is different because the "todo" here is a > macro, not an environment. Hence the expected output: > > \todo[inline]{\textbf{\textsf{\textsc{TODO} Provide your last offer.}}\\ } > > Except from working in such a fashion: > > #+LaTeX: \todo{ > ... your Org text > is here > inside ... > #+LaTeX: } > > I don't see (currently) any other way to achieve what you'd like to > get. This use case suggests that a latex environment may not be always be what the user wants and there could be cases where a macro might be the most appropriate one. I sure think the special block handler can be taught to surround the special blocks with \todo { } instead of \begin{todo} ... \end{todo}. But the more general solution might be to have the user register handlers (callbacks) for each of the special "named" blocks and have him handle it from his end. This way he can sneak the custom arguments to the macros (is that what you call it?) without mucking too much with properties etc. May be Suvayu can re-define the below hook and quickly prototype something and record his experience in this thread.. --8<---------------cut here---------------start------------->8--- (defun org-special-blocks-convert-latex-special-cookies () "Converts the special cookies into LaTeX blocks." (goto-char (point-min)) (while (re-search-forward "^ORG-\\([^ \t\n]*\\)[ \t]*\\(.*\\)-\\(START\\|END\\)$" nil t) (replace-match (if (equal (match-string 3) "START") (concat "\\begin{" (match-string 1) "}" (match-string 2)) (concat "\\end{" (match-string 1) "}")) t t))) --8<---------------cut here---------------end--------------->8--- Jambunathnan K. > > Best regards, > Seb --