From d96626896d700820a276547e818648d99e289f8a Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 23 Jan 2013 17:26:34 -0500 Subject: [PATCH] scribble/latex-properties: add `command-extras' This style property is a way to add to the Latex output that is ignored for HTML and other output. original commit: 17865bfa841e7c6fd235717bde6b03f16c77e124 --- collects/scribble/latex-properties.rkt | 3 ++- collects/scribble/latex-render.rkt | 4 ++++ collects/scribblings/scribble/core.scrbl | 16 ++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/collects/scribble/latex-properties.rkt b/collects/scribble/latex-properties.rkt index 5ad7a87c..58e56c1d 100644 --- a/collects/scribble/latex-properties.rkt +++ b/collects/scribble/latex-properties.rkt @@ -6,4 +6,5 @@ [tex-addition ([path (or/c path-string? (cons/c 'collects (listof bytes?)) bytes?)])] [latex-defaults ([prefix (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))] [style (or/c bytes? path-string? (cons/c 'collects (listof bytes?)))] - [extra-files (listof (or/c path-string? (cons/c 'collects (listof bytes?))))])]) + [extra-files (listof (or/c path-string? (cons/c 'collects (listof bytes?))))])] + [command-extras ([arguments (listof string?)])]) diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index 53882864..f12ebf11 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -418,6 +418,10 @@ (color->string (background-color-property-color v))) (loop (cdr l) tt?) (printf "}")] + [(command-extras? (car l)) + (loop (cdr l) tt?) + (for ([l (in-list (command-extras-arguments (car l)))]) + (printf "{~a}" l))] [else (loop (cdr l) tt?)])))))) (when part-label? (printf "}")) diff --git a/collects/scribblings/scribble/core.scrbl b/collects/scribblings/scribble/core.scrbl index 38112b45..87ab5306 100644 --- a/collects/scribblings/scribble/core.scrbl +++ b/collects/scribblings/scribble/core.scrbl @@ -823,6 +823,9 @@ The following @tech{style properties} are currently recognized: name} is a string, render the elements content exactly (without escapes).} + @item{@racket[command-extras] structure --- For Latex output, + adds strings as arguments to the Latex command.} + ]} @@ -1502,14 +1505,7 @@ rendering. See also @racketmodname[scribble/latex-prefix].} -@defstruct[latex-auto-extra-files ([paths (listof (or/c path-string? - (cons/c 'collects (listof bytes?))))])]{ +@defstruct[command-extras ([arguments (listof string?)])]{ -Used as a @tech{style property} for the main @racket[part] of a -document to supply extra files needed to build the document via the -@exec{scribble} command-line tool (for @DFlag{latex} and @DFlag{pdf} -mode). - -Languages (used with @hash-lang[]) like -@racketmodname[scribble/sigplan] add this property to a document to specify -appropriate extra files.} +Used as a @tech{style property} on an @racket[element] to add extra +arguments to the element's command in Latex output.}