emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Custom latex environments using properties


From: Jambunathan K
Subject: Re: [O] Custom latex environments using properties
Date: Tue, 30 Aug 2011 12:51:15 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt)



> 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

-- 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]