I'm trying to get LaTeX output that wraps an environment around several
paragraphs (while containing @para elements) and HTML output that does
something similar with a <div>. HTML is actually my sticking point, because
so far all I've managed to do is get nested <p> elements, which is illegal.

Here's a M(non-)WE:

#lang scribble/base
@(require scribble/core
          scribble/decode)

@(define foo-style (make-style "foo" null))
@(define (foo . content) (make-nested-flow foo-style (decode-flow content)))
@foo{Test.

@para[#:style "bar"]{Bar.}}

This is almost what I want, except that the outer element is a blockquote,
not a div. The LaTeX does exactly what I want: the contents is wrapped in
\begin{foo}…\end{foo}.

How can I get it wrapped in a div instead? I tried this:

@(define (foo . content)
  (make-part
   #f
   (list `(part ,(generated-tag)))
   #f
   foo-style
   null
   (decode-flow content)
   null))
Unfortunately, styles on parts seem to be interpreted differently, and the
name "foo" does not come out in the HTML or LaTeX.

None of the other sorts of block seem to do what I want: table and
itemization are special-purpose, compound-paragraph and paragraph are too
low level (they are paragraphs, and can't have paragraphs inside them), and
traverse-block and delayed-block are of course ways of computing blocks
eventually, of one of the other types.


-- 
https://rrt.sc3d.org

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAOnWdohD15-1ajAjFEG8CLdLrbDoGYQAx0VQR%3DKe0PW_iyyt-g%40mail.gmail.com.

Reply via email to