[plt-scheme] scribble, line breaks

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Feb 11 07:56:13 EST 2008

At Mon, 11 Feb 2008 06:54:56 -0500, "Geoffrey S. Knauth" wrote:
> How do I force a line break in Scribble?  I want to have a line break  
> after the first line in the following:
> 
> @scheme[(:: "/*" (complement (:: any-string "*/" any-string)) "*/")]
>    matches Java/C block comments.  @scheme["/**/"], @scheme["/ 
> ******/"], @scheme["/*////*/"],
>    @scheme["/*asg4*/"] and so on.  It does not match @scheme["/**/ 
> */"], @scheme["/* */ */"] and so
>    on.  @scheme[(:: any-string "*/" any-string)] matches any string  
> that has a
>    @scheme["*/"] in is, so @scheme[(complement (:: any-string "*/" any- 
> string))] matches
>    any string without a @scheme["*/"] in 
> it.

`(make-element 'newline '("\n"))' creates a newline in the output. But
since forcing a newline is a last resort, below is the way I would
typeset this part of the "doc.txt".

Matthew

P.S. --- There was a problem in both HTML and PDF-via-latex rendering
when a multi-line scheme form (or anything else rendered through a
table) is used to start an item in an itemization, as below, but I
committed a repair in SVN.

----------------------------------------

Since negation is not a common operator on regular expressions, here
are a few examples, using @schemeidfont{:}-prefixed SRE syntax:

@itemize{

 @item{@schemeblock0[(complement "1")]

  Matches all strings except the string @scheme["1"], including
  @scheme["11"], @scheme["111"], @scheme["0"], @scheme["01"],
  @scheme[""], and so on.}

 @item{@schemeblock0[(complement (:* "1"))]

  Matches all strings that are not sequences of @scheme["1"],
  including @scheme["0"], @scheme["00"], @scheme["11110"],
  @scheme["0111"], @scheme["11001010"] and so on.}

 @item{@schemeblock0[(:& (:: any-string "111" any-string)
                         (complement (:or (:: any-string "01") (:+ "1"))))]

  Matches all strings that have 3 consecutive ones, but not those that
  end in @scheme["01"] and not those that are ones only.  These
  include @scheme["1110"], @scheme["0001000111"] and @scheme["0111"]
  but not @scheme[""], @scheme["11"], @scheme["11101"], @scheme["111"]
  and @scheme["11111"].}

 @item{@schemeblock0[(:: "/*" (complement (:: any-string "*/" any-string)) "*/")]

  Matches Java/C block comments.  @scheme["/**/"],
  @scheme["/******/"], @scheme["/*////*/"], @scheme["/*asg4*/"] and so
  on.  It does not match @scheme["/**/*/"], @scheme["/* */ */"] and so
  on.  @scheme[(:: any-string "*/" any-string)] matches any string
  that has a @scheme["*/"] in is, so @scheme[(complement (:: any-string "*/"
  any-string))] matches any string without a @scheme["*/"] in it.}

 @item{@schemeblock0[(:: "/*" (:* (complement "*/")) "*/")]

  Matches any string that starts with @scheme["/*"] and and ends with
  @scheme["*/"], including @scheme["/* */ */ */"].
  @scheme[(complement "*/")] matches any string except @scheme["*/"].
  This includes @scheme["*"] and @scheme["/"] separately.  Thus
  @scheme[(:* (complement "*/"))] matches @scheme["*/"] by first
  matching @scheme["*"] and then matching @scheme["/"].  Any other
  string is matched directly by @scheme[(complement "*/")].  In other
  words, @scheme[(:* (complement "xx"))] = @scheme[any-string].  It is
  usually not correct to place a @scheme[:*] around a
  @scheme[complement].}

}


Posted on the users mailing list.