Top-matter text needs to be 'pretitle.

As per the acmart pdf, top matter matterial needs to appear
before the `\maketitle` command. As such, we need to use the
`pretitle` paragraph style.
This commit is contained in:
Leif Andersen 2017-05-17 13:51:46 -04:00
parent b62bfe3bdf
commit ba2e1d6ca7
2 changed files with 77 additions and 91 deletions

View File

@ -106,24 +106,24 @@ Specifies a subtitle.}
} }
@deftogether[( @deftogether[(
@defproc[(acmJournal [journal pre-content?] ...) content?] @defproc[(acmJournal [journal pre-content?] ...) block?]
@defproc[(acmConference [name pre-content?] [date pre-content?] [venue pre-content?]) content?] @defproc[(acmConference [name pre-content?] [date pre-content?] [venue pre-content?]) block?]
@defproc[(acmVolume [content pre-content?] ...) content?] @defproc[(acmVolume [content pre-content?] ...) block?]
@defproc[(acmNumber [content pre-content?] ...) content?] @defproc[(acmNumber [content pre-content?] ...) block?]
@defproc[(acmArticle [content pre-content?] ...) content?] @defproc[(acmArticle [content pre-content?] ...) block?]
@defproc[(acmYear [content pre-content?] ...) content?] @defproc[(acmYear [content pre-content?] ...) block?]
@defproc[(acmMonth [content pre-content?] ...) content?] @defproc[(acmMonth [content pre-content?] ...) block?]
@defproc[(acmArticleSeq [content pre-content?] ...) content?] @defproc[(acmArticleSeq [content pre-content?] ...) block?]
@defproc[(acmPrice [content pre-content?] ...) content?] @defproc[(acmPrice [content pre-content?] ...) block?]
@defproc[(acmISBN [content pre-content?] ...) content?] @defproc[(acmISBN [content pre-content?] ...) block?]
@defproc[(acmDOI [content pre-content?] ...) content?] @defproc[(acmDOI [content pre-content?] ...) block?]
)]{ )]{
Declares information that is collected into the front-matter region of the paper.} Declares information that is collected into the front-matter region of the paper.}
@deftogether[( @deftogether[(
@defproc[(acmBadgeL [#:url url string? #f] [graphics string?]) content?] @defproc[(acmBadgeL [#:url url string? #f] [graphics string?]) block?]
@defproc[(acmBadgeR [#:url url string? #f] [graphics string?]) content?] @defproc[(acmBadgeR [#:url url string? #f] [graphics string?]) block?]
)]{ )]{
Display a special badge, such as an artifact evaluation badge, on the Display a special badge, such as an artifact evaluation badge, on the

View File

@ -67,19 +67,16 @@
[abstract [abstract
(->* () () #:rest (listof pre-content?) (->* () () #:rest (listof pre-content?)
block?)] block?)]
[acmJournal
(->* () () #:rest (listof pre-content?)
content?)]
[acmConference [acmConference
(-> string? string? string? content?)] (-> string? string? string? block?)]
[grantsponsor [grantsponsor
(-> string? string? string? content?)] (-> string? string? string? block?)]
[grantnum [grantnum
(->* (string? string?) (#:url string?) content?)] (->* (string? string?) (#:url string?) block?)]
[acmBadgeR (->* (string?) (#:url string?) content?)] [acmBadgeR (->* (string?) (#:url string?) block?)]
[acmBadgeL (->* (string?) (#:url string?) content?)] [acmBadgeL (->* (string?) (#:url string?) block?)]
[received (->* (string?) (#:stage string?) content?)] [received (->* (string?) (#:stage string?) block?)]
[citestyle (-> content? content?)] [citestyle (-> content? block?)]
[CCSXML [CCSXML
(->* () () #:rest (listof pre-content?) (->* () () #:rest (listof pre-content?)
any/c)]) any/c)])
@ -96,10 +93,11 @@
(begin (begin
(begin (begin
(provide/contract [name (->* () () #:rest (listof pre-content?) (provide/contract [name (->* () () #:rest (listof pre-content?)
content?)]) block?)])
(define (name . str) (define (name . str)
(make-paragraph (make-style 'pretitle '())
(make-element (make-style (symbol->string 'name) command-props) (make-element (make-style (symbol->string 'name) command-props)
(decode-content str)))) (decode-content str)))))
...)) ...))
(define-syntax-rule (define-environments name ...) (define-syntax-rule (define-environments name ...)
@ -151,38 +149,22 @@
abstract-style abstract-style
(decode-flow strs))) (decode-flow strs)))
(define (extract-abstract p)
(unless (part? p)
(error 'include-abstract "doc binding is not a part: ~e" p))
(unless (null? (part-parts p))
(error 'include-abstract "abstract part has sub-parts: ~e" (part-parts p)))
(when (part-title-content p)
(error 'include-abstract "abstract part has title content: ~e" (part-title-content p)))
(part-blocks p))
(define-syntax-rule (include-abstract mp)
(begin
(require (only-in mp [doc abstract-doc]))
(make-nested-flow abstract-style (extract-abstract abstract-doc))))
(define (acmJournal . str)
(make-element (make-style "acmJournal" command-props)
(decode-content str)))
(define (acmConference name date venue) (define (acmConference name date venue)
(make-paragraph (make-style 'pretitle '())
(make-multiarg-element (make-style "acmConference" multicommand-props) (make-multiarg-element (make-style "acmConference" multicommand-props)
(list (decode-string name) (list (decode-string name)
(decode-string date) (decode-string date)
(decode-string venue)))) (decode-string venue)))))
(define (grantsponsor id name url) (define (grantsponsor id name url)
(make-paragraph (make-style 'pretitle '())
(make-multiarg-element (make-style "grantsponsor" multicommand-props) (make-multiarg-element (make-style "grantsponsor" multicommand-props)
(list (decode-string id) (list (decode-string id)
(decode-string name) (decode-string name)
(decode-string url)))) (decode-string url)))))
(define (grantnum #:url [url #f] id num) (define (grantnum #:url [url #f] id num)
(make-paragraph (make-style 'pretitle '())
(if url (if url
(make-multiarg-element (make-style "SgrantnumURL" multicommand-props) (make-multiarg-element (make-style "SgrantnumURL" multicommand-props)
(list (decode-string url) (list (decode-string url)
@ -190,43 +172,48 @@
(decode-string num))) (decode-string num)))
(make-multiarg-element (make-style "grantnum" multicommand-props) (make-multiarg-element (make-style "grantnum" multicommand-props)
(list (decode-string id) (list (decode-string id)
(decode-string num))))) (decode-string num))))))
(define (acmBadgeR #:url [url #f] str) (define (acmBadgeR #:url [url #f] str)
(make-paragraph (make-style 'pretitle '())
(if url (if url
(make-multiarg-element (make-style "SacmBadgeRURL" multicommand-props) (make-multiarg-element (make-style "SacmBadgeRURL" multicommand-props)
(list (decode-string url) (list (decode-string url)
(decode-string str))) (decode-string str)))
(make-element (make-style "acmBadgeR" command-props) (make-element (make-style "acmBadgeR" command-props)
(decode-string str)))) (decode-string str)))))
(define (acmBadgeL #:url [url #f] str) (define (acmBadgeL #:url [url #f] str)
(make-paragraph (make-style 'pretitle '())
(if url (if url
(make-multiarg-element (make-style "SacmBadgeLURL" multicommand-props) (make-multiarg-element (make-style "SacmBadgeLURL" multicommand-props)
(list (decode-string url) (list (decode-string url)
(decode-string str))) (decode-string str)))
(make-element (make-style "acmBadgeL" command-props) (make-element (make-style "acmBadgeL" command-props)
(decode-string str)))) (decode-string str)))))
(define (received #:stage [s #f] str) (define (received #:stage [s #f] str)
(make-paragraph (make-style 'pretitle '())
(if s (if s
(make-multiarg-element (make-style "SreceivedStage" multicommand-props) (make-multiarg-element (make-style "SreceivedStage" multicommand-props)
(list (decode-string s) (list (decode-string s)
(decode-string str))) (decode-string str)))
(make-element (make-style "received" command-props) (make-element (make-style "received" command-props)
(decode-string str)))) (decode-string str)))))
(define (citestyle str) (define (citestyle str)
(make-paragraph (make-style 'pretitle '())
(make-element (make-style "citestyle" command-props) (make-element (make-style "citestyle" command-props)
(decode-string str))) (decode-string str))))
(define (ccsdesc #:number [n #f] str) (define (ccsdesc #:number [n #f] str)
(make-paragraph (make-style 'pretitle '())
(if n (if n
(make-multiarg-element (make-style "SccsdescNumber" multicommand-props) (make-multiarg-element (make-style "SccsdescNumber" multicommand-props)
(list (number->string n) (list (number->string n)
(decode-string str))) (decode-string str)))
(make-element (make-style "ccsdesc" command-props) (make-element (make-style "ccsdesc" command-props)
(decode-string str)))) (decode-string str)))))
(define (title #:tag [tag #f] (define (title #:tag [tag #f]
#:tag-prefix [prefix #f] #:tag-prefix [prefix #f]
@ -374,13 +361,12 @@
(maybe-element "postcode" affiliation-postcode) (maybe-element "postcode" affiliation-postcode)
(maybe-element "country" affiliation-country))))))) (maybe-element "country" affiliation-country)))))))
(define-commands subtitle (define-commands subtitle acmJournal
thanks titlenote subtitlenote authornote acmVolume acmNumber acmArticle acmYear acmMonth thanks titlenote subtitlenote authornote acmVolume acmNumber acmArticle acmYear acmMonth
acmArticleSeq acmPrice acmISBN acmDOI acmArticleSeq acmPrice acmISBN acmDOI
startPage terms keywords startPage terms keywords
setcopyright copyrightyear setcopyright copyrightyear
settopmatter ; could be "Rackety" settopmatter hortauthors)
shortauthors)
(define (CCSXML . strs) (define (CCSXML . strs)
(make-nested-flow (make-style "CCSXML" '()) (make-nested-flow (make-style "CCSXML" '())