Difference between revisions of "Command/setuptextrules"

From Wiki
Jump to navigation Jump to search
(Create reference page)
 
m (Text replace - "\[\[cmd:(.*)\|(.*)\]\]" to "{{cmd|$1}}")
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<!-- please remove this and the following line if you have checked this page -->
 
{{Reference_Cleanup}}
 
 
{{Reference
 
{{Reference
 
|name=setuptextrules
 
|name=setuptextrules
Line 12: Line 10:
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:location|location]]</td>
+
     <td class="cmd">[[Command/keyword:location|location]]</td>
     <td>[[Reference/en/value:left|left]] [[Reference/en/value:inmargin|inmargin]] </td>
+
     <td>[[Command/value:left|left]] [[Command/value:inmargin|inmargin]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <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="first">
 
   <tr valign="top" class="first">
     <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="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:inbetween|inbetween]]</td>
+
     <td class="cmd">[[Command/keyword:inbetween|inbetween]]</td>
     <td>[[Reference/en/value:command|command]] </td>
+
     <td>[[Command/value:command|command]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:width|width]]</td>
+
     <td class="cmd">[[Command/keyword:width|width]]</td>
     <td>[[Reference/en/value:dimension|dimension]] </td>
+
     <td>[[Command/value:dimension|dimension]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <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="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:bodyfont|bodyfont]]</td>
+
     <td class="cmd">[[Command/keyword:bodyfont|bodyfont]]</td>
     <td>5pt ... 12pt [[Reference/en/value:small|small]] [[Reference/en/value:big|big]] </td>
+
     <td>5pt ... 12pt [[Command/value:small|small]] [[Command/value:big|big]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:color|color]]</td>
+
     <td class="cmd">[[Command/keyword:color|color]]</td>
     <td>[[Reference/en/value:name|name]] </td>
+
     <td>[[Command/value:name|name]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:style|style]]</td>
+
     <td class="cmd">[[Command/keyword:style|style]]</td>
     <td>[[Reference/en/value:normal|normal]] [[Reference/en/value:bold|bold]] [[Reference/en/value:slanted|slanted]] [[Reference/en/value:boldslanted|boldslanted]] [[Reference/en/value:type|type]] [[Reference/en/value:cap|cap]] [[Reference/en/value:small...|small...]] [[Reference/en/value:command|command]] </td>
+
     <td>[[Command/value:normal|normal]] [[Command/value:bold|bold]] [[Command/value:slanted|slanted]] [[Command/value:boldslanted|boldslanted]] [[Command/value:type|type]] [[Command/value:cap|cap]] [[Command/value:small...|small...]] [[Command/value:command|command]] </td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
     <td class="cmd">[[Reference/en/keyword:rulecolor|rulecolor]]</td>
+
     <td class="cmd">[[Command/keyword:rulecolor|rulecolor]]</td>
     <td>[[Reference/en/value:name|name]] </td>
+
     <td>[[Command/value:name|name]] </td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
  
  
== Description ==  
+
== Description ==
 +
From the [[source:pack-rul.mkiv|source]]:
  
 +
<texcode>
 +
%D Putting rules before and after a paragraph is very space
 +
%D sensitive, but the next command handles that quite well. It
 +
%D comes in two disguises:
 +
</texcode>
  
 +
Those two ‘disguises’ are {{cmd|textrule}} and the
 +
{{cmd|starttextrule}} environment.
 +
The command {{cmd|setuptextrules}} is dedicated to controlling the
 +
behaviour of these.
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
+
 
 +
<texcode>
 +
\enableregime[utf]
 +
\setupcolors[state=start]
 +
\setupcolor[hex]
 +
\definecolor[telekommagenta][h=E20074] % RAL 4010
 +
 
 +
\unexpanded\def\example#1{%
 +
\subject{#1}
 +
\starttextrule{Albatross!}
 +
\starttabulate[|l|l|]
 +
\NC{\em A} \NC What flavour is it?  \NC\NR
 +
\NC{\em B} \NC It’s a bird, isn’t it? It's a bloody sea bird. It’s not any bloody flavour. Albatross! \NC\NR
 +
\NC {\em A} \NC Do you get wafers with it? \NC\NR
 +
\NC {\em B} \NC Of course you don’t get bloody wafers with it. Albatross!\NC\NR
 +
\stoptabulate
 +
\stoptextrule
 +
}
 +
 
 +
\setupbodyfont[9pt]
 +
\starttext
 +
{\setuptextrules[location=left]
 +
\example{Location: Left}}
 +
 
 +
{\setuptextrules[location=inmargin]
 +
\example{Location: In Margin}}
 +
 
 +
{\setuptextrules[bodyfont=small,style=italic]
 +
\example{Small Bodyfont, Italic Text}}
 +
 
 +
{\setuptextrules[color=telekommagenta,rulecolor=red:2]
 +
\example{Colored Rule and Text}}
 +
 
 +
{\setuptextrules[distance=5em]
 +
\example{Wide Distance Between Text And Rule}}
 +
\stoptext
 +
</texcode>
 +
 
 +
<context>
 +
\enableregime[utf]
 +
\setupcolors[state=start]
 +
\setupcolor[hex]
 +
\definecolor[telekommagenta][h=E20074] % RAL 4010
 +
 
 +
\unexpanded\def\example#1{%
 +
\subject{#1}
 +
\starttextrule{Albatross!}
 +
\starttabulate[|l|l|]
 +
\NC{\em A} \NC What flavour is it?  \NC\NR
 +
\NC{\em B} \NC It’s a bird, isn’t it? It's a bloody sea bird. It’s not any bloody flavour. Albatross! \NC\NR
 +
\NC {\em A} \NC Do you get wafers with it? \NC\NR
 +
\NC {\em B} \NC Of course you don’t get bloody wafers with it. Albatross!\NC\NR
 +
\stoptabulate
 +
\stoptextrule
 +
}
 +
 
 +
\setupbodyfont[9pt]
 +
\starttext
 +
{\setuptextrules[location=left]
 +
\example{Location: Left}}
 +
 
 +
{\setuptextrules[location=inmargin]
 +
\example{Location: In Margin}}
 +
 
 +
{\setuptextrules[bodyfont=small,style=italic]
 +
\example{Small Bodyfont, Italic Text}}
 +
 
 +
{\setuptextrules[color=telekommagenta,rulecolor=red:2]
 +
\example{Colored Rule and Text}}
 +
 
 +
{\setuptextrules[distance=5em]
 +
\example{Wide Distance Between Text And Rule}}
 +
\stoptext
 +
</context>
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
<!-- something like {{cmd|goto}} -->
 +
 
 +
== Help from ConTeXt-Mailinglist/Forum ==
 +
All issues with:
 +
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Reference/en|setuptextrules]]
+
[[Category:Command/Rules|setuptextrules]]

Revision as of 05:42, 23 March 2012

\setuptextrules

Syntax

\setuptextrules[...,...=...,...]
location left inmargin
before command
after command
inbetween command
width dimension
distance dimension
bodyfont 5pt ... 12pt small big
color name
style normal bold slanted boldslanted type cap small... command
rulecolor name


Description

From the source:

%D Putting rules before and after a paragraph is very space
%D sensitive, but the next command handles that quite well. It
%D comes in two disguises:

Those two ‘disguises’ are \textrule and the \starttextrule environment. The command \setuptextrules is dedicated to controlling the behaviour of these.

Example

\enableregime[utf]
\setupcolors[state=start]
\setupcolor[hex]
\definecolor[telekommagenta][h=E20074] % RAL 4010

\unexpanded\def\example#1{%
\subject{#1}
\starttextrule{Albatross!}
\starttabulate[|l|l|]
\NC{\em A} \NC What flavour is it?  \NC\NR
\NC{\em B} \NC It’s a bird, isn’t it? It's a bloody sea bird. It’s not any bloody flavour. Albatross! \NC\NR
\NC {\em A} \NC Do you get wafers with it? \NC\NR
\NC {\em B} \NC Of course you don’t get bloody wafers with it. Albatross!\NC\NR
\stoptabulate
\stoptextrule
}

\setupbodyfont[9pt]
\starttext
{\setuptextrules[location=left]
 \example{Location: Left}}

{\setuptextrules[location=inmargin]
 \example{Location: In Margin}}

{\setuptextrules[bodyfont=small,style=italic]
 \example{Small Bodyfont, Italic Text}}

{\setuptextrules[color=telekommagenta,rulecolor=red:2]
 \example{Colored Rule and Text}}

{\setuptextrules[distance=5em]
 \example{Wide Distance Between Text And Rule}}
\stoptext

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: