From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: denismaier@mailbox.org
Cc: 'mailing list for ConTeXt users' <ntg-context@ntg.nl>
Subject: [NTG-context] Re: \par and \startlines
Date: Wed, 1 May 2024 09:44:24 +0200 [thread overview]
Message-ID: <f0a8e34c-8d7a-c8ff-13e6-144b72a49e61@gmail.com> (raw)
In-Reply-To: <005a01da9af9$f3092d10$d91b8730$@mailbox.org>
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
___________________________________________________________________________________
next prev parent reply other threads:[~2024-05-01 7:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 13:33 [NTG-context] " 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 [this message]
2024-05-01 8:08 ` Henning Hraban Ramm
2024-04-27 7:24 ` Henning Hraban Ramm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f0a8e34c-8d7a-c8ff-13e6-144b72a49e61@gmail.com \
--to=wolfgang.schuster.lists@gmail.com \
--cc=denismaier@mailbox.org \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).