Changes

Jump to navigation Jump to search
m
Mark left/rightmargin quirks as MkII only
}}
== [[Help:Reference|Syntax]] (autogenerated) ==
<syntax>setupdelimitedtext</syntax>
== [[Help:Reference|Syntax]] ==
<table cellspacing="4" cellpadding="2" class="cmd">
<tr valign="top" class="third">
<td class="cmd"> left </td>
<td> ''text'' </td>
</tr>
<tr valign="top" class="third">
<td class="cmd"> middle </td>
<td> ''text'' </td>
</tr>
</table>
{{Todo| The above describes MkII syntax. MkIV syntax is different. See the parenthesis example below}}
== Description ==
* Nearly all of the parameters apply only if the new kind of text is invoked with <code>\startmydelimitedtext</code>: if one uses <code>\mydelimitedtext{...}</code>, only <code>left</code> and <code>right</code> have any effect.
* '''MkII only''': <code>leftmargin</code> contains the distance to the actual left margin, not to the edge of the body text. If the new delimitedtext inherits from <code>quotation</code>, the text will be indented a bit with respect to the body text; if you want to line them up, set the <code>leftmargin</code> to <code>\leftmargindistance</code> rather than to <code>0pt</code>.
== Example ==
<texcodecontext mode="mkiv" source="yes">\setuppapersize[A5] 
\definedelimitedtext[mydt]
\setupdelimitedtext[mydt][left=»\leftguillemot, right=«\rightguillemot]
\quotation{Clancy of the Overflow}, by Banjo Paterson
\startmydt
And an answer came directed in a manner unexpected, and I think the same was written with a thumbnail dipped in tar; 't was his shearing-mate who wrote it, and verbatim I will quote it: \quotation{Clancy's gone to Queensland droving, and we don't know where he are.}
\stopmydt
</context>
 
=== Smart parenthesis ===
<context mode="mkiv" source="yes">
\definedelimitedtext[parenthesis][location=text]
\setupdelimitedtext [parenthesis:1] [left={(}, right={)}]
\setupdelimitedtext [parenthesis:2] [left={[}, right={]}]
\setupdelimitedtext [parenthesis:3] [left={\{}, right={\}}]
 
\starttext
 
\parenthesis{My outer layer \parenthesis{my inner layer \parenthesis{my innermost layer}}}
 
\stoptext
</context>
 
== Multiparagraph quotations ==
In English typography there is a custom of opening each paragraph in a multiparagraph quotation with a “repeated” opening quotation sign. This behavior may be turned on using the <code>repeat</code> switch and <code>middle</code> key, for example:
 
<texcode>
\setupquotation[repeat=yes, middle=“] % or equivalently
\setupdelimitedtext[quotation][repeat=yes, middle=“]
</texcode>

Navigation menu