[NTG-context] Re: \par and \startlines

2024-05-01 Thread Henning Hraban Ramm

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
___


[NTG-context] Re: \par and \startlines

2024-05-01 Thread Wolfgang Schuster

denisma...@mailbox.org schrieb am 30.04.2024 um 14:28:

-Ursprüngliche Nachricht-
Von: Wolfgang Schuster 
Gesendet: Samstag, 27. April 2024 07:40
An: Denis Maier 
Cc: mailing list for ConTeXt users 
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]




The
lines
are
there!


The
lines
are
there!


The
lines
are
there!



\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
___


[NTG-context] Re: \par and \startlines

2024-04-30 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht-
> Von: Wolfgang Schuster 
> Gesendet: Samstag, 27. April 2024 07:40
> An: Denis Maier 
> Cc: mailing list for ConTeXt users 
> 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]
> 
> 
> 
> 
> The
> lines
> are
> there!
> 
> 
> The
> lines
> are
> there!
> 
> 
> The
> lines
> are
> there!
> 
> 
> 
> \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
___


[NTG-context] Re: \par and \startlines

2024-04-27 Thread Henning Hraban Ramm

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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Wolfgang Schuster

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]




The
lines
are
there!


The
lines
are
there!


The
lines
are
there!



\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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Henning Hraban Ramm

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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Pablo Rodriguez via ntg-context
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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Denis Maier via ntg-context


 
 
  
    
   
   
   
Wolfgang Schuster  hat am 26.04.2024 19:29 CEST geschrieben:

   
 

   
 
Denis Maier schrieb am 26.04.2024 um 19:18:



  
 
 
 
  Wolfgang Schuster  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  hat am 26.04.2024 17:25 CEST geschrieben:

   
 

   
 

   
On 4/26/24 15:33, denis.ma...@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
   
  
    
   
  
   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?
   
  
    
   
  
   Thank you so much for your help.
   
  
   Best,
   
  
   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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Wolfgang Schuster

Denis Maier schrieb am 26.04.2024 um 19:18:
Wolfgang Schuster  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 > hat am 26.04.2024 17:25 CEST geschrieben:
On 4/26/24 15:33, denis.ma...@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

___
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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Denis Maier via ntg-context


 
 
  
    
   
   
   
Wolfgang Schuster  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  hat am 26.04.2024 17:25 CEST geschrieben:
  
 
   
  
 
   
  
 
  On 4/26/24 15:33, denis.ma...@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?
   
  
    
   
  
   Best,
   
  
   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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Wolfgang Schuster

Denis Maier via ntg-context schrieb am 26.04.2024 um 18:10:
Pablo Rodriguez via ntg-context > hat am 26.04.2024 17:25 CEST geschrieben:
On 4/26/24 15:33, denis.ma...@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

___
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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Denis Maier via ntg-context


 
 
  
    
   
   
   
Pablo Rodriguez via ntg-context  hat am 26.04.2024 17:25 CEST geschrieben:

   
 

   
 

   
On 4/26/24 15:33, denis.ma...@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.
   
  
    
   
  
   Thanks,
   
  
   Denis
   
   
   
 

   
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

   
___

  
 

___
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
___


[NTG-context] Re: \par and \startlines

2024-04-26 Thread Pablo Rodriguez via ntg-context
On 4/26/24 15:33, denis.ma...@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
___