Difference between revisions of "Command/setuptyping"

From Wiki
Jump to navigation Jump to search
(add range option of typefile)
Line 4: Line 4:
 
}}
 
}}
  
== [[Help:Reference|Syntax]] ==
+
== [[Help:Reference|Syntax generated automatically from ConTeXt definition)]] ==
<table cellspacing="4" cellpadding="2" class="cmd">
+
 
  <tr>
+
<syntax>setuptyping</syntax>
    <td colspan="2" class="cmd">\setuptyping<span class="first" style="color:red;">[...]</span><span class="second" >[...,...=...,...]</span></td>
+
 
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[...]</td>
 
    <td>file typing name </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:space|space]]</td>
 
    <td>[[Command/value:on|on]] [[Command/value:off|off]] [[Command/value:fixed|fixed]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:page|page]]</td>
 
    <td>[[Command/value:yes|yes]] [[Command/value:no|no]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:option|option]]</td>
 
    <td>[[Command/value:slanted|slanted]] [[Command/value:normal|normal]] [[Command/value:commands|commands]] [[Command/value:color|color]] [[Command/value:none|none]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:text|text]]</td>
 
    <td>[[Command/value:yes|yes]] [[Command/value:no|no]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:icommand|icommand]]</td>
 
    <td>[[Command/value:command|command]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:vcommand|vcommand]]</td>
 
    <td>[[Command/value:command|command]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:ccommand|ccommand]]</td>
 
    <td>[[Command/value:command|command]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:before|before]]</td>
 
    <td>[[Command/value:command|command]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:after|after]]</td>
 
    <td>[[Command/value:command|command]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:margin|margin]]</td>
 
    <td>[[Command/value:dimension|dimension]] [[Command/value:standard|standard]] [[Command/value:yes|yes]] [[Command/value:no|no]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:evenmargin|evenmargin]]</td>
 
    <td>[[Command/value:dimension|dimension]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:oddmargin|oddmargin]]</td>
 
    <td>[[Command/value:dimension|dimension]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:blank|blank]]</td>
 
    <td>[[Command/value:dimension|dimension]] [[Command/value:small|small]] [[Command/value:medium|medium]] [[Command/value:big|big]] [[Command/value:standard|standard]] [[Command/value:halfline|halfline]] [[Command/value:line|line]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:escape|escape]]</td>
 
    <td>[[Command/value:character|character]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:tab|tab]]</td>
 
    <td>[[Command/value:number|number]] [[Command/value:yes|yes]] [[Command/value:no|no]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:indentnext|indentnext]]</td>
 
    <td>[[Command/value:yes|yes]] [[Command/value:no|no]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:style|style]]</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 valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:color|color]]</td>
 
    <td>[[Command/value:name|name]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:palet|palet]]</td>
 
    <td>[[Command/value:name|name]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:lines|lines]]</td>
 
    <td>[[Command/value:yes|yes]] [[Command/value:no|no]] [[Command/value:hyphenated|hyphenated]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:empty|empty]]</td>
 
    <td>[[Command/value:yes|yes]] [[Command/value:all|all]] [[Command/value:no|no]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:numbering|numbering]]</td>
 
    <td>[[Command/value:line|line]] [[Command/value:file|file]] [[Command/value:no|no]] </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[[Command/keyword:range|range]]</td>
 
    <td>{[[Command/value:from|from]],[[Command/value:to|to]]}</td>
 
  </tr></table>
 
  
 
== Description ==  
 
== Description ==  

Revision as of 08:01, 31 May 2019

\setuptyping

Syntax generated automatically from ConTeXt definition)

\setuptyping[...,...][...=...,...]
[...,...]name
oddmargindimension
evenmargindimension
marginyes no standard dimension
optionmp lua xml parsed-xml nested tex context none name
stylestyle command
colorcolor
alignsee \setupalign
linesyes no normal hyphenated
spaceon off normal fixed stretch
keeptogetheryes no
beforecommand
aftercommand
stripyes no number
rangenumber name
tabyes no number
escapeyes no text processor->text
indentnextyes no auto
continueyes no
startnumber
stopnumber
stepnumber
numberingfile line no
blanksee \blank



Description

Changes options for displaying verbatim text. When called with a single argument, this command changes the options for the default typing environment as created with \starttyping. When the optional argument is given, it identifies a specific typing environment (as created with \definetyping).

\setuptyping can be used multiple times to change options and options will stay in effect until the end of file.

Note that \setuptyping also affects the display of the \typefile command.

  • space
    • fixed: Lines will not be broken, even if too long (may cause "overfull hbox" message)
  • lines
    • no (default): no hyphenation
    • yes: no hyphenation and left aligned text (align key is ignored)
    • hyphenated: hyphenation
  • range
    • {2,5}: line 2 to 5
    • {2,+3}: line 2 to 5
    • {label:start,label:end}: from label:start to label:end (comments in code)

Example

Note that background=screen,backgroundscreen=.8 is depricated in MKIV and should be replaced by something like background=color,backgroundcolor=lightgray.

\setuptyping
   [before={\startframedtext[width=\makeupwidth,
                             background=screen,
                             backgroundscreen=.8]},
    after={\stopframedtext}]

\starttext
\starttyping
This is a \test{}
    and everything
  is printed just as I write it
\stoptyping
\stoptext

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: