ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
	juh via ntg-context <ntg-context@ntg.nl>
Cc: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Subject: Re: startlines with long lines that break and indent
Date: Sun, 26 Dec 2021 22:20:16 +0100	[thread overview]
Message-ID: <3bd2c99f-8064-4533-8d6d-56771ba97e07@gmail.com> (raw)
In-Reply-To: <c8390fc58f24bcef62bfec8de4bc812bd3d2d970.camel@mailbox.org>

juh via ntg-context schrieb am 26.12.2021 um 17:36:
> 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.


Short version:

\setuplines
   [   before={\blank\startnarrow[default=left,left=1cm]},
        after={\stopnarrow\blank},
    indenting={yes,-1cm}]

\showframe[text][text]

\starttext

before

\startlines
text \dorecurse{10}{ text}
text \dorecurse{40}{ text}
text \dorecurse{10}{ text}
\stoplines

after

\stoptext


Long version:

\definemeasure[Indentation][1cm]

\definenarrower
   [LinesIndentation]
   [ before=\blank,
      after=\blank,
    default=left,
       left=\measure{Indentation}]

\definelines
   [Poem]
   [   before=\startLinesIndentation,
        after=\stopLinesIndentation,
    indenting={yes,-\measure{Indentation}}]

\showframe[text][text]

\starttext

before

\startPoem
text \dorecurse{10}{ text}
text \dorecurse{40}{ text}
text \dorecurse{10}{ text}
\stopPoem

after

\stoptext


Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________

  parent reply	other threads:[~2021-12-26 21:20 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
2021-12-26 21:20 ` Wolfgang Schuster via ntg-context [this message]
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=3bd2c99f-8064-4533-8d6d-56771ba97e07@gmail.com \
    --to=ntg-context@ntg.nl \
    --cc=wolfgang.schuster.lists@gmail.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).