Difference between revisions of "Command/thinrule"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \thinrule")
 
Line 5: Line 5:
 
<cd:command category="rules" file="pack-mrl.mkiv" interfacedate="2020-06-19T13:41" interfacefile="i-thinrule.xml" level="document" name="thinrule" variantnumber="1"></cd:command>
 
<cd:command category="rules" file="pack-mrl.mkiv" interfacedate="2020-06-19T13:41" interfacefile="i-thinrule.xml" level="document" name="thinrule" variantnumber="1"></cd:command>
 
</cd:variants>
 
</cd:variants>
<cd:description><tt>\thinrule</tt>s are very similar to {{cmd|hairline}}s in that  
+
<cd:description><tt>\thinrule</tt>s are very similar to {{cmd|hairline}}s in that
 
they provide means handle TeX's primitives <tt>\hrule</tt> and <tt>\vrule</tt>
 
they provide means handle TeX's primitives <tt>\hrule</tt> and <tt>\vrule</tt>
conveniently, or -- as the ConTeXt [[source:pack-rul.mkiv|source]] puts it --  
+
conveniently, or -- as the ConTeXt [[source:pack-rul.mkiv|source]] puts it --
 
“free us from some specifications”.
 
“free us from some specifications”.
  
The <tt>\thinrule</tt> command draws a rule on the ''current'' baseline, whereas  
+
The <tt>\thinrule</tt> command draws a rule on the ''current'' baseline, whereas
 
an <tt>\hairline</tt> does exactly the same except that it ''creates a new paragraph''
 
an <tt>\hairline</tt> does exactly the same except that it ''creates a new paragraph''
 
for the rule alone. To the extent that the outcome of <tt>\hairline</tt> might
 
for the rule alone. To the extent that the outcome of <tt>\hairline</tt> might
depend on your paragraph settings and that they will always span the whole surrounding  
+
depend on your paragraph settings and that they will always span the whole surrounding
 
box horizontally, while <tt>\thinrule</tt>s stay subordinate to the paragraph they
 
box horizontally, while <tt>\thinrule</tt>s stay subordinate to the paragraph they
 
occur inside.
 
occur inside.
  
</cd:description>
+
The rule can be configured using {{cmd|setupthinrules}}, but only horizontal options apply. </cd:description>
 
<cd:examples><cd:example title="">The following example demonstrates the behaviour of <tt>\thinrule</tt> versus <tt>\hairline</tt> (MkII and MkIV).
 
<cd:examples><cd:example title="">The following example demonstrates the behaviour of <tt>\thinrule</tt> versus <tt>\hairline</tt> (MkII and MkIV).
  
Line 70: Line 70:
 
\stoptext
 
\stoptext
 
</context>
 
</context>
</cd:example></cd:examples>
+
</cd:example><cd:example title=""><context source="yes">
 +
\setupthinrules[color=green]
 +
 
 +
{\framed[width=5cm,align=left,frame=off]{%
 +
  I have elsewhere explained,
 +
  \thinrule
 +
  though it is a thing perhaps not yet well understood by all;
 +
  that the very substance of things,
 +
  consists in the power of acting and being acted upon.
 +
  \thinrule}}
 +
</context></cd:example></cd:examples>
 
<cd:notes></cd:notes>
 
<cd:notes></cd:notes>
 
<cd:seealso>
 
<cd:seealso>
Line 77: Line 87:
 
<cd:commandref name="hairline"></cd:commandref>
 
<cd:commandref name="hairline"></cd:commandref>
 
<cd:commandref name="fillinrules">for rules for multiple-line answers.</cd:commandref>
 
<cd:commandref name="fillinrules">for rules for multiple-line answers.</cd:commandref>
<cd:commandref name="filinlines">for a 'write your answer here' rule at the end of the current line</cd:commandref></cd:seealso>
+
<cd:commandref name="fillinline">for a 'write your answer here' rule at the end of the current line</cd:commandref>
 +
<cd:commandref name="setupthinrules">for configuration</cd:commandref>
 +
<cd:commandref name="thinrules"></cd:commandref></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Revision as of 09:09, 22 November 2021


\thinrule

Summary

The command \thinrule is used to draw a line.

Description

\thinrules are very similar to \hairlines in that

they provide means handle TeX's primitives \hrule and \vrule conveniently, or -- as the ConTeXt source puts it -- “free us from some specifications”.

The \thinrule command draws a rule on the current baseline, whereas an \hairline does exactly the same except that it creates a new paragraph for the rule alone. To the extent that the outcome of \hairline might depend on your paragraph settings and that they will always span the whole surrounding box horizontally, while \thinrules stay subordinate to the paragraph they occur inside.

The rule can be configured using \setupthinrules, but only horizontal options apply.

Examples

Example 1

The following example demonstrates the behaviour of \thinrule versus \hairline (MkII and MkIV).

\setupcombinations[style=\em]
\starttext
\startcombination[2*1]
{\framed[width=5cm,align=left,frame=off]{%
  I have elsewhere explained,
  \hairline
  though it is a thing perhaps not yet well understood by all;
  that the very substance of things,
  consists in the power of acting and being acted upon.
  \hairline}}
{Hairlines in action.}
%
{\framed[width=5cm,align=left,frame=off]{%
  I have elsewhere explained,
  \thinrule
  though it is a thing perhaps not yet well understood by all;
  that the very substance of things,
  consists in the power of acting and being acted upon.
  \thinrule}}
{Thinrules in action.}
\stopcombination
\stoptext

Example 2

\setupthinrules[color=green]

{\framed[width=5cm,align=left,frame=off]{%
  I have elsewhere explained,
  \thinrule
  though it is a thing perhaps not yet well understood by all;
  that the very substance of things,
  consists in the power of acting and being acted upon.
  \thinrule}}

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: