
@dvanhorn IIUC the default current-print
simply uses racket/pretty
So you should be able to adjust pretty-print-columns
on the evaluator that you are using

Here’s an example:
@examples[#:eval evaluator #:label #f
(range 20)
]
results in:

@(evaluator '(require (only-in racket/pretty pretty-print-columns)))
@(evaluator '(pretty-print-columns 10))
@examples[#:eval evaluator #:label #f
(range 20)
]
results in:

perfect — thanks!

Hmm, @sorawee actually I’m not getting the same result. Here’s the complete example on my end: #lang scribble/manual
@(require racket/sandbox scribble/examples)
@(define ev
(call-with-trusted-sandbox-configuration
(lambda ()
(parameterize ([sandbox-output 'string]
[sandbox-error-output 'string]
[sandbox-memory-limit 50])
(make-evaluator 'racket)))))
@(ev '(require (only-in racket/pretty pretty-print-columns)))
@(ev '(pretty-print-columns 10))
@examples[#:eval ev #:label #f
(range 20)]
then I see the following when rendered:

How are you constructing the evaluator?

Let me try yours, but my evaluator is simple (make-base-eval)

Yep, I confirm that I get the same output as yours. Hmm.


So make-base-eval
sets the current print to pretty-print-handler

If you have a custom evaluator, I guess you need to do that yourself

Thanks — I don’t remember why the evaluator is set up this way, so maybe I can just switch to make-base-eval
, or set the printer as you suggest.

oh, because I need racket, not raket/base.

Couldn’t you have make-base-eval
and then (ev '(require racket))
?

It seems like (define ev
(make-base-eval #:lang 'racket))
works fine for my purposes and lets me adjust the width of results. I don’t know why I had made it more complicated. Anyway, thanks for your help.