break-width

modifier

Syntax
break-width preferred-width (to maximum-width)?
or
open stream-identifier with break-width preferred-width (to maximum-width)?
or
set stream-identifier with (break-width preferred-width (to maximum-width)?) to stream-expression

Argument definitions

preferred-width
A positive integer. This is the preferred output line width, expressed as a character count. (OmniMark will try to break lines with more than this number of characters.)
maximum-width
A positive integer. This value is optional. It gives the maximum acceptable output line width. If this number is given, an error occurs if the output line exceeds the value and OmniMark can't find an acceptable place to break it. Obviously, the maximum-width value must be greater than the preferred-width value.
stream-expression
The name of a stream variable.


Purpose

Defines acceptable line widths for all streams. Used in conjunction with replacement-break or insertion-break.

You can use break-width either as a declaration or as a modifier for open. If you use break-width in a declaration, it applies only to #main-output. If you use break-width as a modifier to the open keyword, it applies only to the stream being opened. You must also use %/ to show each breakable point (except for data coming from the markup parser, such as PCDATA from an SGML document instance).

For example:

  break-width 35 to 45
  replacement-break "%_" "%n"
  
  process  
     submit "A narrow column this shall be; at position 36, a break you'll see."
       
  find space => space-in-line
     output "%/" || space-in-line
  
  ; OUTPUT:
  ; A narrow column this shall be; at
  ; position 36, a break you'll see.

An OmniMark program can have only one break-width declaration.

Unlike the other open modifiers, break-width must be parenthesized within a set action. This avoids potential ambiguity in the interpretation of the to keyword.

Older versions of OmniMark allowed you to omit the keyword to when specifying the maximum width. This use is now deprecated.

Related Concepts