Difference between revisions of "Command/ startlines"
< Command
Jump to navigation
Jump to search
(Created page with "Documentation for \start<i>lines</i> ... \stop<i>lines</i>") |
(example with indented continuation lines in poems) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
<cd:commandgroup generated="yes" name="lines" type="environment" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807"> | <cd:commandgroup generated="yes" name="lines" type="environment" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807"> | ||
− | <cd:shortdesc> | + | <cd:shortdesc><!-- a short command summary goes here --> |
− | <!-- a short command summary goes here --> | + | The instances of <tt>\start<i>lines</i> ... \stop<i>lines</i></tt> are used for typsetting text with preformatted line breaks. |
− | The instances of <tt>\start<i>lines</i> ... \stop<i>lines</i></tt> are used for | ||
</cd:shortdesc> | </cd:shortdesc> | ||
<cd:sequence> | <cd:sequence> | ||
Line 22: | Line 19: | ||
</cd:command> | </cd:command> | ||
</cd:variants> | </cd:variants> | ||
− | <cd:description> | + | <cd:description>This allows the printing of text according to existing linebreaks within the text. The command itself takes no setups, but you can use {{cmd|setuplines}} to indicate that you wish to preserve whitespace, or make it visible, as well as some other tricks; and if you find yourself using the same few setups throughout the document, you can make special-purpose environments using {{cmd|definelines}}. |
− | |||
</cd:description> | </cd:description> | ||
− | <cd:examples> | + | <cd:examples><cd:example title=""><context source="yes"> |
− | + | \startlines | |
− | <cd:example title=""> | + | The |
− | </ | + | lines |
− | + | are | |
− | </cd: | + | there! |
− | <cd: | + | \stoplines |
− | < | + | </context> |
− | <cd: | + | |
− | </cd: | + | </cd:example><cd:example title="">For poems with longer lines you can use positive and negative values. Long lines will break and indent to indicate that the new line the continuation of the line before. |
− | + | ||
− | </cd:notes> | + | <context source="yes"> |
+ | \setuplines | ||
+ | [before={\blank\startnarrow[default=left,left=1cm]}, | ||
+ | after={\stopnarrow\blank}, | ||
+ | indenting={yes,-1cm}] | ||
+ | |||
+ | \showframe[text][text] | ||
+ | |||
+ | \starttext | ||
+ | |||
+ | \startlines | ||
+ | She made that year the most terrible one for mortals, all over the Earth, the nurturer of many. | ||
+ | It was so terrible, it makes you think of the Hound of Hadês. The Earth did not send up | ||
+ | any seed. Demeter, she with the beautiful garlands in her hair, kept them covered underground. | ||
+ | Many a curved plough was dragged along the fields by many an ox—all in vain. | ||
+ | Many a bright grain of wheat fell into the earth—all for naught. | ||
+ | \stoplines | ||
+ | |||
+ | \stoptext | ||
+ | </context></cd:example></cd:examples> | ||
+ | <cd:notes></cd:notes> | ||
<cd:seealso> | <cd:seealso> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<cd:commandref name="definelines" originator="system"></cd:commandref> | <cd:commandref name="definelines" originator="system"></cd:commandref> | ||
<cd:commandref name="setuplines" originator="system"></cd:commandref> | <cd:commandref name="setuplines" originator="system"></cd:commandref> | ||
− | <cd:source file="spac-lin.mkiv" originator="system"></cd:source> | + | <cd:source file="spac-lin.mkiv" originator="system"></cd:source> |
− | <cd:wikipage originator="system" page="Category:Structure"></cd:wikipage> | + | <cd:wikipage originator="system" page="Category:Structure"></cd:wikipage></cd:seealso> |
− | </cd:seealso> | ||
</cd:commandgroup> | </cd:commandgroup> |
Latest revision as of 09:16, 27 December 2021
Contents
\startlines ... \stoplines
Summary
The instances of \startlines ... \stoplines are used for typsetting text with preformatted line breaks.
Instances
\startlines ... \stoplines |
Settings instance
Description
This allows the printing of text according to existing linebreaks within the text. The command itself takes no setups, but you can use \setuplines to indicate that you wish to preserve whitespace, or make it visible, as well as some other tricks; and if you find yourself using the same few setups throughout the document, you can make special-purpose environments using \definelines.
Examples
Example 1
\startlines The lines are there! \stoplines
Example 2
For poems with longer lines you can use positive and negative values. Long lines will break and indent to indicate that the new line the continuation of the line before.
\setuplines [before={\blank\startnarrow[default=left,left=1cm]}, after={\stopnarrow\blank}, indenting={yes,-1cm}] \showframe[text][text] \starttext \startlines She made that year the most terrible one for mortals, all over the Earth, the nurturer of many. It was so terrible, it makes you think of the Hound of Hadês. The Earth did not send up any seed. Demeter, she with the beautiful garlands in her hair, kept them covered underground. Many a curved plough was dragged along the fields by many an ox—all in vain. Many a bright grain of wheat fell into the earth—all for naught. \stoplines \stoptext