From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: order of evaluation upon export: macros are evaluated too soon Date: Wed, 07 Jun 2017 16:47:20 +0100 Message-ID: <874lvriyuv.fsf@delle7240.chemeng.ucl.ac.uk> Reply-To: Eric S Fraga Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIdBc-0003Y5-5K for emacs-orgmode@gnu.org; Wed, 07 Jun 2017 11:47:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIdBX-0001Hc-8X for emacs-orgmode@gnu.org; Wed, 07 Jun 2017 11:47:56 -0400 Received: from mail-he1eur01on0138.outbound.protection.outlook.com ([104.47.0.138]:24674 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIdBW-0001Dk-R9 for emacs-orgmode@gnu.org; Wed, 07 Jun 2017 11:47:51 -0400 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" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello all, I have a document with this (ECM) structure: #+begin_src org ,#+macro: item I{{{n(i)}}}@@latex:}%@@ ,#+options: toc:nil num:nil ,* {{{item()}}} Some topic ,* {{{item()}}} Another topic :noexport: ,* {{{item()}}} A final one #+end_src I would like the exported headings to be numbered Q1, Q2, ... but only the exported ones. At the moment, the item macro is expanded on every occurrence in the file, regardless of export settings. So, if I export to ASCII, I get: : I1 Some topic : ============= : : : I3 A final one : ============== whereas I want I2 for the second heading. Example of use case: agenda of meeting where certain commonly appearing entries may be excluded; bank of questions for tutorials etc. with sub-selection; all kinds of enumerations with different tag selections; ... I used to do this with LaTeX counters but I thought I would use the new counter capability in org. Unfortunately, it doesn't do the job for me. Any suggestions please? thanks, eric -- : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.7-531-g530113 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSPXCedOQfhSlwpVw3IkZPY//z2fQUCWTggCAAKCRDIkZPY//z2 fTZcAKCAeP9qSQ1ZMJAglDwwqDz01AY3XQCfWZkxpFxYS2dlFUpu/DPFqlSfWWw= =I3bq -----END PGP SIGNATURE----- --=-=-=--