Add @onecolumn option to scribble/sigplan

original commit: 2dbbd1b58e558b029a170258f944d61a253573c3
This commit is contained in:
Sam Tobin-Hochstadt 2010-11-16 12:36:26 -05:00
parent 2af3c0c8b7
commit 1f37c2230a
3 changed files with 21 additions and 6 deletions

View File

@ -35,7 +35,7 @@
(->* () () #:rest (listof pre-content?)
content?)])
(provide preprint 10pt nocopyright
(provide preprint 10pt nocopyright onecolumn
include-abstract)
(define-syntax-rule (defopts name ...)
@ -45,7 +45,7 @@
stx))
...
(provide name ...)))
(defopts preprint 10pt nocopyright)
(defopts preprint 10pt nocopyright onecolumn)
(define sigplan-extras
(let ([abs (lambda (s)

View File

@ -17,9 +17,10 @@
[(_ id . body)
(let ([preprint? #f]
[10pt? #f]
[onecolumn? #f]
[nocopyright? #f])
(let loop ([stuff #'body])
(syntax-case* stuff (preprint 10pt nocopyright) (lambda (a b) (eq? (syntax-e a) (syntax-e b)))
(syntax-case* stuff (onecolumn preprint 10pt nocopyright) (lambda (a b) (eq? (syntax-e a) (syntax-e b)))
[(ws . body)
;; Skip intraline whitespace to find options:
(and (string? (syntax-e #'ws))
@ -28,6 +29,9 @@
[(preprint . body)
(set! preprint? "preprint")
(loop #'body)]
[(onecolumn . body)
(set! onecolumn? "onecolumn")
(loop #'body)]
[(nocopyright . body)
(set! nocopyright? "nocopyrightspace")
(loop #'body)]
@ -35,7 +39,7 @@
(set! 10pt? "10pt")
(loop #'body)]
[body
#`(#%module-begin id (post-process #,preprint? #,10pt? #,nocopyright?) () . body)])))]))
#`(#%module-begin id (post-process #,preprint? #,10pt? #,nocopyright? #,onecolumn?) () . body)])))]))
(define ((post-process . opts) doc)
(let ([options

View File

@ -39,8 +39,19 @@ same line as @hash-lang[], with only whitespace between
#lang scribble/sigplan @nocopyright
}|}
The @racket[10pt], @racket[preprint], and @racket[nocopyright] options can be
used together and may appear in any order.
@defidform[onecolumn]{
Enables the @tt{onecolumn} option. Use @racket[onecolumn] only on the
same line as @hash-lang[], with only whitespace between
@racketmodname[scribble/sigplan] and @racket[onecolumn]:
@codeblock{
#lang scribble/sigplan @onecolumn
}}
The @racket[10pt], @racket[preprint], @racket[nocopyright], and
@racket[onecolumn] options can be used together and may appear in any
order.
}