[racket] scribble: @verbatim inside macro

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Wed Nov 23 14:46:05 EST 2011

This hack works for now:

@(define-syntax-rule (my-example stuff)
   (begin
     @para{An example}
     (verbatim stuff)))

On 11/23/2011 12:26 PM, Jon Rafkind wrote:
> I want to write a macro in scribble that will output a `verbatim' but I keep getting an error about 'expected pre-content? got #<table>'. What should I do in the macro so that I can output verbatim? I tried various things other than `para' but none seem to work.
>
> @(define-syntax-rule (my-example stuff)
>   @para{An example: @(verbatim stuff)})
>
> @my-example{some stuff}
>
>
> $ scribble --pdf main.scrbl
> para: contract violation, expected: pre-content?, given: #<table>
>   contract from: <collects>/scribble/base.rkt, blaming:
>     main.scrbl
>   contract:
>     (->*
>      ()
>      (#:style (or/c style? string? symbol? #f))
>      #:rest
>      (listof pre-content?)
>      paragraph?)
>   at: <collects>/scribble/base.rkt:387.2
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users



Posted on the users mailing list.