> On May 7, 2026, at 02:03, Christian Moe <[email protected]> wrote:
>
> Perry Smith <[email protected]> writes:
>> It appears that if the conditional text is itself a call to a macro, the
>> output gets confused. For example:
>>
>> #+MACRO: bold +$1+
>> #+MACRO: device1
>> {{{device1({{{bold(blah)}}})}}}
>>
>> results in the tailing )}}} being emitted.
>
> This is because you haven't defined the device1 macro. You need to add
> the argument.
>
> #+MACRO: device1 $1
>
> For conditional snippets that are separate paragraphs (or bigger), you
> can use drawers. Selecting which to include/exclude is straightforward.
>
> :DEVICE1:
> Text relevant to device 1.
> :END:
>
> :DEVICE2:
> Text relevant to device 2.
> :END:
>
> To export only the drawers for device 2, use
>
> #+OPTIONS: d:("DEVICE2”)
I didn’t know drawers could be made conditional. That helps in some areas.
Thank you!
The reason my original device1 didn’t use the argument is because of Iho’s
previous suggestion. While playing with macros, I discovered that if the
argument has a comma, the parser thinks there are two arguments which may not
be the intentions. It appears that the comma can be quoted with a backslash
but on my experimentation, that led to other frustrations. e.g. the bold
doesn’t come out bold in the HTML. Thus my question:
Can arguments to macros be enclosed in quotes of some style?
Thank you again