ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Rik Kabel via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Rik Kabel <ConTeXt@rik.users.panix.com>
Subject: Re: startlines with long lines that break and indent
Date: Sun, 26 Dec 2021 16:11:52 -0500	[thread overview]
Message-ID: <5d7c2546-d86c-35cf-bad0-34b64c6b4030@rik.users.panix.com> (raw)
In-Reply-To: <c8390fc58f24bcef62bfec8de4bc812bd3d2d970.camel@mailbox.org>


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


On 2021-12-26 11:36, juh via ntg-context wrote:
> Hi all,
>
> I am looking for a way to make startstoplines likes this:
>
>
> This is a long line
>      that breaks,
> the second line,
> the third line.
>
> So if a line in the poem is too long it shall break and indent.
>
> TIA
> juh

You can play with something based on the following, which I made it 
following suggestions from others. There may well be other ways, but 
this works for me.

    \define\Poemindent{3em}
    \define\Poeminset{14em}
    \definedelimitedtext[Poe]
    \setupwhitespace[medium]
    \showframe

    \startbuffer[Poem]
       This is a long line that breaks,
       the second line,
       the third line.

       The second stanza starts.
    \stopbuffer

    \setupdelimitedtext[Poe][
       rightmargin=\Poeminset,
       leftmargin={\dimexpr\Poemindent+\Poeminset\relax},
           before={\setuplines[
                        before=,
                     inbetween={\blank[small]},
                         after=,
                    ]
                   \startlines
                   \setupindenting[-\Poemindent,yes]
                   \startparagraph},
            after=\stopparagraph
                  \stoplines,
      ]

    \starttext

    \startparagraph

      Here comes a poem – watch the lines break!

    \stopparagraph

         \startPoe
           \inlinebuffer[Poem]
         \stopPoe

    \startparagraph

      Now, it is gone. Good-bye.

    \stopparagraph

    \stoptext

-- 
Rik

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

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

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-12-26 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-26 16:36 juh via ntg-context
2021-12-26 21:11 ` Rik Kabel via ntg-context [this message]
2021-12-26 21:20 ` Wolfgang Schuster via ntg-context
2021-12-27  9:14   ` juh via ntg-context

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=5d7c2546-d86c-35cf-bad0-34b64c6b4030@rik.users.panix.com \
    --to=ntg-context@ntg.nl \
    --cc=ConTeXt@rik.users.panix.com \
    /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).