From mboxrd@z Thu Jan 1 00:00:00 1970 From: suvayu ali Subject: Custom latex environments using properties Date: Tue, 30 Aug 2011 00:52:05 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyAgv-0000fp-Ga for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 18:52:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyAgu-0004VL-Eu for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 18:52:29 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:37984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyAgu-0004Ui-8p for emacs-orgmode@gnu.org; Mon, 29 Aug 2011 18:52:28 -0400 Received: by bkbzt4 with SMTP id zt4so5044797bkb.0 for ; Mon, 29 Aug 2011 15:52:26 -0700 (PDT) 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: org-mode mailing list Hi everyone, 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. To give you an example: * Bs decay (Bs->Dsh) Bs->DsK or Ds=CF=80 ** Decay model :PROPERTIES: :LATEX_env: todonotes :LATEX_envargs: green :END: 1. Justify neglecting CP violation 2. Verify master equations ** Detector effects :PROPERTIES: :LATEX_env: todonotes :LATEX_envargs: blue :END: 1. How is the Gaussian used for smearing of proper time resolution derived? 2. Why is the per event proper time error PDF needed? Why is smearing of time resolution not enough? I am hoping to get blocks with colour codes (using the todonotes package) based on the org properties. I tried using the preprocess hook to convert the org source to latex using the defined properties but the conversion to latex escapes everything and the process to pdf part breaks. I used the following code to modify the preprocess hook. #+begin_src emacs-lisp (defun my-org-export-latex-wrap-env () "Wrap heading with arbitrary latex environment." (interactive) (setq env (org-entry-get (point) "LATEX_env")) (setq envargs (org-entry-get (point) "LATEX_envargs")) (let ((heading (org-get-heading t)) (text (org-get-entry))) (org-mark-subtree) (delete-region (region-beginning) (region-end)) (insert (concat env "[inline, color=3D" envargs "]{%\n" "\\textbf{" heading "}\\protect\\linebreak{}%\n" text "\n}%\n")))) ;; the following snippet is from my hook (dolist (match spltags) (org-map-entries (lambda () (my-org-export-latex-wrap-env)) match)) #+end_src Any one has ideas about what else I can try? --=20 Suvayu Open source is the future. It sets us free.