Scot Becker wrote: >David, >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 exporter. Or maybe this could be achieved using a function in `org-export-preprocess-hook': ,---- | 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." (save-excursion (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. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de