Difference between revisions of "Command/defineparagraphs"

From Wiki
Jump to navigation Jump to search
m (Text replace - "Reference/en|" to "Commands|")
(19 intermediate revisions by 5 users not shown)
Line 3: Line 3:
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>defineparagraphs</syntax>
  
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
Line 14: Line 17:
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:n|n]]</td>
+
     <td class="cmd">[[Command/keyword:n|n]]</td>
     <td>[[Reference/en/value:number|number]] </td>
+
     <td>[[Command/value:number|number]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:rule|rule]]</td>
+
     <td class="cmd">[[Command/keyword:rule|rule]]</td>
     <td>[[Reference/en/value:on|on]] [[Reference/en/value:off|off]] </td>
+
     <td>[[Command/value:on|on]] [[Command/value:off|off]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:height|height]]</td>
+
     <td class="cmd">[[Command/keyword:height|height]]</td>
     <td>[[Reference/en/value:fit|fit]] [[Reference/en/value:dimension|dimension]] </td>
+
     <td>[[Command/value:fit|fit]] [[Command/value:dimension|dimension]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:before|before]]</td>
+
     <td class="cmd">[[Command/keyword:before|before]]</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>[[Command/value:command|command]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:after|after]]</td>
+
     <td class="cmd">[[Command/keyword:after|after]]</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>[[Command/value:command|command]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:inner|inner]]</td>
+
     <td class="cmd">[[Command/keyword:inner|inner]]</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>[[Command/value:command|command]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:distance|distance]]</td>
+
     <td class="cmd">[[Command/keyword:distance|distance]]</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>[[Command/value:dimension|dimension]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:tolerance|tolerance]]</td>
+
     <td class="cmd">[[Command/keyword:tolerance|tolerance]]</td>
     <td>[[Reference/en/value:verystrict|verystrict]] [[Reference/en/value:strict|strict]] [[Reference/en/value:tolerant|tolerant]] [[Reference/en/value:verytolerant|verytolerant]] [[Reference/en/value:stretch|stretch]] </td>
+
     <td>[[Command/value:verystrict|verystrict]] [[Command/value:strict|strict]] [[Command/value:tolerant|tolerant]] [[Command/value:verytolerant|verytolerant]] [[Command/value:stretch|stretch]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
     <td class="cmd">[[Reference/en/keyword:align|align]]</td>
+
     <td class="cmd">[[Command/keyword:align|align]]</td>
     <td>[[Reference/en/value:flushleft|flushleft]] [[Reference/en/value:flushright|flushright]] [[Reference/en/value:middle|middle]] </td>
+
     <td>[[Command/value:flushleft|flushleft]] [[Command/value:flushright|flushright]] [[Command/value:righttoleft|righttoleft]] [[Command/value:lefttoright|lefttoright]] [[Command/value:middle|middle]] </td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
Line 53: Line 56:
 
== Description ==  
 
== Description ==  
  
== Example ==
+
== Examples ==
 +
 
 
<context source="yes" text="yields">
 
<context source="yes" text="yields">
 +
\setuppapersize[A5]
 
% Source: ConText Manual ms-cb-en.pdf
 
% Source: ConText Manual ms-cb-en.pdf
  
 
% Define a paragraph environment with 3 columns.  
 
% Define a paragraph environment with 3 columns.  
% Insert a blank line just before and just after the paragraph.  
+
% Insert a blank line just before and just after the environment.  
 
\defineparagraphs  
 
\defineparagraphs  
 
[mypar][n=3,before={\blank},after={\blank}]  
 
[mypar][n=3,before={\blank},after={\blank}]  
Line 71: Line 76:
 
% the remaining 50% of the text's width.
 
% the remaining 50% of the text's width.
 
   
 
   
% Set a paragraph with "mypar"
+
\startmypar % begin the side-by-side paragraphs; start with the first one
 
+
    1252  
\startmypar % begin paragraph body with 1st column
 
1252  
 
 
 
 
\mypar % switch to 2nd column
 
\mypar % switch to 2nd column
 
+
    Hasselt obtains its city charter from bishop Hendrik van Vianden.  
Hasselt obtains its city charter from bishop Hendrik van Vianden.  
 
 
 
 
\mypar % switch to 3rd column
 
\mypar % switch to 3rd column
 
+
    Hendrik van Vianden was pressed by other towns not to agree  
Hendrik van Vianden was pressed by other towns not to agree  
+
    with the charter. It took Hasselt a long period of time to  
with the charter. It took Hasselt a long period of time to  
+
    convince the Bishop. After supporting the Bishop in a small  
convince the Bishop. After supporting the Bishop in a small  
+
    war against the Drents, the charter was released.  
war against the Drents, the charter was released.  
 
 
 
 
\stopmypar % end paragraph body  
 
\stopmypar % end paragraph body  
 
</context>
 
</context>
  
 +
Footnotes need special treatment, as follows.
  
 
+
<context source="yes" text="This gives:">
== Example ==
+
\setuppapersize[A10,landscape]
 
+
% when using footnotes, you have to use the following trick
<context source="yes" text="yields">
 
% when using footnotes, you have to do the following trick
 
 
% (from Hans on mailinglist, Date: Tue, 15 Jun 2004 00:53:48 +0200)
 
% (from Hans on mailinglist, Date: Tue, 15 Jun 2004 00:53:48 +0200)
 +
% but the names have changed since then  from postponefootnotes
 +
% to postponenotes and flushfootnotes to flushnotes
  
 
\defineparagraphs[Par][n=3]
 
\defineparagraphs[Par][n=3]
 
\starttext
 
\starttext
 
\startPar
 
\startPar
Text \Par and more\postponefootnotes\footnote{a footnote, that gets
+
    Text  
  hidden...}\Par text  
+
\Par  
 +
    and\postponenotes\footnote{A footnote whose placement is postponed...}
 +
\Par  
 +
    text  
 
\stopPar
 
\stopPar
\flushfootnotes
+
\flushnotes
 
\stoptext
 
\stoptext
 
</context>
 
</context>
  
 +
== See also ==
 +
* {{cmd|setupparagraphs}} to setup the individual paragraphs/columns.
 +
* {{cmd|startparagraph}} to start a paragraphs environment.
 +
* {{cmd|paragraph}} to switch to the next paragraph.
 +
* {{cmd|starttable}} and {{cmd|starttabulate}} to create more traditional tables,
  
== See also ==
+
== Help from ConTeXt-Mailinglist/Forum ==
<!-- something like [[cmd:goto|\goto]] -->
+
All issues with:
 +
{{Forum|{{SUBPAGENAME}}}}
 +
 
 +
{{Columns navbox}}
  
[[Category:Commands|defineparagraphs]]
+
[[Category:Command/Paragraphs|defineparagraphs]]
 +
[[Category:Command/Tables|defineparagraphs]]
 +
[[Category:Command/Columns|defineparagraphs]]

Revision as of 12:05, 19 November 2019

\defineparagraphs

Syntax (autogenerated)

\defineparagraphs[...][...][...=...,...]
[...]name
[...]name
...=...,...inherits from \setupparagraphs


Syntax

\defineparagraphs[...][...,...=...,...]
[...] name
n number
rule on off
height fit dimension
before command
after command
inner command
distance dimension
tolerance verystrict strict tolerant verytolerant stretch
align flushleft flushright righttoleft lefttoright middle

Description

Examples

\setuppapersize[A5]
% Source: ConText Manual ms-cb-en.pdf

% Define a paragraph environment with 3 columns. 
% Insert a blank line just before and just after the environment. 
\defineparagraphs 
	[mypar][n=3,before={\blank},after={\blank}] 

% The first column occupies 10% of the text's width and is rendered bold. 
\setupparagraphs [mypar][1][width=.1\textwidth,style=bold] 

% The second column occupies 40% of the text's width. 
\setupparagraphs [mypar][2][width=.4\textwidth]

% The third column uses default settings. It will occupy 
% the remaining 50% of the text's width.
 
\startmypar % begin the side-by-side paragraphs; start with the first one
    1252 
\mypar % switch to 2nd column
    Hasselt obtains its city charter from bishop Hendrik van Vianden. 
\mypar % switch to 3rd column
    Hendrik van Vianden was pressed by other towns not to agree 
    with the charter. It took Hasselt a long period of time to 
    convince the Bishop. After supporting the Bishop in a small 
    war against the Drents, the charter was released. 
\stopmypar % end paragraph body 

yields

Footnotes need special treatment, as follows.

\setuppapersize[A10,landscape]
% when using footnotes, you have to use the following trick
% (from Hans on mailinglist, Date: Tue, 15 Jun 2004 00:53:48 +0200)
% but the names have changed since then  from postponefootnotes
% to postponenotes and flushfootnotes to flushnotes

\defineparagraphs[Par][n=3]
\starttext
\startPar
    Text 
\Par 
    and\postponenotes\footnote{A footnote whose placement is postponed...}
\Par 
    text 
\stopPar
\flushnotes
\stoptext

This gives:

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: