Difference between revisions of "Command/ startlines"

From Wiki
Jump to navigation Jump to search
(example with indented continuation lines in poems)
 
Line 1: Line 1:
<?xml version='1.0'?>
 
<!-- this file was generated on 2020-08-20T09:05 -->
 
 
<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 typsetting text with preformatted line breaks.
 
</cd:shortdesc>
 
</cd:shortdesc>
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}}.
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">
 
 
<cd:example title="">
 
<context source="yes">
 
 
\startlines
 
\startlines
 
The
 
The
Line 37: Line 30:
 
</context>
 
</context>
  
</cd:example>
+
</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.
 +
 
 +
<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
  
</cd:examples>
+
\stoptext
<cd:notes>
+
</context></cd:example></cd:examples>
<!--  this is for special remarks that do not fit elsewhere, like discovered bugs in specific context versions
+
<cd:notes></cd:notes>
<cd:note author="..." date="...">
 
</cd:note>
 
-->
 
</cd:notes>
 
 
<cd:seealso>
 
<cd:seealso>
<!-- one or more of these:
 
<cd:commandref name="xx"></cd:commandref>
 
<cd:wikipage  page="xx"></cd:wikipage>
 
<cd:url        url="https://xx"></cd:url>
 
<cd:manual    pdf="xx"></cd:manual>
 
<cd:source    file="xx"></cd:source>
 
-->
 
 
<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


\startlines ... \stoplines

Summary

The instances of \startlines ... \stoplines are used for typsetting text with preformatted line breaks.

Instances

\startlines ... \stoplines

Settings instance

\startLINES[...=...,...] ... \stopLINES
...=...,...inherits from \setuplines

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

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: