scribble: more control over version formatting

Add "Version" in front of a version name via `.version:before' or
`.versionNoNav:before' and `\SVersionBefore', so that they can
be configured through overriding CSS or Latex macro declarations.

Also, improve the documentation for how the `#:version' argument
of `title' is propagated to a `part' style property.

Closes PR 13227

original commit: a830f77403a1f51de7359c7946b01ef10d401cee
This commit is contained in:
Matthew Flatt 2012-11-02 07:39:33 -06:00
parent b951c48fca
commit 8002d98e5d
5 changed files with 20 additions and 8 deletions

View File

@ -890,7 +890,7 @@
(list (make-element (if (include-navigation?)
"version"
"versionNoNav")
(list "Version: " v)))
v))
d
ri))))))

View File

@ -154,6 +154,10 @@ table td {
font-size: xx-small; /* avoid overlap with author */
}
.version:before, .versionNoNav:before {
content: "Version ";
}
/* ---------------------------------------- */
/* Margin notes */

View File

@ -141,12 +141,13 @@
\newenvironment{refcolumnleft}{\begin{refcolumn}}{\end{refcolumn}}
% Macros used by `title' and `author':
\newcommand{\titleAndVersionAndAuthors}[3]{\title{#1\\{\normalsize Version #2}}\author{#3}\maketitle}
\newcommand{\titleAndVersionAndEmptyAuthors}[3]{\title{#1\\{\normalsize Version #2}}#3\maketitle}
\newcommand{\titleAndVersionAndAuthors}[3]{\title{#1\\{\normalsize \SVersionBefore{}#2}}\author{#3}\maketitle}
\newcommand{\titleAndVersionAndEmptyAuthors}[3]{\title{#1\\{\normalsize \SVersionBefore{}#2}}#3\maketitle}
\newcommand{\titleAndEmptyVersionAndAuthors}[3]{\title{#1}\author{#3}\maketitle}
\newcommand{\titleAndEmptyVersionAndEmptyAuthors}[3]{\title{#1}\maketitle}
\newcommand{\SAuthor}[1]{#1}
\newcommand{\SAuthorSep}[1]{\qquad}
\newcommand{\SVersionBefore}[1]{Version }
% Useful for some styles, such as sigalternate:
\newcommand{\SNumberOfAuthors}[1]{}

View File

@ -400,7 +400,12 @@ The recognized @tech{style properties} are as follows:
not @racket[""] may be used when rendering a document; at a
minimum, a non-@racket[""] version is rendered when it is
attached to a part representing the whole document. The default
version for a document is @racket[(version)].}
version for a document is @racket[(version)]. In rendered form,
the version is normally prefixed with the word ``Version,'' but
this formatting can be controlled by overriding
@tt{.version:before} and/or @tt{.versionNoNav:before} in CSS
for HTML rendering or by redefining the @tt{\SVersionBefore}
macro for Latex rendering (see @secref["config"]).}
@item{@racket[document-date] structure --- A date for the part,
normally used on a document's main part for for Latex

View File

@ -168,18 +168,20 @@ otherwise.}
@defstruct[title-decl ([tag-prefix (or/c #f string?)]
[tags (listof string?)]
[version (or/c string? #f)]
[style any/c]
[style style?]
[content content?])]{
See @racket[decode] and @racket[decode-part]. The @racket[_tag-prefix]
and @racket[_style] fields are propagated to the resulting
See @racket[decode] and @racket[decode-part]. The @racket[tag-prefix]
and @racketidfont{style} fields are propagated to the resulting
@racket[part]. If the @racketidfont{version} field is not @racket[#f],
it is propagated as a @racket[document-version] style property on the
@racket[part].}
@defstruct[part-start ([depth integer?]
[tag-prefix (or/c #f string?)]
[tags (listof string?)]
[style any/c]
[style style?]
[title content?])]{
Like @racket[title-decl], but for a sub-part. See @racket[decode] and