From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: Custom latex environments using properties Date: Tue, 30 Aug 2011 08:51:04 +0200 Message-ID: <8062lfxuhz.fsf@somewhere.org> References: <81k49vtovt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Jambunathan and Suvayu, Jambunathan K wrote: > suvayu ali writes: >> I am trying to implement a way to wrap a custom latex environment around a >> sub-tree where I specify the environment and its options as a PROPERTY. I >> am expecting it to work as BEAMER_env or BEAMER_envargs works for >> org-beamer export. I have no particular experience with using such at the subtree level. > Not strictly answering your question. But is tangentially related ... > > The excerpt pasted below is from org-special-blocks.el. I am not much > familiar with LaTeX. I hope these special blocks could be used for > achieving the desired resutls. > > Also there is a way to wrap a block of text in custom divs in case of > HTML exporter. > > ,---- > | ;; This package generalizes the #+begin_foo and #+end_foo tokens. > | > | ;; To use, put the following in your init file: > | ;; > | ;; (require 'org-special-blocks) > | > | ;; The tokens #+begin_center, #+begin_verse, etc. existed previously. > | ;; This package generalizes them (at least for the LaTeX and html > | ;; exporters). When a #+begin_foo token is encountered by the LaTeX > | ;; exporter, it is expanded into \begin{foo}. The text inside the > | ;; environment is not protected, as text inside environments generally > | ;; is. When #+begin_foo is encountered by the html exporter, a div > | ;; with class foo is inserted into the HTML file. It is up to the > | ;; user to add this class to his or her stylesheet if this div is to > | ;; mean anything. > `---- The answer of Jambunathan makes much sense, for such cases: #+BEGIN_shaded This will get a color background. #+END_shaded or #+BEGIN_mcchangemargin {-1cm}{0cm} This paragraph must be moved regarding the normal margins. #+END_mcchangemargin {-1cm}{0cm} Note -- The above does not work yet correctly, though, because of the parameters to be passed onto the LaTeX environment. 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. Best regards, Seb -- Sebastien Vauban