ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] \par and \startlines
@ 2024-04-26 13:33 denis.maier
  2024-04-26 15:25 ` [NTG-context] " Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 14+ messages in thread
From: denis.maier @ 2024-04-26 13:33 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1786 bytes --]

Hi,

I'm trying to typeset a poem from XML, but I can't figure out how to make the inbetween key working here.
As the source is XML, I cannot just add an empty line to start a new group of lines inside \startlines...\stoplines. I guess, there must be a command to do that, but \par seems to have no effect here.
How can this be done?

Best,
Denis

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setuplines[before={\blank},after={\blank},inbetween={ARE WE INBETWEEN?\blank}]

% XML Nodes auswählen
\startxmlsetups xml:test
                \xmlsetsetup{#1}{*}{-}
                \xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:doc
                \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:poem
                \startlines
                               \xmlflush{#1}
                \stoplines
\stopxmlsetups

\startxmlsetups xml:stanza
   \xmlflushlinewise{#1}\par %this has no effect
\stopxmlsetups

\startxmlsetups xml:line
                \xmlflush{#1}
\stopxmlsetups

\startbuffer[test]
<?xml version='1.0' standalone='yes?>
<doc>
<poem>
<stanza>
<line>The</line>
<line>lines</line>
<line>are</line>
<line>there!</line>
</stanza>
<stanza>
<line>The</line>
<line>lines</line>
<line>are</line>
<line>there!</line>
</stanza>
</poem>
</doc>
\stopbuffer


\starttext

This works:

\startlines
The
lines
are
there!

The
lines
are
there!
\stoplines

Apparently, \type{\par} has no effect here:

\startlines
The
lines
are
there!\par% \par has no effect here
The
lines
are
there!
\stoplines

For background, this is what I'm actually trying to do:

\xmlprocessbuffer{test}{test}{}

\stoptext
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


[-- Attachment #1.2: Type: text/html, Size: 7478 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 13:33 [NTG-context] \par and \startlines denis.maier
@ 2024-04-26 15:25 ` Pablo Rodriguez via ntg-context
  2024-04-26 16:10   ` Denis Maier via ntg-context
  0 siblings, 1 reply; 14+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2024-04-26 15:25 UTC (permalink / raw)
  To: ntg-context; +Cc: Pablo Rodriguez

On 4/26/24 15:33, denis.maier@unibe.ch wrote:
> Hi,
>
> I’m trying to typeset a poem from XML, but I can’t figure out how to
> make the inbetween key working here.
>
> As the source is XML, I cannot just add an empty line to start a new
> group of lines inside \startlines…\stoplines. I guess, there must be a
> command to do that, but \par seems to have no effect here.
>
> How can this be done?

Hi Denis,

I must confess I don’t get which is your actual question.

\blank works here and you know that (since you included it in your code).

MkIV with \par works in your sample and LMTX with \par doesn’t.

I wonder whether this might be a bug in LMTX.

Just in case it might help,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 15:25 ` [NTG-context] " Pablo Rodriguez via ntg-context
@ 2024-04-26 16:10   ` Denis Maier via ntg-context
  2024-04-26 16:24     ` Wolfgang Schuster
  0 siblings, 1 reply; 14+ messages in thread
From: Denis Maier via ntg-context @ 2024-04-26 16:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Denis Maier

[-- Attachment #1: Type: text/html, Size: 3777 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 16:10   ` Denis Maier via ntg-context
@ 2024-04-26 16:24     ` Wolfgang Schuster
  2024-04-26 17:18       ` Denis Maier via ntg-context
  2024-04-27  7:24       ` Henning Hraban Ramm
  0 siblings, 2 replies; 14+ messages in thread
From: Wolfgang Schuster @ 2024-04-26 16:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Denis Maier via ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1578 bytes --]

Denis Maier via ntg-context schrieb am 26.04.2024 um 18:10:
>> Pablo Rodriguez via ntg-context <ntg-context@ntg.nl 
>> <mailto:ntg-context@ntg.nl>> hat am 26.04.2024 17:25 CEST geschrieben:
>> On 4/26/24 15:33, denis.maier@unibe.ch <mailto:denis.maier@unibe.ch> 
>> wrote:
>>> Hi, 
>>> I’m trying to typeset a poem from XML, but I can’t figure out how to
>>> make the inbetween key working here. 
>>> As the source is XML, I cannot just add an empty line to start a new
>>> group of lines inside \startlines…\stoplines. I guess, there must be a
>>> command to do that, but \par seems to have no effect here. 
>>> How can this be done? 
>> Hi Denis,
>> I must confess I don’t get which is your actual question.
>> \blank works here and you know that (since you included it in your 
>> code).
>> MkIV with \par works in your sample and LMTX with \par doesn’t.
>> I wonder whether this might be a bug in LMTX.
>> Just in case it might help, 
> Thanks for your answer and sorry for not being clearer. I was just 
> wondering why the \par seems to have no effect. (I first guessed that 
> it might be related to XML, to but then realized it happens with 
> context markup as well. Usually, you won't run into this because an 
> empty line works, but with XML that's not am option.) As you've said, 
> it looks like a bug then.
>

The lines environment treats each line of the input as paragraph by 
adding \par at the end of it and adding another \par makes no difference 
here.

BTW: ConTeXt has a module for poems which can be loaded with 
\usemodule[format].

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 2804 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 16:24     ` Wolfgang Schuster
@ 2024-04-26 17:18       ` Denis Maier via ntg-context
  2024-04-26 17:29         ` Wolfgang Schuster
  2024-04-27  7:24       ` Henning Hraban Ramm
  1 sibling, 1 reply; 14+ messages in thread
From: Denis Maier via ntg-context @ 2024-04-26 17:18 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users; +Cc: Denis Maier

[-- Attachment #1: Type: text/html, Size: 3799 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 17:18       ` Denis Maier via ntg-context
@ 2024-04-26 17:29         ` Wolfgang Schuster
  2024-04-26 17:52           ` Denis Maier via ntg-context
  0 siblings, 1 reply; 14+ messages in thread
From: Wolfgang Schuster @ 2024-04-26 17:29 UTC (permalink / raw)
  To: Denis Maier; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2346 bytes --]

Denis Maier schrieb am 26.04.2024 um 19:18:
>> Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> hat am 
>> 26.04.2024 18:24 CEST geschrieben:
>> Denis Maier via ntg-context schrieb am 26.04.2024 um 18:10:
>>>> Pablo Rodriguez via ntg-context <ntg-context@ntg.nl 
>>>> <mailto:ntg-context@ntg.nl>> hat am 26.04.2024 17:25 CEST geschrieben:
>>>> On 4/26/24 15:33, denis.maier@unibe.ch 
>>>> <mailto:denis.maier@unibe.ch> wrote:
>>>>> Hi, 
>>>>> I’m trying to typeset a poem from XML, but I can’t figure out how to
>>>>> make the inbetween key working here. 
>>>>> As the source is XML, I cannot just add an empty line to start a new
>>>>> group of lines inside \startlines…\stoplines. I guess, there must 
>>>>> be a
>>>>> command to do that, but \par seems to have no effect here. 
>>>>> How can this be done? 
>>>> Hi Denis,
>>>> I must confess I don’t get which is your actual question.
>>>> \blank works here and you know that (since you included it in your 
>>>> code).
>>>> MkIV with \par works in your sample and LMTX with \par doesn’t.
>>>> I wonder whether this might be a bug in LMTX.
>>>> Just in case it might help, 
>>> Thanks for your answer and sorry for not being clearer. I was just 
>>> wondering why the \par seems to have no effect. (I first guessed 
>>> that it might be related to XML, to but then realized it happens 
>>> with context markup as well. Usually, you won't run into this 
>>> because an empty line works, but with XML that's not am option.) As 
>>> you've said, it looks like a bug then. 
>>
>> The lines environment treats each line of the input as paragraph by 
>> adding \par at the end of it and adding another \par makes no 
>> difference here.
>>
>> BTW: ConTeXt has a module for poems which can be loaded with 
>> \usemodule[format].
>>
>> Wolfgang
>>
> Ok. I'll have a look at this module. Just two questions:
> 1. so did this behavior change?
> 2. What is inbetween referring to then? If each line is a paragraph, 
> what's this group of paragraphs then? Can you manually switch to the 
> next one?

The inbetween setting works because ConTeXt checks at the start of each 
line whether it's empty (in this case the value is used) or not.

When you add a \par you just end the current line/paragraph and it 
doesn't matter how many \par's you use because TeX just ignores them.

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 4129 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 17:29         ` Wolfgang Schuster
@ 2024-04-26 17:52           ` Denis Maier via ntg-context
  2024-04-26 19:09             ` Pablo Rodriguez via ntg-context
                               ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Denis Maier via ntg-context @ 2024-04-26 17:52 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users, Denis Maier

[-- Attachment #1: Type: text/html, Size: 5165 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 17:52           ` Denis Maier via ntg-context
@ 2024-04-26 19:09             ` Pablo Rodriguez via ntg-context
  2024-04-26 20:29             ` Henning Hraban Ramm
  2024-04-27  5:39             ` Wolfgang Schuster
  2 siblings, 0 replies; 14+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2024-04-26 19:09 UTC (permalink / raw)
  To: Denis Maier via ntg-context; +Cc: Pablo Rodriguez

On 4/26/24 19:52, Denis Maier via ntg-context wrote:
>> Wolfgang Schuster hat am 26.04.2024 19:29 CEST geschrieben:
>> The inbetween setting works because ConTeXt checks at the start of
>> each line whether it's empty (in this case the value is used) or not.
>>
>> When you add a \par you just end the current line/paragraph and it
>> doesn't matter how many \par's you use because TeX just ignores them.
>  
> I see. But there's no command that could be used to simulate an empty line?

Crappy code:

  \starttext
  a\dorecurse{25}{\par}b
  a\dorecurse{25}{\null\par}b
  \stoptext

Just to show it could be achieved,

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 17:52           ` Denis Maier via ntg-context
  2024-04-26 19:09             ` Pablo Rodriguez via ntg-context
@ 2024-04-26 20:29             ` Henning Hraban Ramm
  2024-04-27  5:39             ` Wolfgang Schuster
  2 siblings, 0 replies; 14+ messages in thread
From: Henning Hraban Ramm @ 2024-04-26 20:29 UTC (permalink / raw)
  To: ntg-context

Am 26.04.24 um 19:52 schrieb Denis Maier via ntg-context:
> I see. But there's no command that could be used to simulate an empty line?

Did you try \vskip{…}?

Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 17:52           ` Denis Maier via ntg-context
  2024-04-26 19:09             ` Pablo Rodriguez via ntg-context
  2024-04-26 20:29             ` Henning Hraban Ramm
@ 2024-04-27  5:39             ` Wolfgang Schuster
  2024-04-30 12:28               ` Denis Maier via ntg-context
  2 siblings, 1 reply; 14+ messages in thread
From: Wolfgang Schuster @ 2024-04-27  5:39 UTC (permalink / raw)
  To: Denis Maier; +Cc: mailing list for ConTeXt users

Denis Maier schrieb am 26.04.2024 um 19:52:

> I see. But there's no command that could be used to simulate an empty line?
> If not, me should I perhaps try to replicate the wrapper structure from 
> the XML source in context? (I'll also look into the format module of 
> course.) What do you think?

Below is a different solution to your problem with works without 
\startlines because you already mark up each individual line in the poem 
which make it possible to add a linebreak in the output.

With \blank options (samepage) you can avoid pagebreaks between stanzas.

\startxmlsetups xml:test
     \xmlsetsetup{#1}{*}{-}
     \xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

\startxmlsetups xml:doc
     \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:poem
     \blank[line]
     \xmlflush{#1}
     \blank[back,line]
\stopxmlsetups

\startxmlsetups xml:stanza
    \xmlflush{#1}\blank[preference,line]
\stopxmlsetups

\startxmlsetups xml:line
     \xmlflush{#1}\blank[samepage,none]
\stopxmlsetups

\startbuffer[test]
<?xml version='1.0' standalone='yes?>
<doc>
<poem>
<stanza>
<line>The</line>
<line>lines</line>
<line>are</line>
<line>there!</line>
</stanza>
<stanza>
<line>The</line>
<line>lines</line>
<line>are</line>
<line>there!</line>
</stanza>
<stanza>
<line>The</line>
<line>lines</line>
<line>are</line>
<line>there!</line>
</stanza>
</poem>
</doc>
\stopbuffer

\starttext

\samplefile{lorem}

\xmlprocessbuffer{test}{test}{}

\samplefile{lorem}

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-26 16:24     ` Wolfgang Schuster
  2024-04-26 17:18       ` Denis Maier via ntg-context
@ 2024-04-27  7:24       ` Henning Hraban Ramm
  1 sibling, 0 replies; 14+ messages in thread
From: Henning Hraban Ramm @ 2024-04-27  7:24 UTC (permalink / raw)
  To: ntg-context

Am 26.04.24 um 18:24 schrieb Wolfgang Schuster:
> BTW: ConTeXt has a module for poems which can be loaded with 
> \usemodule[format].

Never heard of it. Version says “ancient” ;)

https://source.contextgarden.net/tex/context/modules/mkiv/m-format.mkiv

What’s the advantage of all this markup over simple "lines" (or even 
\par after each line)?

I’ll need to typeset a book of poetry soon, that will probably need a 
lot of different indentation/aligments…

Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-27  5:39             ` Wolfgang Schuster
@ 2024-04-30 12:28               ` Denis Maier via ntg-context
  2024-05-01  7:44                 ` Wolfgang Schuster
  0 siblings, 1 reply; 14+ messages in thread
From: Denis Maier via ntg-context @ 2024-04-30 12:28 UTC (permalink / raw)
  To: 'Wolfgang Schuster'
  Cc: 'mailing list for ConTeXt users', denismaier

> -----Ursprüngliche Nachricht-----
> Von: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
> Gesendet: Samstag, 27. April 2024 07:40
> An: Denis Maier <denismaier@mailbox.org>
> Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
> Betreff: Re: [NTG-context] Re: \par and \startlines
> 
> Denis Maier schrieb am 26.04.2024 um 19:52:
> 
> > I see. But there's no command that could be used to simulate an empty line?
> > If not, me should I perhaps try to replicate the wrapper structure
> > from the XML source in context? (I'll also look into the format module
> > of
> > course.) What do you think?
> 
> Below is a different solution to your problem with works without \startlines
> because you already mark up each individual line in the poem which make it
> possible to add a linebreak in the output.
> 
> With \blank options (samepage) you can avoid pagebreaks between stanzas.
> 
> \startxmlsetups xml:test
>      \xmlsetsetup{#1}{*}{-}
>      \xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
> \stopxmlsetups
> 
> \xmlregistersetup{xml:test}
> 
> \startxmlsetups xml:doc
>      \xmlflush{#1}
> \stopxmlsetups
> 
> \startxmlsetups xml:poem
>      \blank[line]
>      \xmlflush{#1}
>      \blank[back,line]
> \stopxmlsetups
> 
> \startxmlsetups xml:stanza
>     \xmlflush{#1}\blank[preference,line]
> \stopxmlsetups
> 
> \startxmlsetups xml:line
>      \xmlflush{#1}\blank[samepage,none]
> \stopxmlsetups
> 
> \startbuffer[test]
> <?xml version='1.0' standalone='yes?>
> <doc>
> <poem>
> <stanza>
> <line>The</line>
> <line>lines</line>
> <line>are</line>
> <line>there!</line>
> </stanza>
> <stanza>
> <line>The</line>
> <line>lines</line>
> <line>are</line>
> <line>there!</line>
> </stanza>
> <stanza>
> <line>The</line>
> <line>lines</line>
> <line>are</line>
> <line>there!</line>
> </stanza>
> </poem>
> </doc>
> \stopbuffer
> 
> \starttext
> 
> \samplefile{lorem}
> 
> \xmlprocessbuffer{test}{test}{}
> 
> \samplefile{lorem}
> 
> \stoptext

Thanks for this solution. I've had a quick look, and it seems to do exactly what I need. My requirements are rather simple at the moment, but that should be sufficient, but to repeat Hraban's question: What would be the advantage of using the format module? 

Thanks again for your help,
Denis


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-04-30 12:28               ` Denis Maier via ntg-context
@ 2024-05-01  7:44                 ` Wolfgang Schuster
  2024-05-01  8:08                   ` Henning Hraban Ramm
  0 siblings, 1 reply; 14+ messages in thread
From: Wolfgang Schuster @ 2024-05-01  7:44 UTC (permalink / raw)
  To: denismaier; +Cc: 'mailing list for ConTeXt users'

denismaier@mailbox.org schrieb am 30.04.2024 um 14:28:
>> -----Ursprüngliche Nachricht-----
>> Von: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
>> Gesendet: Samstag, 27. April 2024 07:40
>> An: Denis Maier <denismaier@mailbox.org>
>> Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
>> Betreff: Re: [NTG-context] Re: \par and \startlines
>>
>> Denis Maier schrieb am 26.04.2024 um 19:52:
>>
>>> I see. But there's no command that could be used to simulate an empty line?
>>> If not, me should I perhaps try to replicate the wrapper structure
>>> from the XML source in context? (I'll also look into the format module
>>> of
>>> course.) What do you think?
>> Below is a different solution to your problem with works without \startlines
>> because you already mark up each individual line in the poem which make it
>> possible to add a linebreak in the output.
>>
>> With \blank options (samepage) you can avoid pagebreaks between stanzas.
>>
>> \startxmlsetups xml:test
>>       \xmlsetsetup{#1}{*}{-}
>>       \xmlsetsetup{#1}{doc|poem|stanza|line}{xml:*}
>> \stopxmlsetups
>>
>> \xmlregistersetup{xml:test}
>>
>> \startxmlsetups xml:doc
>>       \xmlflush{#1}
>> \stopxmlsetups
>>
>> \startxmlsetups xml:poem
>>       \blank[line]
>>       \xmlflush{#1}
>>       \blank[back,line]
>> \stopxmlsetups
>>
>> \startxmlsetups xml:stanza
>>      \xmlflush{#1}\blank[preference,line]
>> \stopxmlsetups
>>
>> \startxmlsetups xml:line
>>       \xmlflush{#1}\blank[samepage,none]
>> \stopxmlsetups
>>
>> \startbuffer[test]
>> <?xml version='1.0' standalone='yes?>
>> <doc>
>> <poem>
>> <stanza>
>> <line>The</line>
>> <line>lines</line>
>> <line>are</line>
>> <line>there!</line>
>> </stanza>
>> <stanza>
>> <line>The</line>
>> <line>lines</line>
>> <line>are</line>
>> <line>there!</line>
>> </stanza>
>> <stanza>
>> <line>The</line>
>> <line>lines</line>
>> <line>are</line>
>> <line>there!</line>
>> </stanza>
>> </poem>
>> </doc>
>> \stopbuffer
>>
>> \starttext
>>
>> \samplefile{lorem}
>>
>> \xmlprocessbuffer{test}{test}{}
>>
>> \samplefile{lorem}
>>
>> \stoptext
> Thanks for this solution. I've had a quick look, and it seems to do exactly what I need. My requirements are rather simple at the moment, but that should be sufficient, but to repeat Hraban's question: What would be the advantage of using the format module?

The module provides features like

     - alignment of the verse lines
     - numbering of the lines (which isn't supported by \startlines 
unless you add the normal linenumbering mechanism)
     - support for lines which don't fit on a single page where the 
consecutive lines are indented

but the module is outdated and relies on an old mkii style code base.

A big difference between the \startlines environment and the format 
module is that the first treats
each line in the input file as a separate line in the output while the 
format module requires begin/end
tags for each line which works better for xml input.

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [NTG-context] Re: \par and \startlines
  2024-05-01  7:44                 ` Wolfgang Schuster
@ 2024-05-01  8:08                   ` Henning Hraban Ramm
  0 siblings, 0 replies; 14+ messages in thread
From: Henning Hraban Ramm @ 2024-05-01  8:08 UTC (permalink / raw)
  To: ntg-context

Am 01.05.24 um 09:44 schrieb Wolfgang Schuster:
>> but that should be sufficient, but to repeat Hraban's question: What 
>> would be the advantage of using the format module?
> 
> The module provides features like
> 
>      - alignment of the verse lines
>      - numbering of the lines (which isn't supported by \startlines 
> unless you add the normal linenumbering mechanism)
>      - support for lines which don't fit on a single page where the 
> consecutive lines are indented
> 
> but the module is outdated and relies on an old mkii style code base.
> 
> A big difference between the \startlines environment and the format 
> module is that the first treats
> each line in the input file as a separate line in the output while the 
> format module requires begin/end
> tags for each line which works better for xml input.

Thank you! Doesn’t sound like I should use it…

Hraban

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-05-01  8:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 13:33 [NTG-context] \par and \startlines denis.maier
2024-04-26 15:25 ` [NTG-context] " Pablo Rodriguez via ntg-context
2024-04-26 16:10   ` Denis Maier via ntg-context
2024-04-26 16:24     ` Wolfgang Schuster
2024-04-26 17:18       ` Denis Maier via ntg-context
2024-04-26 17:29         ` Wolfgang Schuster
2024-04-26 17:52           ` Denis Maier via ntg-context
2024-04-26 19:09             ` Pablo Rodriguez via ntg-context
2024-04-26 20:29             ` Henning Hraban Ramm
2024-04-27  5:39             ` Wolfgang Schuster
2024-04-30 12:28               ` Denis Maier via ntg-context
2024-05-01  7:44                 ` Wolfgang Schuster
2024-05-01  8:08                   ` Henning Hraban Ramm
2024-04-27  7:24       ` Henning Hraban Ramm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).