Difference between revisions of "Command/setuptyping"

From Wiki
Jump to navigation Jump to search
Line 28: Line 28:
 
** {2,+3}: line 2 to 5
 
** {2,+3}: line 2 to 5
 
** {label:start,label:end}: from label:start to label:end (comments in code)
 
** {label:start,label:end}: from label:start to label:end (comments in code)
 +
 +
* strip
 +
** yes: Remove leading white space while keeping relative indentation between lines.
  
 
The <code>option</code> option is for the type of colorization. E.g., to turn off colorization in <code>\startLUA</code> blocks:
 
The <code>option</code> option is for the type of colorization. E.g., to turn off colorization in <code>\startLUA</code> blocks:

Revision as of 12:15, 3 September 2020

\setuptyping

Syntax (autogenerated)

\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


\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)
  • strip
    • yes: Remove leading white space while keeping relative indentation between lines.

The option option is for the type of colorization. E.g., to turn off colorization in \startLUA blocks:

\setuptyping[LUA][option=]

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: