added support for the 10pt option to the sigplan scribble support
svn: r18593
This commit is contained in:
parent
40444fc087
commit
c74849dc2e
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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?]{
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user