[Top][All Lists]

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

Re: [Orgmode] Exporting property values to LaTeX

From: David Maus
Subject: Re: [Orgmode] Exporting property values to LaTeX
Date: Thu, 09 Sep 2010 18:03:01 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Scot Becker wrote:

>Thanks for your response.  What a cool and useful patch.   This adds all kinds 
>of cool functionality to org-mode, and in a
>single line!    I've had several times I wished I could do this kind of thing. 

>As it is, it doesn't automate my present case much, since I'd still have to 
>put the macro expansion in after every
>headline.  Not surprisingly it won't expand if you put the 
>{{{property(myproperty}}} code as part of a headline in
>org-export-latex-classes.  I reckon I'll have to try to do a hacked-up latex 

Or maybe this could be achieved using a function in

| Hook for preprocessing an export buffer.
| Pretty much the first thing when exporting is running this hook.
| Point will be in a temporary buffer that contains a copy of
| the original buffer, or of the section that is being export.
| All the other hooks in the org-export-preprocess... category
| also work in that temporary buffer, already modified by various
| stages of the processing.

The function would be quite simple: Iterate over all headlines and
insert the desired reference.  This would, by the way, even work
without the property macro.

Something like this:

(defun dmj:add-citekey ()
  "Add citekey to all headlines in current buffer."
    (goto-char (point-min))
    (while (re-search-forward "\\*+[ \t]+" nil t)
      (let ((key (org-entry-get nil "mykey" 'selective)))
        (org-end-of-subtree t)
        (unless (string= key "")
          (insert (format "\nReference: \\cite{%s}\n" key)))))))

>Also, the patch doesn't seem to work with inherited properties.  With
>org-use-property-inheritance set to 't', and this input file:

Ah, Forgot about that.  Attached patch goes on top of the last one and
allows property inheritance.

  -- David
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden

Attachment: 0001-Allow-selective-property-inheritance-in-property-mac.patch
Description: Text document

Attachment: pgpGduv54bgGO.pgp
Description: PGP signature

reply via email to

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