diff --git a/collects/scribble/base.ss b/collects/scribble/base.ss index 203ec47b4b..78f058b39e 100644 --- a/collects/scribble/base.ss +++ b/collects/scribble/base.ss @@ -514,7 +514,7 @@ (define (margin-note . c) (make-nested-flow - (make-style "refpara" '(command)) + (make-style "refpara" '(command never-indents)) (list (make-nested-flow (make-style "refcolumn" null) diff --git a/collects/scribble/latex-render.ss b/collects/scribble/latex-render.ss index a8e1442dfd..1a64db35af 100644 --- a/collects/scribble/latex-render.ss +++ b/collects/scribble/latex-render.ss @@ -158,9 +158,31 @@ (when use-style? (printf "}"))))) null) + (define/private (no-noindent? p ri) + (if (delayed-block? p) + (no-noindent? (delayed-block-blocks p ri) ri) + (or + (memq 'never-indents + (style-properties + (cond + [(paragraph? p) (paragraph-style p)] + [(compound-paragraph? p) (compound-paragraph-style p)] + [(nested-flow? p) (nested-flow-style p)] + [(table? p) (table-style p)] + [(itemization? p) (itemization-style p)] + [else plain]))) + (and (nested-flow? p) + (pair? (nested-flow-blocks p)) + (no-noindent? (car (nested-flow-blocks p)) ri)) + (and (compound-paragraph? p) + (pair? (compound-paragraph-blocks p)) + (no-noindent? (car (compound-paragraph-blocks p)) ri))))) + (define/override (render-intrapara-block p part ri first? last? starting-item?) (unless first? - (printf "\n\n\\noindent ")) + (printf "\n\n") + (unless (no-noindent? p ri) + (printf "\\noindent "))) (begin0 (super render-intrapara-block p part ri first? last? starting-item?))) diff --git a/collects/scribblings/scribble/core.scrbl b/collects/scribblings/scribble/core.scrbl index cda62c2f9f..a339545f21 100644 --- a/collects/scribblings/scribble/core.scrbl +++ b/collects/scribblings/scribble/core.scrbl @@ -386,6 +386,9 @@ The currently recognized @tech{style properties} are as follows: @item{@scheme[body-id] structure --- For HTML, uses the given string as an @tt{id} attribute of the @tt{
} or @tt{
} tag.} + @item{@scheme['never-indents] --- For Latex and @tech{compound + paragraphs}; see @scheme[compound-paragraph].} + ]} @@ -518,7 +530,12 @@ A @techlink{compound paragraph} has a @tech{style} and a list of For HTML, a @scheme[paragraph] block in @scheme[blocks] is rendered without a @tt{} tag, unless the paragraph has a style with a -non-@scheme[#f] @tech{style name}. +non-@scheme[#f] @tech{style name}. For Latex, each @tech{block} in +@scheme[blocks] is rendered with a preceding @tt{\noindent}, unless +the block has the @scheme['never-indents] property (checking +recursively in a @scheme[nested-flow] or @scheme[compound-paragraph] +if the @scheme[nested-flow] or @scheme[compound-paragraph] itself has +no @scheme['never-indents] property). The @scheme[style] field of a compound paragraph is normally a string that corresponds to a CSS class for HTML output or Latex environment @@ -537,6 +554,9 @@ for Latex output (see @secref["extra-style"]). The following @item{@scheme[body-id] structure --- For HTML, uses the given string as an @tt{id} attribute of the @tt{
} tag.} + @item{@scheme['never-indents] --- For Latex within another + @tech{compound paragraph}; see above.} + ]}