Re: [NTG-context] How to check if buffer or block has content

2021-08-03 Thread Benjamin Buchmuller via ntg-context
Wow, that's powerful! I'll add the wiki entries later tonight. Thanks a lot! > On Aug 3, 2021, at 17:02, Hans Hagen wrote: > > On 8/2/2021 8:54 PM, Benjamin Buchmuller via ntg-context wrote: >> That's great, I wikified a Note for testing if a buffer exists or has >> content (using the

Re: [NTG-context] How to check if buffer or block has content

2021-08-03 Thread Hans Hagen via ntg-context
On 8/2/2021 8:54 PM, Benjamin Buchmuller via ntg-context wrote: That's great, I wikified a Note for testing if a buffer exists or has content (using the \getbuffer[…] approach for the moment). If I was asked, I'd opt for \doifelseemptybuffer (doifemptyelse?) since one could think of similar

Re: [NTG-context] How to check if buffer or block has content

2021-08-03 Thread Hans Hagen via ntg-context
On 8/2/2021 8:54 PM, Benjamin Buchmuller via ntg-context wrote: That's great, I wikified a Note for testing if a buffer exists or has content (using the \getbuffer[…] approach for the moment). If I was asked, I'd opt for \doifelseemptybuffer (doifemptyelse?) since one could think of similar

Re: [NTG-context] How to check if buffer or block has content

2021-08-03 Thread Hans Hagen via ntg-context
On 8/2/2021 6:31 PM, Wolfgang Schuster via ntg-context wrote: \doifelsebufferempty i go for that one (mkiv and lmtx0 ; btw, \doifelsebuffer is expandable but the empty test not) Hans -

Re: [NTG-context] How to check if buffer or block has content

2021-08-02 Thread Benjamin Buchmuller via ntg-context
That's great, I wikified a Note for testing if a buffer exists or has content (using the \getbuffer[…] approach for the moment). If I was asked, I'd opt for \doifelseemptybuffer (doifemptyelse?) since one could think of similar commands that test for empty "objects". Is there an option for

Re: [NTG-context] How to check if buffer or block has content

2021-08-02 Thread Wolfgang Schuster via ntg-context
Hans Hagen via ntg-context schrieb am 02.08.2021 um 17:17: On 8/2/2021 4:43 PM, Aditya Mahajan via ntg-context wrote: On Mon, 2 Aug 2021, Benjamin Buchmuller via ntg-context wrote: Hi, How can I check if a buffer or block has content (or is empty) before a \useblocks or \getbuffer

Re: [NTG-context] How to check if buffer or block has content

2021-08-02 Thread Wolfgang Schuster via ntg-context
Hans van der Meer via ntg-context schrieb am 02.08.2021 um 18:21: And in pathological cases where even this does not work (as I encountered a few days ago): \setbox\scratchbox=\vboxx{content}\ifdim\wd\scratchbox>\zeropoint .. \else .. \fi This is how \doiftext works but it uses a \hbox.

Re: [NTG-context] How to check if buffer or block has content

2021-08-02 Thread Hans van der Meer via ntg-context
And in pathological cases where even this does not work (as I encountered a few days ago): \setbox\scratchbox=\vboxx{content}\ifdim\wd\scratchbox>\zeropoint .. \else .. \fi dr. Hans van der Meer > On 2 Aug 2021, at 17:17, Hans Hagen via ntg-context > wrote: > > On 8/2/2021 4:43 PM, Aditya

Re: [NTG-context] How to check if buffer or block has content

2021-08-02 Thread Hans Hagen via ntg-context
On 8/2/2021 4:43 PM, Aditya Mahajan via ntg-context wrote: On Mon, 2 Aug 2021, Benjamin Buchmuller via ntg-context wrote: Hi, How can I check if a buffer or block has content (or is empty) before a \useblocks or \getbuffer statement? I would like to typeset a headline only if the

Re: [NTG-context] How to check if buffer or block has content

2021-08-02 Thread Aditya Mahajan via ntg-context
On Mon, 2 Aug 2021, Benjamin Buchmuller via ntg-context wrote: > Hi, > > How can I check if a buffer or block has content (or is empty) before a > \useblocks or \getbuffer statement? > > I would like to typeset a headline only if the buffer/block has been used in > a particular section and

[NTG-context] How to check if buffer or block has content

2021-08-02 Thread Benjamin Buchmuller via ntg-context
Hi, How can I check if a buffer or block has content (or is empty) before a \useblocks or \getbuffer statement? I would like to typeset a headline only if the buffer/block has been used in a particular section and want to avoid headlines with empty sections. Thanks! Benjamin