diff --git a/collects/scribble/sigplan.ss b/collects/scribble/sigplan.ss index 4f453f4718..4da3af5f4d 100644 --- a/collects/scribble/sigplan.ss +++ b/collects/scribble/sigplan.ss @@ -7,7 +7,7 @@ scribble/latex-properties (for-syntax scheme/base)) -(provide preprint +(provide preprint 10pt abstract include-abstract authorinfo conferenceinfo copyrightyear copyrightdata @@ -17,6 +17,10 @@ (raise-syntax-error #f "option must appear on the same line as `#lang scribble/sigplan'" stx)) +(define-syntax (10pt stx) + (raise-syntax-error #f + "option must appear on the same line as `#lang scribble/sigplan'" + stx)) (define sigplan-extras (let ([abs (lambda (s) diff --git a/collects/scribble/sigplan/lang.ss b/collects/scribble/sigplan/lang.ss index cdaaa287c1..56a872b93a 100644 --- a/collects/scribble/sigplan/lang.ss +++ b/collects/scribble/sigplan/lang.ss @@ -12,26 +12,42 @@ (rename-out [module-begin #%module-begin])) (define-syntax (module-begin stx) - (syntax-case* stx (preprint) (lambda (a b) (eq? (syntax-e a) (syntax-e b))) - [(_ id ws . body) - ;; Skip intraline whitespace to find options: - (and (string? (syntax-e #'ws)) - (regexp-match? #rx"^ *$" (syntax-e #'ws))) - #'(module-begin id . body)] - [(_ id preprint . body) - #'(#%module-begin id (post-process #t) () . body)] + (syntax-case stx () [(_ id . body) - #'(#%module-begin id (post-process #f) () . body)])) + (printf "body: ~s\n" #'body) + (let ([preprint? #f] + [10pt? #f]) + (let loop ([stuff #'body]) + (syntax-case* stuff (preprint 10pt) (lambda (a b) (eq? (syntax-e a) (syntax-e b))) + [(ws . body) + ;; Skip intraline whitespace to find options: + (and (string? (syntax-e #'ws)) + (regexp-match? #rx"^ *$" (syntax-e #'ws))) + (loop #'body)] + [(preprint . body) + (set! preprint? #t) + (loop #'body)] + [(10pt . body) + (set! 10pt? #t) + (loop #'body)] + [body + #`(#%module-begin id (post-process #,preprint? #,10pt?) () . body)])))])) -(define ((post-process preprint?) doc) - (add-sigplan-styles - (add-defaults doc - (string->bytes/utf-8 - (format "\\documentclass~a{sigplanconf}\n\\usepackage{times}\n\\usepackage{qcourier}\n" - (if preprint? "[preprint]" ""))) - (scribble-file "sigplan/style.tex") - (list (scribble-file "sigplan/sigplanconf.cls")) - #f))) +(define ((post-process preprint? 10pt?) doc) + (let ([options + (cond + [(and preprint? 10pt?) "[preprint, 10pt]"] + [preprint? "[preprint]"] + [10pt? "[10pt]"] + [else ""])]) + (add-sigplan-styles + (add-defaults doc + (string->bytes/utf-8 + (format "\\documentclass~a{sigplanconf}\n\\usepackage{times}\n\\usepackage{qcourier}\n" + options)) + (scribble-file "sigplan/style.tex") + (list (scribble-file "sigplan/sigplanconf.cls")) + #f)))) (define (add-sigplan-styles doc) ;; Ensure that "sigplan.tex" is used, since "style.tex" diff --git a/collects/scribblings/scribble/sigplan.scrbl b/collects/scribblings/scribble/sigplan.scrbl index 2867b8bddb..d9fe6c90b4 100644 --- a/collects/scribblings/scribble/sigplan.scrbl +++ b/collects/scribblings/scribble/sigplan.scrbl @@ -19,6 +19,20 @@ same line as @hash-lang[], with only whitespace between #lang scribble/sigplan @preprint }|} +@defidform[10pt]{ + +Enables the @tt{10pt} option. Use @scheme[10pt] only on the +same line as @hash-lang[], with only whitespace between +@schememodname[scribble/sigplan] and @scheme[10pt]: + +@verbatim[#:indent 2]|{ + #lang scribble/sigplan @10pt +}| + +The @scheme[10pt] and @scheme[preprint] options can be +used together and may appear in any order. +} + @defproc[(abstract [pre-content pre-content?] ...) block?]{