add scribble/jfp
svn: r18507
This commit is contained in:
parent
c1640d005f
commit
826fbdf16f
66
collects/scribble/jfp.ss
Normal file
66
collects/scribble/jfp.ss
Normal file
|
@ -0,0 +1,66 @@
|
|||
#lang scheme/base
|
||||
(require setup/main-collects
|
||||
scribble/core
|
||||
(except-in scribble/base author)
|
||||
scribble/decode
|
||||
scribble/html-properties
|
||||
scribble/latex-properties
|
||||
(for-syntax scheme/base))
|
||||
|
||||
(provide abstract include-abstract
|
||||
author author/short
|
||||
affiliation affiliation-mark affiliation-sep)
|
||||
|
||||
(define jfp-extras
|
||||
(let ([abs (lambda (s)
|
||||
(path->main-collects-relative
|
||||
(build-path (collection-path "scribble") "jfp" s)))])
|
||||
(list
|
||||
(make-css-addition (abs "jfp.css"))
|
||||
(make-tex-addition (abs "jfp.tex")))))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Abstracts:
|
||||
|
||||
(define abstract-style (make-style "abstract" jfp-extras))
|
||||
|
||||
(define (abstract . strs)
|
||||
(make-nested-flow
|
||||
abstract-style
|
||||
(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))))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Author
|
||||
|
||||
(define (author . long)
|
||||
(apply (apply author/short long) long))
|
||||
|
||||
(define ((author/short . short) . long)
|
||||
(make-paragraph
|
||||
(make-style 'author jfp-extras)
|
||||
(list
|
||||
(make-multiarg-element "JFPAuthor" (list (decode-content short)
|
||||
(decode-content long))))))
|
||||
|
||||
(define (affiliation . txt)
|
||||
(make-element (make-style "Affiliation" jfp-extras) (decode-content txt)))
|
||||
|
||||
(define (affiliation-mark . txt)
|
||||
(make-element (make-style "MarkSuperscript" jfp-extras) (decode-content txt)))
|
||||
|
||||
(define (affiliation-sep)
|
||||
(hspace 2))
|
1095
collects/scribble/jfp/jfp.cls
Normal file
1095
collects/scribble/jfp/jfp.cls
Normal file
File diff suppressed because it is too large
Load Diff
5
collects/scribble/jfp/jfp.tex
Normal file
5
collects/scribble/jfp/jfp.tex
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
\newcommand{\Affiliation}[1]{\\ #1}
|
||||
\newcommand{\MarkSuperscript}[1]{$^{#1}$}
|
||||
|
||||
\newcommand{\JFPAuthor}[2]{\author[#1]{#2}}
|
31
collects/scribble/jfp/lang.ss
Normal file
31
collects/scribble/jfp/lang.ss
Normal file
|
@ -0,0 +1,31 @@
|
|||
#lang scheme/base
|
||||
(require scribble/doclang
|
||||
scribble/core
|
||||
(except-in scribble/base author)
|
||||
scribble/decode
|
||||
scribble/jfp
|
||||
"../private/defaults.ss"
|
||||
(for-syntax scheme/base))
|
||||
(provide (except-out (all-from-out scribble/doclang) #%module-begin)
|
||||
(all-from-out scribble/jfp)
|
||||
(all-from-out scribble/base)
|
||||
(rename-out [module-begin #%module-begin]))
|
||||
|
||||
;; No options, currently, but keep in case we want to support some:
|
||||
(define-syntax (module-begin stx)
|
||||
(syntax-case* stx () (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 . body)
|
||||
#'(#%module-begin id (post-process) () . body)]))
|
||||
|
||||
(define ((post-process) doc)
|
||||
(add-defaults doc
|
||||
(string->bytes/utf-8
|
||||
(format "\\documentclass{jfp}\n\\usepackage{times}\n\\usepackage{qcourier}\n"))
|
||||
(scribble-file "jfp/style.tex")
|
||||
(list (scribble-file "jfp/jfp.cls"))
|
||||
#f))
|
15
collects/scribble/jfp/lang/reader.ss
Normal file
15
collects/scribble/jfp/lang/reader.ss
Normal file
|
@ -0,0 +1,15 @@
|
|||
#lang s-exp syntax/module-reader
|
||||
|
||||
scribble/jfp/lang
|
||||
|
||||
#:read scribble:read-inside
|
||||
#:read-syntax scribble:read-syntax-inside
|
||||
#:whole-body-readers? #t
|
||||
#:wrapper1 (lambda (t) (cons 'doc (t)))
|
||||
#:info (lambda (key defval default)
|
||||
(case key
|
||||
[(color-lexer)
|
||||
(dynamic-require 'syntax-color/scribble-lexer 'scribble-inside-lexer)]
|
||||
[else (default key defval)]))
|
||||
|
||||
(require (prefix-in scribble: "../../reader.ss"))
|
3
collects/scribble/jfp/style.tex
Normal file
3
collects/scribble/jfp/style.tex
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
\renewcommand{\titleAndVersionAndAuthors}[3]{\title[#2]{#1}#3\maketitle}
|
||||
\renewcommand{\titleAndEmptyVersionAndAuthors}[3]{\titleAndVersionAndAuthors{#1}{#1}{#3}}
|
|
@ -8,3 +8,5 @@
|
|||
@include-section["base.scrbl"]
|
||||
@include-section["manual-stub.scrbl"]
|
||||
@include-section["sigplan.scrbl"]
|
||||
@include-section["jfp.scrbl"]
|
||||
|
||||
|
|
55
collects/scribblings/scribble/jfp.scrbl
Normal file
55
collects/scribblings/scribble/jfp.scrbl
Normal file
|
@ -0,0 +1,55 @@
|
|||
#lang scribble/manual
|
||||
@(require (except-in "utils.ss" author)
|
||||
(for-label scribble/jfp))
|
||||
|
||||
@(define-syntax-rule (def base-author)
|
||||
(begin
|
||||
(require (for-label scribble/base))
|
||||
(define base-author @scheme[author])))
|
||||
@(def base-author)
|
||||
|
||||
@title{JFP Paper Format}
|
||||
|
||||
@defmodulelang[scribble/jfp]{The @schememodname[scribble/jfp]
|
||||
language is like @schememodname[scribble/manual], but configured with
|
||||
Latex style defaults to use the @filepath{jfp.cls} class
|
||||
file that is included with Scribble.}
|
||||
|
||||
Latex output with @schememodname[scribble/jfp] uses a main-document
|
||||
version supplied to @scheme[title] as the short-form document name (to
|
||||
be used in page headers).
|
||||
|
||||
@defproc[(abstract [pre-content pre-content?] ...) block?]{
|
||||
|
||||
Generates a @tech{nested flow} for a paper abstract.}
|
||||
|
||||
@defform[(include-abstract module-path)]{
|
||||
|
||||
Similar to @scheme[include-section], but incorporates the document in the
|
||||
specified module as an abstract. The document must have no title or
|
||||
sub-parts.}
|
||||
|
||||
@defproc[(author [name pre-content?] ...)
|
||||
block?]{
|
||||
|
||||
A replacement for @base-author from @schememodname[scribble/base].}
|
||||
|
||||
@defproc[((author/short [short-name pre-content?] ...) [long-name pre-content?] ...)
|
||||
block?]{
|
||||
|
||||
Like @scheme[author], but allows the short-form names (to be used in
|
||||
page headers) to be specified separately from the long-form name.}
|
||||
|
||||
@deftogether[(
|
||||
@defproc[(affiliation [place pre-content?] ...) element?]
|
||||
@defproc[(affiliation-mark [mark pre-content?] ...) element?]
|
||||
@defproc[(affiliation-sep) element?]
|
||||
)]{
|
||||
|
||||
Use @scheme[affiliation] within @scheme[author] or the long-name part
|
||||
of @scheme[author/short] to specify affiliations after all authors.
|
||||
If different authors have different affiliations, use
|
||||
@scheme[affiliation-mark] with a number after each author, and then
|
||||
use @scheme[affiliation-mark] before each different affiliation within
|
||||
a single @scheme[affiliation], using @scheme[(affiliation-sep)] to
|
||||
separate affiliations.}
|
|
@ -26,7 +26,7 @@ Generates a @tech{nested flow} for a paper abstract.}
|
|||
|
||||
@defform[(include-abstract module-path)]{
|
||||
|
||||
Similar to @scheme[include-path], but incorporates the document in the
|
||||
Similar to @scheme[include-section], but incorporates the document in the
|
||||
specified module as an abstract. The document must have no title or
|
||||
sub-parts.}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ coerced to one.
|
|||
|
||||
|
||||
@deftogether[(
|
||||
@defproc[(make-styled-paragraph [style any/c][content list?]) paragraph?]
|
||||
@defproc[(make-styled-paragraph [content list?][style any/c]) paragraph?]
|
||||
@defproc[(styled-paragraph? [v any/c]) boolean?]
|
||||
@defproc[(styled-paragraph-style [p paragraph?]) style?]
|
||||
)]{
|
||||
|
|
Loading…
Reference in New Issue
Block a user