diff --git a/collects/scribble/sigplan.rkt b/collects/scribble/sigplan.rkt index 0a6e8f68..e59d8085 100644 --- a/collects/scribble/sigplan.rkt +++ b/collects/scribble/sigplan.rkt @@ -12,6 +12,9 @@ [abstract (->* () () #:rest (listof pre-content?) block?)] + [subtitle + (->* () () #:rest (listof pre-content?) + content?)] [authorinfo (-> pre-content? pre-content? pre-content? block?)] @@ -83,9 +86,12 @@ ;; Authors and conference info: (define (authorinfo name affiliation e-mail) + ;; The \SAuthor macro in "style.tex" looks specifically + ;; for an \SAuthorinfo as its argument, and handles it + ;; specially in that case: (author (make-multiarg-element - (make-style "SAuthorinfo"sigplan-extras) + (make-style "SAuthorinfo" sigplan-extras) (list (make-element #f (decode-content (list name))) (make-element (make-style "SAuthorPlace" sigplan-extras) @@ -93,6 +99,10 @@ (make-element (make-style "SAuthorEmail" sigplan-extras) (decode-content (list e-mail))))))) +(define (subtitle . str) + (make-element (make-style "SSubtitle" (append '(aux) sigplan-extras)) + (decode-content str))) + (define (conferenceinfo what where) (make-paragraph (make-style 'pretitle null) diff --git a/collects/scribble/sigplan/sigplan.css b/collects/scribble/sigplan/sigplan.css index 1d7a9366..20413916 100644 --- a/collects/scribble/sigplan/sigplan.css +++ b/collects/scribble/sigplan/sigplan.css @@ -6,3 +6,8 @@ .SCategory, .SCategoryPlus, .STerms, .SKeywords { display: none; } + +.SSubtitle { + display: block; + font-size: smaller; +} \ No newline at end of file diff --git a/collects/scribble/sigplan/sigplan.tex b/collects/scribble/sigplan/sigplan.tex index b9c81c64..fd952882 100644 --- a/collects/scribble/sigplan/sigplan.tex +++ b/collects/scribble/sigplan/sigplan.tex @@ -16,3 +16,6 @@ \newcommand{\SCategoryPlus}[4]{} \newcommand{\STerms}[1]{} \newcommand{\SKeywords}[1]{} + +% Normally gets re-written by the title macro: +\newcommand{\SSubtitle}[1]{{\bf #1}} diff --git a/collects/scribble/sigplan/style.tex b/collects/scribble/sigplan/style.tex index 39f4f6b9..ff82de40 100644 --- a/collects/scribble/sigplan/style.tex +++ b/collects/scribble/sigplan/style.tex @@ -1,11 +1,28 @@ -\renewcommand{\titleAndVersionAndAuthors}[3]{\title{#1}#3\maketitle} +% Define \SXtitle to lift \SSubtitle out: +\def\SXtitle#1{\title{\let\SSubtitle\SSubtitleDrop#1}\SExtractSubtitle#1\SExtractSubtitleDone} +\def\SSubtitleDrop#1{} +\def\SExtractSubtitleDone {} +\def\SExtractSubtitle{\futurelet\next\SExtractSubtitleX} +\def\SExtractSubtitleX#1{\ifx#1\SSubtitle \let\Snext\SWithSubtitle \else \let\Snext\SExtractSubtitleY \fi \Snext} +\def\SExtractSubtitleY{\ifx\next\SExtractSubtitleDone \let\Snext\relax \else \let\Snext\SExtractSubtitle \fi \Snext} +\def\SWithSubtitle#1{\subtitle{#1}\SExtractSubtitle} + +\renewcommand{\titleAndVersionAndAuthors}[3]{\SXtitle{#1}#3\maketitle} \renewcommand{\titleAndEmptyVersionAndAuthors}[3]{\titleAndVersionAndAuthors{#1}{#2}{#3}} -\renewcommand{\titleAndVersionAndEmptyAuthors}[3]{\title{#1}\authorinfo{Anonymous}{}{}\maketitle} +\renewcommand{\titleAndVersionAndEmptyAuthors}[3]{\SXtitle{#1}\authorinfo{Anonymous}{}{}\maketitle} \renewcommand{\titleAndEmptyVersionAndEmptyAuthors}[3]{\titleAndVersionAndEmptyAuthors{#1}{#2}{#3}} -% Disable plain `author', enable `authorinfo:' -\renewcommand{\SAuthor}[1]{#1} +% Support plain `author' while enabling `authorinfo': for each +% use of \SAuthor, check whether it contains an \SAuthorinfo form: +\def\SAuthor#1{\SAutoAuthor#1\SAutoAuthorDone{#1}} +\def\SAutoAuthorDone#1{} +\def\SAutoAuthor{\futurelet\next\SAutoAuthorX} +\def\SAutoAuthorX{\ifx\next\SAuthorinfo \let\Snext\relax \else \let\Snext\SToAuthorDone \fi \Snext} +\def\SToAuthorDone{\futurelet\next\SToAuthorDoneX} +\def\SToAuthorDoneX#1{\ifx\next\SAutoAuthorDone \let\Snext\SAddAuthorInfo \else \let\Snext\SToAuthorDone \fi \Snext} +\newcommand{\SAddAuthorInfo}[1]{\authorinfo{#1}{}{}} + \renewcommand{\SAuthorinfo}[3]{\authorinfo{#1}{#2}{#3}} \renewcommand{\SAuthorSep}[1]{} diff --git a/collects/scribblings/scribble/sigplan.scrbl b/collects/scribblings/scribble/sigplan.scrbl index 761a3164..7a928f07 100644 --- a/collects/scribblings/scribble/sigplan.scrbl +++ b/collects/scribblings/scribble/sigplan.scrbl @@ -87,6 +87,10 @@ Similar to @racket[include-section], but incorporates the document in the specified module as an abstract. The document must have no title or sub-parts.} +@defproc[(subtitle [pre-content pre-content?] ...) element?]{ + +Use as the last argument to @racket[title] to specify a subtitle.} + @defproc[(authorinfo [name pre-content?] [affiliation pre-content?] [email pre-content?])