all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: suvayu ali <fatkasuvayu+linux@gmail.com>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Custom latex environments using properties
Date: Tue, 30 Aug 2011 00:52:05 +0200	[thread overview]
Message-ID: <CAMXnza1F_Vz3NUH8jQBkRSA0eqsJEq5u_7jhUxFC_UAjLkiNqw@mail.gmail.com> (raw)

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π

** 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=" 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?

-- 
Suvayu

Open source is the future. It sets us free.

             reply	other threads:[~2011-08-29 22:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 22:52 suvayu ali [this message]
2011-08-30  6:05 ` Custom latex environments using properties Jambunathan K
2011-08-30  6:51   ` Sebastien Vauban
2011-08-30  7:21     ` Jambunathan K
     [not found]       ` <CAMXnza2jN0A3a=uWRetZykQ_OtwjyR47VYC_s6tCcePUb3YHOg@mail.gmail.com>
2011-08-30 17:20         ` Jambunathan K
2011-08-30 18:07           ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMXnza1F_Vz3NUH8jQBkRSA0eqsJEq5u_7jhUxFC_UAjLkiNqw@mail.gmail.com \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.