diff --git a/scribble-doc/scribblings/scribble/config.scrbl b/scribble-doc/scribblings/scribble/config.scrbl index f867fcd4..093fca40 100644 --- a/scribble-doc/scribblings/scribble/config.scrbl +++ b/scribble-doc/scribblings/scribble/config.scrbl @@ -75,7 +75,7 @@ a @racket[css-addition] structure instance to a style's @tech{style property} list. To map a style name to a Latex macro or environment, add a @racket[tex-addition] structure instance. A @racket[css-addition] or @racket[tex-addition] is normally associated with the style whose name -is implemented by the adition, but it can also be added to the style +is implemented by the addition, but it can also be added to the style for an enclosing part. Scribble includes a number of predefined styles that are used by the @@ -369,6 +369,7 @@ The style classes: add space before and after suitable for code.}] [@css{SCentered} @elem{For a @racket[nested-flow] created by @racket[centered]: horizontally centered.}] + [@css{SVerbatim} @elem{For a @racket[table] created by @racket[verbatim]: disables line breaks.}] [@spacer @spacer] @@ -630,7 +631,10 @@ style: with the @racket['code-inset] style name.} @item{@ltxe{SVInsetFlow} environment --- for a @racket[nested-flow] - with the @racket['vertical-inset] style name.} + with the @racket['vertical-inset] style name.} + + @item{@ltxe{SVerbatim} environment --- for a @racket[table] created + by @racket[verbatim].} @item{@ltxd[1]{SCodeBox}, @ltxd[1]{SVInsetBox} --- for a @racket[nested-flow] with the @racket['code-inset] or diff --git a/scribble-doc/scribblings/scribble/manual.scrbl b/scribble-doc/scribblings/scribble/manual.scrbl index 29ea2645..41ada18e 100644 --- a/scribble-doc/scribblings/scribble/manual.scrbl +++ b/scribble-doc/scribblings/scribble/manual.scrbl @@ -184,13 +184,14 @@ produces the typeset result [#:keep-lang-line? keep? any/c #t] [#:line-numbers line-numbers (or/c #f exact-nonnegative-integer?) #f] [#:line-number-sep line-number-sep exact-nonnegative-integer? 1] - [#:block? block? #t] + [#:block? return-block? any/c #t] [strs string?] ...) - block?]{ + (if return-block? block? element?)]{ A function-based version of @racket[codeblock], allowing you to compute the @racket[strs] arguments. Unlike @racket[codeblock], the default @racket[context] argument (@racket[#f]) implies that - the context is untouched. The other arguments are treated the same way. + the context is untouched and the @racket[return-block?] argument determines the result + structure. The other arguments are treated the same way as @racket[codeblock]. } @; ---------------------------------------- diff --git a/scribble-doc/scribblings/scribble/renderer.scrbl b/scribble-doc/scribblings/scribble/renderer.scrbl index ce7241fd..0242a65a 100644 --- a/scribble-doc/scribblings/scribble/renderer.scrbl +++ b/scribble-doc/scribblings/scribble/renderer.scrbl @@ -170,9 +170,9 @@ information on the @racket[dests] argument. The @racket[ci] argument is a result from the @method[render<%> collect] method.} @defmethod[(render [srcs (listof part?)] - [dests (listof path-string?)] + [dests (listof (or/c path-string? #f))] [ri resolve-info?]) - void?]{ + list?]{ Produces the final output. The @racket[ri] argument is a result from the @method[render<%> render] method. @@ -182,7 +182,11 @@ HTML output, or names of sub-directories for multi-file HTML output. If the @racket[dests] are relative, they're relative to the current directory; normally, they should indicates a path within the @racket[_dest-dir] supplied on initialization of the @racket[render%] -object.} +object. + +If an element of @racket[dests] is @racket[#f], then the corresponding +position of the result list contains a string for rendered document. +Some renderers require that @racket[dest] contains all path strings.} @defmethod[(serialize-info [ri resolve-info?]) @@ -299,7 +303,284 @@ list are more preferred. The renderer may not support all of the formats listed in @racket[image-preferences]. @history[#:changed "1.4" @elem{Added the @racket[image-preferences] - initialization argument.}]}} + initialization argument.}]} + +@defmethod[(traverse [parts (listof part?)] + [dests (listof path-string?)]) + (and/c hash? immutable?)] +@defmethod[(start-traverse [parts (listof part?)] + [dests (listof path-string?)] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-part [p part?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-flow [bs (listof block?)] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-block [b block?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-nested-flow [nf nested-flow?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-table [t table?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-itemization [i itemization?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-compound-paragraph [cp compound-paragraph?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-paragraph [p paragraph?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-content [c content?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-target-element [e target-element?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)] +@defmethod[(traverse-index-element [e index-element?] + [fp (and/c hash? immutable?)]) + (and/c hash? immutable?)]{ + +These methods implement the @tech{traverse pass} of document rendering. +Except for the entry point @method[render% traverse] as described by +as described at @xmethod[render<%> traverse], these methods +generally would not be called to render a document, but instead +provide natural points to interpose on the default implementation. + +A renderer for a specific format is relatively unlikely to override +any of these methods. Each method accepts the information accumulated +so far and returns augmented information as a result.} + + +@defmethod[(collect [parts (listof part?)] + [dests (listof path-string?)] + [fp (and/c hash? immutable?)] + [demand (tag? collect-info? . -> . any/c) (lambda (_tag _ci) #f)]) + collect-info?] +@defmethod[(start-collect [parts (listof part?)] + [dests (listof path-string?)] + [ci collect-info?]) + void?] +@defmethod[(collect-part [p part?] + [parent (or/c #f part?)] + [ci collect-info?] + [number (listof part-number-item?)] + [init-sub-number part-number-item?] + [init-sub-numberers (listof numberer?)]) + (values part-number-item? numberer?)] +@defmethod[(collect-part-tags [p part?] + [ci collect-info?] + [number (listof part-number-item?)]) + void?] +@defmethod[(collect-flow [bs (listof block?)] + [ci collect-info?]) + void?] +@defmethod[(collect-block [b block?] + [ci collect-info?]) + void?] +@defmethod[(collect-nested-flow [nf nested-flow?] + [ci collect-info?]) + void?] +@defmethod[(collect-table [t table?] + [ci collect-info?]) + void?] +@defmethod[(collect-itemization [i itemization?] + [ci collect-info?]) + void?] +@defmethod[(collect-compound-paragraph [cp compound-paragraph?] + [ci collect-info?]) + void?] +@defmethod[(collect-paragraph [p paragraph?] + [ci collect-info?]) + void?] +@defmethod[(collect-content [c content?] + [ci collect-info?]) + void?] +@defmethod[(collect-target-element [e target-element?] + [ci collect-info?]) + void?] +@defmethod[(collect-index-element [e index-element?] + [ci collect-info?]) + void?]{ + +These methods implement the @tech{collect pass} of document rendering. +Except for the entry point @method[render% collect] as described at +@xmethod[render<%> collect], these methods generally would not be +called to render a document, but instead provide natural points to +interpose on the default implementation. + +A renderer for a specific format is most likely to override +@method[render% collect-part-tags], @method[render% +collect-target-element], and perhaps @method[render% start-collect] to +set up and record cross-reference information in a way that is +suitable for the target format.} + +@defmethod[(resolve [parts (listof part?)] + [dests (listof path-string?)] + [ci collect-info?]) + resolve-info?] +@defmethod[(start-resolve [parts (listof part?)] + [dests (listof path-string?)] + [ri resolve-info?]) + void?] +@defmethod[(resolve-part [p part?] + [ri resolve-info?]) + void?] +@defmethod[(resolve-flow [bs (listof block?)] + [enclosing-p part?] + [ri resolve-info?]) + void?] +@defmethod[(resolve-block [b block?] + [enclosing-p part?] + [ri resolve-info?]) + void?] +@defmethod[(resolve-nested-flow [nf nested-flow?] + [enclosing-p part?] + [ri resolve-info?]) + void?] +@defmethod[(resolve-table [t table?] + [enclosing-p part?] + [ri resolve-info?]) + void?] +@defmethod[(resolve-itemization [i itemization?] + [enclosing-p part?] + [ri resolve-info?]) + void?] +@defmethod[(resolve-compound-paragraph [cp compound-paragraph?] + [enclosing-p part?] + [ri resolve-info?]) + void?] +@defmethod[(resolve-paragraph [p paragraph?] + [enclosing-p part?] + [ri resolve-info?]) + void?] +@defmethod[(resolve-content [c content?] + [enclosing-p part?] + [ri resolve-info?]) + void?]{ + +These methods implement the @tech{resolve pass} of document rendering. +Except for the entry point @method[render% resolve] as described at +@xmethod[render<%> resolve], these methods generally would not be +called to render a document, but instead provide natural points to +interpose on the default implementation. + +A renderer for a specific format is unlikely to override any of these +methods. Each method for a document fragment within a part receives +the enclosing part as an argument, as well as resolve information as +@racket[ri] to update.} + + +@defmethod[(render [parts (listof part?)] + [dests (listof (or/c path-string? #f))] + [ri resolve-info?]) + list?] +@defmethod[(render-one [part part?] + [ri resolve-info?] + [dest (or/c path-string? #f)]) + any/c] +@defmethod[(render-part [p part?] + [ri resolve-info?]) + any/c] +@defmethod[(render-part-content [p part?] + [ri resolve-info?]) + any/c] +@defmethod[(render-flow [bs (listof block?)] + [enclosing-p part?] + [ri resolve-info?] + [first-in-part-or-item? boolean?]) + any/c] +@defmethod[(render-block [b block?] + [enclosing-p part?] + [ri resolve-info?] + [first-in-part-or-item? boolean?]) + any/c] +@defmethod[(render-nested-flow [nf nested-flow?] + [enclosing-p part?] + [ri resolve-info?] + [first-in-part-or-item? boolean?]) + any/c] +@defmethod[(render-table [t table?] + [enclosing-p part?] + [ri resolve-info?] + [first-in-part-or-item? boolean?]) + any/c] +@defmethod[(render-auxiliary-table [t table?] + [enclosing-p part?] + [ri resolve-info?]) + any/c] +@defmethod[(render-itemization [i itemization?] + [enclosing-p part?] + [ri resolve-info?]) + any/c] +@defmethod[(render-compound-paragraph [cp compound-paragraph?] + [enclosing-p part?] + [ri resolve-info?] + [first-in-part-or-item? boolean?]) + any/c] +@defmethod[(render-intrapara-block [p paragraph?] + [enclosing-p part?] + [ri resolve-info?] + [first-in-compound-paragraph? boolean?] + [last-in-compound-paragraph? boolean?] + [first-in-part-or-item? boolean?]) + any/c] +@defmethod[(render-paragraph [p paragraph?] + [enclosing-p part?] + [ri resolve-info?]) + any/c] +@defmethod[(render-content [c content?] + [enclosing-p part?] + [ri resolve-info?]) + any/c] +@defmethod[(render-other [c (and/c content? (not/c element?) (not/c convertible?))] + [enclosing-p part?] + [ri resolve-info?]) + any/c]{ + +These methods implement the @tech{render pass} of document rendering. +Except for the entry point @method[render% render] as described at +@xmethod[render<%> render], these methods generally would not be +called to render a document, but instead provide natural points to +interpose on the default implementation. + +A renderer for a specific format is likely to override most or all of +these methods. The result of each method can be anything, and the +default implementations of the methods propagate results and collect +them into a list as needed. The value of @racket[current-output-port] +is set by @method[render% render] for each immediate @racket[part] +before calling @method[render% render-one], so methods might +individually print to render, or they might return values that are +used both other methods to print. The interposition points for this +pass are somewhat different than for other passes: + +@itemlist[ + + @item{@method[render% render-one] is called by the @method[render% + render] method on each immediate @racket[part] in the list for + its first argument.} + + @item{@method[render% render-auxiliary-table] is called by the + default @method[render% render-block] on any @racket[table] + that has the @racket['aux] @tech{style property}.} + + @item{@method[render% render-intrapara-block] is called on blocks + within a @racket[compound-paragraph], where the default + implementation just chains to @racket[render% render-block].} + + + @item{@method[render% render-other] is called by the default + implementation of @racket[render-content] for any content that + does not satisfy @racket[element?] or @racket[convertible?].} + +]} + +} @; ---------------------------------------- diff --git a/scribble-lib/scribble/acmart/acmart.cls b/scribble-lib/scribble/acmart/acmart.cls index 95abbe42..eb1f7e5a 100644 --- a/scribble-lib/scribble/acmart/acmart.cls +++ b/scribble-lib/scribble/acmart/acmart.cls @@ -37,7 +37,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{acmart} -[2018/07/16 v1.54 Typesetting articles for the Association for +[2018/08/12 v1.55 Typesetting articles for the Association for Computing Machinery] \def\@classname{acmart} \InputIfFileExists{acmart-preload-hook.tex}{% @@ -260,7 +260,7 @@ Computing Machinery] \def\@tempb{compress}\ifx\@tempa\@tempb \def\NAT@cmprs{\@ne}\fi \def\@tempb{nocompress}\ifx\@tempa\@tempb - \def\NAT@cmprs{\@z}\fi + \def\NAT@cmprs{\z@}\fi \def\@tempb{sort&compress}\ifx\@tempa\@tempb \def\NAT@sort{\@ne}\def\NAT@cmprs{\@ne}\fi \def\@tempb{mcite}\ifx\@tempa\@tempb @@ -2159,14 +2159,15 @@ Computing Machinery] \def\@mkbibcitation{\bgroup \def\@pages@word{\ifnum\getrefnumber{TotPages}=1\relax page\else pages\fi}% \def\footnotemark{}% - \def\\{\unskip{}, \ignorespaces}% + \def\\{\unskip{} \ignorespaces}% \def\footnote{\ClassError{\@classname}{Please do not use footnotes inside a \string\title{} or \string\author{} command! Use \string\titlenote{} or \string\authornote{} instead!}}% \def\@article@string{\ifx\@acmArticle\@empty{\ }\else, Article~\@acmArticle\ \fi}% \par\medskip\small\noindent{\bfseries ACM Reference Format:}\par\nobreak - \noindent\authors. \@acmYear. \@title + \noindent\bgroup + \def\\{\unskip{}, \ignorespaces}\authors\egroup. \@acmYear. \@title \ifx\@subtitle\@empty. \else: \@subtitle. \fi \if@ACM@nonacm\else % The 'nonacm' option disables 'printacmref' by default, diff --git a/scribble-lib/scribble/base-render.rkt b/scribble-lib/scribble/base-render.rkt index 8d774514..bd8ad69c 100644 --- a/scribble-lib/scribble/base-render.rkt +++ b/scribble-lib/scribble/base-render.rkt @@ -745,7 +745,7 @@ ri)) (define/public (start-resolve ds fns ri) - (map (lambda (d) (resolve-part d ri)) ds)) + (for-each (lambda (d) (resolve-part d ri)) ds)) (define/public (resolve-part d ri) (parameterize ([current-tag-prefixes diff --git a/scribble-lib/scribble/base.rkt b/scribble-lib/scribble/base.rkt index fd2f1ed5..ccfe8036 100644 --- a/scribble-lib/scribble/base.rkt +++ b/scribble-lib/scribble/base.rkt @@ -759,7 +759,7 @@ ;; and non-strings --- to a paragraph for the line: (let* ([line (indent (strs->elts line))]) (list (make-paragraph omitable-style (make-nonempty line))))) - (make-table plain (map make-line lines))) + (make-table (make-style "SVerbatim" null) (map make-line lines))) (define omitable-style (make-style 'omitable null)) diff --git a/scribble-lib/scribble/html-render.rkt b/scribble-lib/scribble/html-render.rkt index 046b8294..4d08ac74 100644 --- a/scribble-lib/scribble/html-render.rkt +++ b/scribble-lib/scribble/html-render.rkt @@ -1937,6 +1937,7 @@ (define/override (start-collect ds fns ci) (parameterize ([current-part-files (make-hash)]) (for-each (lambda (d fn) + (check-duplicate-filename fn) (parameterize ([collecting-sub (if (part-style? d 'non-toc) 1 diff --git a/scribble-lib/scribble/latex-render.rkt b/scribble-lib/scribble/latex-render.rkt index 546b6f43..78eaf307 100644 --- a/scribble-lib/scribble/latex-render.rkt +++ b/scribble-lib/scribble/latex-render.rkt @@ -1136,6 +1136,7 @@ [(#\↓) "$\\downarrow$"] [(#\⇒) "$\\Rightarrow$"] [(#\→) "$\\rightarrow$"] + [(#\⟶) "$\\longrightarrow$"] [(#\↘) "$\\searrow$"] [(#\↙) "$\\swarrow$"] [(#\←) "$\\leftarrow$"] diff --git a/scribble-lib/scribble/scribble.css b/scribble-lib/scribble/scribble.css index b1ff5b53..7da66740 100644 --- a/scribble-lib/scribble/scribble.css +++ b/scribble-lib/scribble/scribble.css @@ -452,6 +452,10 @@ ol ol ol ol { list-style-type: upper-alpha; } border: 0; } +.SVerbatim { + white-space: nowrap; +} + .SAuthorListBox { position: relative; float: right; diff --git a/scribble-lib/scribble/scribble.tex b/scribble-lib/scribble/scribble.tex index 30ae3d36..1905e892 100644 --- a/scribble-lib/scribble/scribble.tex +++ b/scribble-lib/scribble/scribble.tex @@ -387,6 +387,9 @@ % Helper for box-mode macros: \newcommand{\Svcenter}[1]{$\vcenter{#1}$} +% Verbatim +\newenvironment{SVerbatim}{}{} + % Helper to work around a problem with "#"s for URLs within \href % within other macros: \newcommand{\Shref}[3]{\href{#1\##2}{#3}}