From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Exporting property values to LaTeX Date: Thu, 09 Sep 2010 18:03:01 +0200 Message-ID: <87d3sm7vm2.wl%dmaus@ictsoc.de> References: <8762yfowuy.wl%dmaus@ictsoc.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============1465975866==" Return-path: Received: from [140.186.70.92] (port=59719 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtjnX-0007C8-PI for emacs-orgmode@gnu.org; Thu, 09 Sep 2010 12:16:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Otjaf-0002VE-7S for emacs-orgmode@gnu.org; Thu, 09 Sep 2010 12:03:10 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:33701) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Otjae-0002Uu-Un for emacs-orgmode@gnu.org; Thu, 09 Sep 2010 12:03:09 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Scot Becker Cc: David Maus , Org-mode ml --===============1465975866== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Sep__9_18:03:00_2010-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Thu_Sep__9_18:03:00_2010-1 Content-Type: multipart/mixed; boundary="Multipart_Thu_Sep__9_18:03:00_2010-1" --Multipart_Thu_Sep__9_18:03:00_2010-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Scot Becker wrote: >David, >Thanks for your response.=C2=A0 What a cool and useful patch. =C2=A0 This = adds all kinds of cool functionality to org-mode, and in a >single line! =C2=A0=C2=A0 I've had several times I wished I could do this = kind of thing.=C2=A0 >As it is, it doesn't automate my present case much, since I'd still have t= o put the macro expansion in after every >headline.=C2=A0 Not surprisingly it won't expand if you put the {{{propert= y(myproperty}}} code as part of a headline in >org-export-latex-classes.=C2=A0 I reckon I'll have to try to do a hacked-u= p 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=3D key "") (insert (format "\nReference: \\cite{%s}\n" key))))))) >Also, the patch doesn't seem to work with inherited properties.=C2=A0 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 --=20 OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --Multipart_Thu_Sep__9_18:03:00_2010-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="0001-Allow-selective-property-inheritance-in-property-mac.patch" Content-Transfer-Encoding: base64 RnJvbSAzN2FiZDM0MGIyM2QzNzMyOGMzNGJmNTI0ZjRjODBmN2IxY2U5YjBlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYXZpZCBNYXVzIDxkbWF1c0BpY3Rzb2MuZGU+CkRhdGU6IFRo dSwgOSBTZXAgMjAxMCAxNzo0Njo0MiArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIEFsbG93IHNlbGVj dGl2ZSBwcm9wZXJ0eSBpbmhlc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sep__9_18:03:00_2010-1-- --pgp-sign-Multipart_Thu_Sep__9_18:03:00_2010-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAkyJBTQACgkQma24O1pEeOZ4cQD/TTAeh/wqEyMDmnB8jt4PO5BH O3sbOYTL4Kn21n9okw4BAN2eUuMdd/oyeoPzX6vasEdjq6B+/YXsD7c4tUiuKw+E =Csw9 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Sep__9_18:03:00_2010-1-- --===============1465975866== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1465975866==--