emacs-orgmode
[Top][All Lists]
Advanced

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

[O] order of evaluation upon export: macros are evaluated too soon


From: Eric S Fraga
Subject: [O] order of evaluation upon export: macros are evaluated too soon
Date: Wed, 07 Jun 2017 16:47:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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