commit 916c17231783684972c869cf40ce43e648ba14bf
parent 7d2cc65acd652aa4546edff505b8b08b6cc86cac
Author: Suzanne Soy <ligo@suzanne.soy>
Date: Tue, 6 Jul 2021 02:42:10 +0100
Merge tag 'v7.1' into my-changes-rebased
Diffstat:
14 files changed, 416 insertions(+), 152 deletions(-)
diff --git a/scribble-doc/scribblings/scribble/acmart.scrbl b/scribble-doc/scribblings/scribble/acmart.scrbl
@@ -58,6 +58,10 @@ all mutually exclusive.}
@defidform[natbib]
@defidform[anonymous]
@defidform[authorversion]
+@defidform[nonacm]
+@defidform[timestamp]
+@defidform[authordraft]
+@defidform[acmthm]
@defidform[9pt]
@defidform[10pt]
@defidform[11pt]
@@ -74,6 +78,53 @@ number of options may be used:
}|
If multiple font size options are used, all but the last are ignored.
+
+The @link["https://www.acm.org/binaries/content/assets/publications/consolidated-tex-template/acmart.pdf"
+ ]{ACM documentation} (version 1.54, 2018-07-16, by Boris
+Veytsman) provides these defaults and descriptions:
+
+@tabular[#:style 'boxed
+ #:sep @hspace[1]
+ ;#:column-properties '(left left left)
+ #:row-properties '(bottom-border ())
+ (list
+ (list @bold{name} @bold{default} @bold{description})
+ (list "review" "false"
+ "A review version: lines are numbered and\
+ hyperlinks are colored")
+ (list "screen" "see text"
+ "A screen version: hyperlinks are colored")
+ (list "natbib" "true"
+ "Whether to use the natbib package")
+ (list "anonymous"
+ "false"
+ "Whether to make author(s) anonymous")
+ (list "authorversion"
+ "false"
+ "Whether to generate a special version\
+ for the authors’ personal use or posting")
+ ;; these options are documented in ACM docs but don't
+ ;; appear to exist in the scribble acmart format:
+ (list "nonacm" "false"
+ "Use the class typesetting options for a non-ACM\
+ document, which will not include the conference/journal\
+ header and footers or permission statements")
+ (list "timestamp" "false"
+ "Whether to put a time stamp in the footer\
+ of each page")
+ (list "authordraft" "false"
+ "Whether author’s-draft mode is enabled")
+ (list "acmthm" "true"
+ "Whether to define theorem-like environments"))]
+
+Further details for some of these are provided by the full
+documentation for the acmart LaTeX class.
+
+In order to disable a default-true option (e.g. @racket[natbib]), call
+the option as a function with the value @racket[#false]:
+
+@code|{#lang scribble/acmart @natbib[#f] @sigplan}|
+
}
@defproc[(abstract [pre-content pre-content?] ...) block?]{
@@ -223,6 +274,11 @@ screen version of the image links to the badge authority.
@history[#:added "1.26"]}
+@defproc[(shortauthors [name pre-content?] ...) element?]{
+ Sets the text for the names of the authors in the running header.
+
+ @history[#:added "1.29"]}
+
@deftogether[(
@defproc[(terms [content pre-content?] ...) content?]
@defproc[(keywords [content pre-content?] ...) content?]
@@ -302,7 +358,7 @@ sponsors, @racket[name] is the name of the sponsor. The
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/acmart
@acks{
- The author thanks Benjamin Greenman for helpful comments on this
+ The author thanks Ben Greenman for helpful comments on this
code. Financial support provided by the @grantsponsor["NSF7000"
"National Scribble Foundation"]{http://racket-lang.org} under
grant No.: @grantnum["NSF7000"]{867-5309}.}
diff --git a/scribble-doc/scribblings/scribble/bnf.scrbl b/scribble-doc/scribblings/scribble/bnf.scrbl
@@ -1,6 +1,7 @@
#lang scribble/doc
@(require scribble/manual "utils.rkt" scribble/bnf
- (for-label scribble/bnf))
+ ;; "utils.rkt" provides scribble/bnf for-label
+ )
@title[#:tag "bnf"]{BNF Grammars}
@@ -43,44 +44,48 @@ produces the output
See also @racket[racketgrammar].
-@defproc[(BNF [prod (cons element? (listof (or/c block? element?)))] ...) table?]{
+@defproc[(BNF [prod (cons/c (or/c block? content?)
+ (non-empty-listof (or/c block? content?)))]
+ ...)
+ table?]{
Typesets a grammar table. Each production starts with an element
(typically constructed with @racket[nonterm]) for the non-terminal
being defined, and then a list of possibilities (typically constructed
with @racket[BNF-seq], etc.) to show on separate lines.}
-@defproc[(nonterm (pre-content any/c) ...) element?]{
+@defproc[(nonterm [pre-content pre-content?] ...) element?]{
Typesets a non-terminal: italic in angle brackets.}
-@defproc[(BNF-seq [elem element?] ...) element?]{
+@defproc[(BNF-seq [elem content?] ...) (or/c element? "")]{
Typesets a sequence.}
-@defproc[(BNF-seq-lines [elems (listof element?)] ...) block?]{
+@defproc[(BNF-seq-lines [elems (listof content?)] ...) block?]{
Typesets a sequence that is broken into multiple lines, where each
@racket[elems] is one line.}
-@defproc[(BNF-group [pre-content any/c] ...) element?]{
+@defproc[(BNF-group [pre-content pre-content?] ...) element?]{
Typesets a group surrounded by curly braces (so the entire group can
be repeated, for example).}
-@defproc[(optional [pre-content any/c] ...) element?]{
+@defproc[(optional [pre-content pre-content?] ...) element?]{
Typesets an optional element: in square brackets.}
-@defproc[(kleenestar [pre-content any/c] ...) element?]{
+@defproc[(kleenestar [pre-content pre-content?] ...) element?]{
Typesets a 0-or-more repetition.}
-@defproc[(kleeneplus [pre-content any/c] ...) element?]{
+@defproc[(kleeneplus [pre-content pre-content?] ...) element?]{
Typesets a 1-or-more repetition.}
-@defproc[(kleenerange [n any/c] [m any/c] [pre-content any/c] ...) element?]{
+@defproc[(kleenerange [n any/c] [m any/c] [pre-content pre-content?] ...)
+ element?]{
Typesets a @racket[n]-to-@racket[m] repetition. The @racket[n] and
@racket[m] arguments are converted to a string using @racket[(format
@@ -92,6 +97,14 @@ Typesets alternatives for a production's right-hand side to appear on
a single line. The result is normally used as a single possibility in
a production list for @racket[BNF].}
-@defthing[BNF-etc string?]{
+@; BNF-alt/close is exported but undocumented.
+@; It looks like it produces a more densely packed version of
+@; BNF-alt, but I haven't confirmed this.
+
+@defthing[BNF-etc element?]{
+
+An element to use for omitted productions or content.
+Renders as: @BNF-etc
+}
+
-A string to use for omitted productions or content.}
diff --git a/scribble-doc/scribblings/scribble/core.scrbl b/scribble-doc/scribblings/scribble/core.scrbl
@@ -137,7 +137,7 @@ A @deftech{block} is either a @techlink{table}, an
output may be collapsed togther or replaced
with a line break. In the style
@racket['hspace], all text is converted to
- uncollapsable spaces that cannot be broken
+ uncollapsible spaces that cannot be broken
across lines.}
@item{A symbol content is either @racket['mdash],
diff --git a/scribble-doc/scribblings/scribble/manual.scrbl b/scribble-doc/scribblings/scribble/manual.scrbl
@@ -263,7 +263,7 @@ produces
(+ 1 (unsyntax (elem (racket x) (subscript "2"))))
]
-The @racket[escape-id] that defaults to @racket[unsyntax] is regonized via
+The @racket[escape-id] that defaults to @racket[unsyntax] is recognized via
@racket[free-identifier=?], so a binding can hide the escape behavior:
@RACKETBLOCK[
@@ -1909,7 +1909,8 @@ order as given.}
[#:author author (or/c #f pre-content?) #f]
[#:location location (or/c #f pre-content?) #f]
[#:date date (or/c #f pre-content?) #f]
- [#:url url (or/c #f pre-content?) #f])
+ [#:url url (or/c #f pre-content?) #f]
+ [#:note note (or/c #f pre-content?) #f])
bib-entry?]{
Creates a bibliography entry. The @racket[key] is used to refer to the
@@ -1942,7 +1943,12 @@ the entry:
bibliography using @racket[tt] and hyperlinked, or it is
omitted if given as @racket[#f].}
-]}
+ @item{@racket[note] is an optional comment about the work. It is typeset
+ in the bibliography as given, and appears directly after the date
+ (or URL, if given) with no space or punctuation in between.}
+]
+
+@history[#:changed "1.29" @elem{Added the @racket[#:note] option.}]}
@defproc[(bib-entry? [v any/c]) boolean?]{
diff --git a/scribble-lib/help/search.rkt b/scribble-lib/help/search.rkt
@@ -39,11 +39,16 @@
(string->url
(format "q?~a" query)))
null))])))]
- [else
- (let* ([path (build-path (find-user-doc-dir) sub)]
- [path (if (file-exists? path) path (build-path (find-doc-dir) sub))])
- (notify path)
- (send-url/file path #:fragment fragment #:query query))]))
+ [else
+ (let* ([path (build-path (find-user-doc-dir) sub)]
+ [path (if (file-exists? path) path (build-path (find-doc-dir) sub))])
+ (notify path)
+ (if (file-exists? path)
+ (send-url/file path #:fragment fragment #:query query)
+ (let ([part (lambda (pfx x) (if x (string-append pfx x) ""))])
+ (send-url (string-append
+ "https://docs.racket-lang.org/"
+ sub (part "#" fragment) (part "?" query))))))]))
;; This is an example of changing this code to use the online manuals.
;; Normally, it's better to set `doc-open-url` in "etc/config.rktd",
diff --git a/scribble-lib/info.rkt b/scribble-lib/info.rkt
@@ -23,4 +23,4 @@
(define pkg-authors '(mflatt eli))
-(define version "1.28")
+(define version "1.29")
diff --git a/scribble-lib/scribble/acmart.rkt b/scribble-lib/scribble/acmart.rkt
@@ -50,6 +50,10 @@
()
#:rest (listof pre-content?)
block?)]
+ [shortauthors (->* ()
+ ()
+ #:rest (listof pre-content?)
+ element?)]
[institution (->* ()
(#:departments (listof (or/c pre-content? institution?)))
#:rest pre-content?
@@ -310,6 +314,10 @@
(make-element (make-style "authorsaddresses" command-props)
(decode-content content))))
+(define (shortauthors . content)
+ (make-element (make-style "Sshortauthors" command-props)
+ (decode-content content)))
+
(define (institution #:departments [departments '()]
. name)
(author-institution name departments))
diff --git 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/04/14 v1.53 Typesetting articles for the Association for
+[2018/07/16 v1.54 Typesetting articles for the Association for
Computing Machinery]
\def\@classname{acmart}
\InputIfFileExists{acmart-preload-hook.tex}{%
@@ -96,6 +96,18 @@ Computing Machinery]
\fi}{\PackageError{\@classname}{The option authorversion can be either true or
false}}
\ExecuteOptionsX{authorversion=false}
+\define@boolkey+{acmart.cls}[@ACM@]{nonacm}[true]{%
+ \if@ACM@nonacm
+ \PackageInfo{\@classname}{Using nonacm mode}%
+ \AtBeginDocument{\@ACM@printacmreffalse}%
+ % in 'nonacm' mode we disable the "ACM Reference Format"
+ % printing by default, but this can be re-enabled by the
+ % user using \settopmatter{printacmref=true}
+ \else
+ \PackageInfo{\@classname}{Not using nonacm mode}%
+ \fi}{\PackageError{\@classname}{The option nonacm can be either true or
+ false}}
+\ExecuteOptionsX{nonacm=false}
\define@boolkey+{acmart.cls}[@ACM@]{natbib}[true]{%
\if@ACM@natbib
\PackageInfo{\@classname}{Explicitly selecting natbib mode}%
@@ -410,6 +422,32 @@ Computing Machinery]
\def\l@section{\@tocline{1}{0pt}{1pc}{2pc}{}}
\def\l@subsection{\@tocline{2}{0pt}{1pc}{3pc}{}}
\def\l@subsubsection{\@tocline{2}{0pt}{1pc}{5pc}{}}
+\def\@makefntext{\noindent\@makefnmark}
+\if@ACM@sigchiamode
+\long\def\@footnotetext#1{\marginpar{%
+ \reset@font\small
+ \interlinepenalty\interfootnotelinepenalty
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark
+ }%
+ \color@begingroup
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+ \color@endgroup}}%
+\fi
+\long\def\@mpfootnotetext#1{%
+ \global\setbox\@mpfootins\vbox{%
+ \unvbox\@mpfootins
+ \reset@font\footnotesize
+ \hsize\columnwidth
+ \@parboxrestore
+ \protected@edef\@currentlabel
+ {\csname p@mpfootnote\endcsname\@thefnmark}%
+ \color@begingroup\centering
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+ \color@endgroup}}
+\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}}
\let\@footnotemark@nolink\@footnotemark
\let\@footnotetext@nolink\@footnotetext
\RequirePackage[bookmarksnumbered,unicode]{hyperref}
@@ -442,7 +480,9 @@ Computing Machinery]
filecolor=ACMDarkBlue}
\else
\hypersetup{hidelinks}
- \fi}
+ \fi
+ \hypersetup{pdflang={English},
+ pdfdisplaydoctitle}}
\if@ACM@natbib
\let\citeN\cite
\let\cite\citep
@@ -586,32 +626,6 @@ Computing Machinery]
\color@endgroup
\egroup
\expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}
-\def\@makefntext{\noindent\@makefnmark}
-\if@ACM@sigchiamode
-\long\def\@footnotetext#1{\marginpar{%
- \reset@font\small
- \interlinepenalty\interfootnotelinepenalty
- \protected@edef\@currentlabel{%
- \csname p@footnote\endcsname\@thefnmark
- }%
- \color@begingroup
- \@makefntext{%
- \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
- \color@endgroup}}%
-\fi
-\long\def\@mpfootnotetext#1{%
- \global\setbox\@mpfootins\vbox{%
- \unvbox\@mpfootins
- \reset@font\footnotesize
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel
- {\csname p@mpfootnote\endcsname\@thefnmark}%
- \color@begingroup\centering
- \@makefntext{%
- \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
- \color@endgroup}}
-\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}}
\def\@textbottom{\vskip \z@ \@plus 1pt}
\let\@texttop\relax
\RequirePackage{iftex}
@@ -621,9 +635,9 @@ Computing Machinery]
\pdfglyphtounicode{f_f_i}{FB03}
\pdfglyphtounicode{f_f_l}{FB04}
\pdfglyphtounicode{f_i}{FB01}
-\pdfglyphtounicode{t_t}{00740074}
-\pdfglyphtounicode{f_t}{00660074}
-\pdfglyphtounicode{T_h}{00540068}
+\pdfglyphtounicode{t_t}{0074 0074}
+\pdfglyphtounicode{f_t}{0066 0074}
+\pdfglyphtounicode{T_h}{0054 0068}
\pdfgentounicode=1
\fi
\RequirePackage{cmap}
@@ -639,6 +653,7 @@ Computing Machinery]
have the newtxmath package installed. Please upgrade your
TeX}\@ACM@newfontsfalse}
\if@ACM@newfonts
+ \RequirePackage[T1]{fontenc}
\ifxetex
\RequirePackage[tt=false]{libertine}
\else
@@ -646,9 +661,6 @@ Computing Machinery]
\fi
\RequirePackage[varqu]{zi4}
\RequirePackage[libertine]{newtxmath}
-\ifxetex\else
- \RequirePackage[T1]{fontenc}
-\fi
\fi
\let\liningnums\@undefined
\AtEndPreamble{%
@@ -1114,7 +1126,9 @@ Computing Machinery]
\fi
\ifx\addresses\@empty
\if@ACM@anonymous
- \gdef\addresses{\@author{Anonymous Author(s)}}%
+ \gdef\addresses{\@author{Anonymous Author(s)%
+ \ifx\@acmSubmissionID\@empty\else\\Submission Id:
+ \@acmSubmissionID\fi}}%
\gdef\authors{Anonymous Author(s)}%
\else
\gdef\addresses{\@author{#2}}%
@@ -1128,7 +1142,9 @@ Computing Machinery]
\fi
\if@ACM@anonymous
\ifx\shortauthors\@empty
- \gdef\shortauthors{Anon.}%
+ \gdef\shortauthors{Anon.
+ \ifx\@acmSubmissionID\@empty\else Submission Id:
+ \@acmSubmissionID\fi}%
\fi
\else
\def\@tempa{#1}%
@@ -1606,7 +1622,7 @@ Computing Machinery]
\fi
\fi
\fi
- \footnotetextcopyrightpermission{%
+ \if@ACM@nonacm\else\footnotetextcopyrightpermission{%
\if@ACM@authordraft
\raisebox{-2ex}[\z@][\z@]{\makebox[0pt][l]{\large\bfseries
Unpublished working draft. Not for distribution.}}%
@@ -1624,7 +1640,7 @@ Computing Machinery]
\if@printcopyright
\copyright\ \@copyrightyear\ \@copyrightowner\\
\else
- \@copyrightyear.\
+ \@copyrightyear.\
\fi
\if@ACM@manuscript
Manuscript submitted to ACM\\
@@ -1644,17 +1660,20 @@ Computing Machinery]
, \@formatdoi{\@acmDOI}.
\fi\\
\else
- \if@ACM@journal
- \@permissionCodeOne/\@acmYear/\@acmMonth-ART\@acmArticle
- \ifx\@acmPrice\@empty\else\ \$\@acmPrice\fi\\
- \@formatdoi{\@acmDOI}%
- \else % Conference
- \ifx\@acmISBN\@empty\else ACM~ISBN~\@acmISBN
- \ifx\@acmPrice\@empty.\else\dots\$\@acmPrice\fi\\\fi
- \ifx\@acmDOI\@empty\else\@formatdoi{\@acmDOI}\fi%
+ \if@ACM@nonacm\else
+ \if@ACM@journal
+ \@permissionCodeOne/\@acmYear/\@acmMonth-ART\@acmArticle
+ \ifx\@acmPrice\@empty\else\ \$\@acmPrice\fi\\
+ \@formatdoi{\@acmDOI}%
+ \else % Conference
+ \ifx\@acmISBN\@empty\else ACM~ISBN~\@acmISBN
+ \ifx\@acmPrice\@empty.\else\dots\$\@acmPrice\fi\\\fi
+ \ifx\@acmDOI\@empty\else\@formatdoi{\@acmDOI}\fi%
+ \fi
\fi
\fi
\fi}
+ \fi
\endgroup
\setcounter{footnote}{0}%
\@mkabstract
@@ -1680,8 +1699,6 @@ Computing Machinery]
\@mkbibcitation
\fi
\hypersetup{%
- pdflang={English},
- pdfdisplaydoctitle,
pdfauthor={\authors},
pdftitle={\@title},
pdfsubject={\@concepts},
@@ -2142,8 +2159,8 @@ Computing Machinery]
\def\@mkbibcitation{\bgroup
\def\@pages@word{\ifnum\getrefnumber{TotPages}=1\relax page\else pages\fi}%
\def\footnotemark{}%
- \def\\{\unskip{} \ignorespaces}%
- \def\footnote{\ClassError{\@classname}{Please do note use footnotes
+ \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,
@@ -2151,17 +2168,23 @@ Computing Machinery]
\par\medskip\small\noindent{\bfseries ACM Reference Format:}\par\nobreak
\noindent\authors. \@acmYear. \@title
\ifx\@subtitle\@empty. \else: \@subtitle. \fi
- \if@ACM@journal
- \textit{\@journalNameShort}
- \@acmVolume, \@acmNumber \@article@string (\@acmPubDate),
- \ref{TotPages}~\@pages@word.
- \else
- In \textit{\@acmBooktitle}%
- \ifx\@acmEditors\@empty\textit{.}\else
- \andify\@acmEditors\textit{, }\@acmEditors~\@editorsAbbrev.%
- \fi\
- ACM, New York, NY, USA%
- \@article@string\unskip, \ref{TotPages}~\@pages@word.
+ \if@ACM@nonacm\else
+ % The 'nonacm' option disables 'printacmref' by default,
+ % and the present \@mkbibcitation definition is never used
+ % in this case. The conditional remains useful if the user
+ % explicitly sets \settopmatter{printacmref=true}.
+ \if@ACM@journal
+ \textit{\@journalNameShort}
+ \@acmVolume, \@acmNumber \@article@string (\@acmPubDate),
+ \ref{TotPages}~\@pages@word.
+ \else
+ In \textit{\@acmBooktitle}%
+ \ifx\@acmEditors\@empty\textit{.}\else
+ \andify\@acmEditors\textit{, }\@acmEditors~\@editorsAbbrev.%
+ \fi\
+ ACM, New York, NY, USA%
+ \@article@string\unskip, \ref{TotPages}~\@pages@word.
+ \fi
\fi
\ifx\@acmDOI\@empty\else\@formatdoi{\@acmDOI}\fi
\par\egroup}
@@ -2215,51 +2238,72 @@ Computing Machinery]
Page \thepage\ of \@startPage--\pageref*{TotPages}.%
}
\fi
-\def\@shortauthors{\if@ACM@anonymous Anon.\else\shortauthors\fi}
+\def\@shortauthors{%
+ \if@ACM@anonymous
+ Anon.
+ \ifx\@acmSubmissionID\@empty\else Submission Id: \@acmSubmissionID\fi
+ \else\shortauthors\fi}
\def\@headfootfont{\sffamily}
\fancypagestyle{standardpagestyle}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{\z@}%
\renewcommand{\footrulewidth}{\z@}%
+ \def\@acmArticlePage{%
+ \ifx\@acmArticle\empty%
+ \if@ACM@printfolios\thepage\fi%
+ \else%
+ \@acmArticle\if@ACM@printfolios:\thepage\fi%
+ \fi%
+ }
\ifcase\ACM@format@nr
\relax % manuscript
\fancyhead[LE]{\ACM@linecountL\if@ACM@printfolios\thepage\fi}%
\fancyhead[RO]{\if@ACM@printfolios\thepage\fi}%
\fancyhead[RE]{\@shortauthors}%
\fancyhead[LO]{\ACM@linecountL\shorttitle}%
- \fancyfoot[RO,LE]{\footnotesize Manuscript submitted to ACM}%
+ \if@ACM@nonacm\else%
+ \fancyfoot[RO,LE]{\footnotesize Manuscript submitted to ACM}
+ \fi%
\or % acmsmall
- \fancyhead[LE]{\ACM@linecountL\@headfootfont\@acmArticle\if@ACM@printfolios:\thepage\fi}%
- \fancyhead[RO]{\@headfootfont\@acmArticle\if@ACM@printfolios:\thepage\fi}%
+ \fancyhead[LE]{\ACM@linecountL\@headfootfont\@acmArticlePage}%
+ \fancyhead[RO]{\@headfootfont\@acmArticlePage}%
\fancyhead[RE]{\@headfootfont\@shortauthors}%
\fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}%
- \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
- \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
+ \if@ACM@nonacm\else%
+ \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
+ \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
+ \fi%
\or % acmlarge
\fancyhead[LE]{\ACM@linecountL\@headfootfont
- \@acmArticle\if@ACM@printfolios:\thepage\fi\quad\textbullet\quad\@shortauthors}%
+ \@acmArticlePage\quad\textbullet\quad\@shortauthors}%
\fancyhead[LO]{\ACM@linecountL}%
\fancyhead[RO]{\@headfootfont
- \shorttitle\quad\textbullet\quad\@acmArticle\if@ACM@printfolios:\thepage\fi}%
- \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
- \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
+ \shorttitle\quad\textbullet\quad\@acmArticlePage}%
+ \if@ACM@nonacm\else%
+ \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
+ \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
+ \fi%
\or % acmtog
\fancyhead[LE]{\ACM@linecountL\@headfootfont
- \@acmArticle\if@ACM@printfolios:\thepage\fi\quad\textbullet\quad\@shortauthors}%
+ \@acmArticlePage\quad\textbullet\quad\@shortauthors}%
\fancyhead[LO]{\ACM@linecountL}%
\fancyhead[RE]{\ACM@linecountR}%
\fancyhead[RO]{\@headfootfont
- \shorttitle\quad\textbullet\quad\@acmArticle\if@ACM@printfolios:\thepage\fi\ACM@linecountR}%
- \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
- \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
+ \shorttitle\quad\textbullet\quad\@acmArticlePage\ACM@linecountR}%
+ \if@ACM@nonacm\else%
+ \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
+ \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
+ \fi%
\else % Proceedings
\fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}%
\fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}%
\fancyhead[RE]{\@headfootfont\@shortauthors\ACM@linecountR}%
- \fancyhead[LE]{\ACM@linecountL\@headfootfont\acmConference@shortname,
- \acmConference@date, \acmConference@venue}%
- \fancyhead[RO]{\@headfootfont\acmConference@shortname,
- \acmConference@date, \acmConference@venue\ACM@linecountR}%
+ \if@ACM@nonacm\else%
+ \fancyhead[LE]{\ACM@linecountL\@headfootfont\acmConference@shortname,
+ \acmConference@date, \acmConference@venue}%
+ \fancyhead[RO]{\@headfootfont\acmConference@shortname,
+ \acmConference@date, \acmConference@venue\ACM@linecountR}%
+ \fi%
\fi
\if@ACM@sigchiamode
\fancyheadoffset[L]{\dimexpr(\marginparsep+\marginparwidth)}%
@@ -2317,27 +2361,35 @@ Computing Machinery]
\relax % manuscript
\fancyhead[L]{\ACM@linecountL}%
\fancyfoot[RO,LE]{\if@ACM@printfolios\small\thepage\fi}%
- \fancyfoot[RE,LO]{\footnotesize Manuscript submitted to ACM}%
+ \if@ACM@nonacm\else%
+ \fancyfoot[RE,LO]{\footnotesize Manuscript submitted to ACM}%
+ \fi%
\or % acmsmall
- \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
- \@acmNumber, Article \@acmArticle. Publication date:
- \@acmPubDate.}%
+ \if@ACM@nonacm\else%
+ \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
+ \@acmNumber, Article \@acmArticle. Publication date:
+ \@acmPubDate.}%
+ \fi%
\fancyhead[LE]{\ACM@linecountL\@folioblob}%
\fancyhead[LO]{\ACM@linecountL}%
\fancyhead[RO]{\@folioblob}%
\fancyheadoffset[RO,LE]{0.6\@folio@wd}%
\or % acmlarge
- \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
- \@acmNumber, Article \@acmArticle. Publication date:
- \@acmPubDate.}%
+ \if@ACM@nonacm\else%
+ \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
+ \@acmNumber, Article \@acmArticle. Publication date:
+ \@acmPubDate.}%
+ \fi%
\fancyhead[RO]{\@folioblob}%
\fancyhead[LE]{\ACM@linecountL\@folioblob}%
\fancyhead[LO]{\ACM@linecountL}%
\fancyheadoffset[RO,LE]{1.4\@folio@wd}%
\or % acmtog
- \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
- \@acmNumber, Article \@acmArticle. Publication date:
- \@acmPubDate.}%
+ \if@ACM@nonacm\else%
+ \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
+ \@acmNumber, Article \@acmArticle. Publication date:
+ \@acmPubDate.}%
+ \fi%
\fancyhead[L]{\ACM@linecountL}%
\fancyhead[R]{\ACM@linecountR}%
\else % Conference proceedings
@@ -2348,7 +2400,9 @@ Computing Machinery]
\if@ACM@timestamp
\ifnum\ACM@format@nr=0\relax % Manuscript
\fancyfoot[LO,RE]{\ACM@timestamp\quad
- \footnotesize Manuscript submitted to ACM}
+ \if@ACM@nonacm\else
+ \footnotesize Manuscript submitted to ACM
+ \fi}
\else
\fancyfoot[LO,RE]{\ACM@timestamp}
\fi
@@ -2362,26 +2416,56 @@ Computing Machinery]
\let\ps@myheadings\ACM@ps@myheadings
\let\ps@headings\ACM@ps@headings}
\AtBeginDocument{\ACM@restore@pagestyle}
+\def\ACM@NRadjust#1{%
+ \begingroup
+ \expandafter\ifx\csname Sectionformat\endcsname\relax
+ % do nothing when \Sectionformat is unknown
+ \def\next{\endgroup #1}%
+ \else
+ \def\next{\endgroup
+ \let\realSectionformat\Sectionformat
+ \def\ACM@sect@format@{#1}%
+ \let\Sectionformat\ACM@NR@adjustedSectionformat
+ %% next lines added 2018-06-17 to ensure section number is styled
+ \let\real@adddotafter\@adddotafter
+ \let\@adddotafter\ACM@adddotafter
+ #1{}% imposes the styles, but nullifies \MakeUppercase
+ \let\@adddotafter\real@adddotafter
+ }%
+ \fi \next
+}
+\def\ACM@NR@adjustedSectionformat#1#2{%
+ \realSectionformat{\ACM@sect@format{#1}}{#2}%
+ \let\Sectionformat\realSectionformat}
+\DeclareRobustCommand{\ACM@sect@format}{\ACM@sect@format@}
+\def\ACM@sect@format@null#1{#1}
+\let\ACM@sect@format@\ACM@sect@format@null
+\AtBeginDocument{%
+ \expandafter\ifx\csname LTX@adddotafter\endcsname\relax
+ \let\LTX@adddotafter\@adddotafter
+ \fi
+}
+\def\ACM@adddotafter#1{\ifx\relax#1\relax\else\LTX@adddotafter{#1}\fi}
\renewcommand\section{\@startsection{section}{1}{\z@}%
{-.75\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{.25\baselineskip}%
- {\@secfont}}
+ {\ACM@NRadjust\@secfont}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-.75\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{.25\baselineskip}%
- {\@subsecfont}}
-\renewcommand\subsubsection{\@startsection{subsubsection}{3}{10pt}%
+ {\ACM@NRadjust\@subsecfont}}
+\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-.5\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{-3.5\p@}%
- {\@subsubsecfont\@adddotafter}}
+ {\ACM@NRadjust{\@subsubsecfont\@adddotafter}}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\parindent}%
{-.5\baselineskip \@plus -2\p@ \@minus -.2\p@}%
{-3.5\p@}%
- {\@parfont\@adddotafter}}
+ {\ACM@NRadjust{\@parfont\@adddotafter}}}
\renewcommand\part{\@startsection{part}{9}{\z@}%
{-10\p@ \@plus -4\p@ \@minus -2\p@}%
{4\p@}%
- {\@parfont}}
+ {\ACM@NRadjust\@parfont}}
\def\section@raggedright{\@rightskip\@flushglue
\rightskip\@rightskip
\leftskip\z@skip
diff --git a/scribble-lib/scribble/acmart/acmart.tex b/scribble-lib/scribble/acmart/acmart.tex
@@ -1,4 +1,5 @@
-
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% BEGIN acmart/acmart.tex
% Support for styles in scribble/acmart
% These are replaced by scribble/acmart/style.tex,
@@ -26,3 +27,5 @@
% Use ACM color; it would be better to use `citecolor` here somehow,
% but I can't figure out how to do that
\newcommand{\AutobibLink}[1]{\color{ACMPurple}{#1}}
+% END acmart/acmart.tex
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/scribble-lib/scribble/acmart/lang.rkt b/scribble-lib/scribble/acmart/lang.rkt
@@ -22,12 +22,17 @@
[natbib? #f]
[anonymous? #f]
[authorversion? #f]
- [font-size #f])
+ [font-size #f]
+ [nonacm? #f]
+ [timestamp? #f]
+ [author-draft? #f]
+ [acmthm? #f])
(let loop ([stuff #'body])
(syntax-parse stuff
#:datum-literals (manuscript acmsmall acmlarge acmtog sigconf siggraph sigplan sigchi
sigchi-a dtrap pacmcgit tiot tdsci review screen natbib
- anonymous authorversion 9pt 10pt 11pt 12pt)
+ anonymous authorversion 9pt 10pt 11pt 12pt nonacm timestamp
+ authordraft acmthm)
;; Skip intraline whitespace to find options:
[(ws . body)
@@ -94,7 +99,42 @@
[(12pt . body)
(set! font-size "12pt")
(loop #'body)]
-
+ [((nonacm #t) . body)
+ (set! nonacm? "nonacm=true")
+ (loop #'body)]
+ [((nonacm #f) . body)
+ (set! nonacm? "nonacm=false")
+ (loop #'body)]
+ [(nonacm . body)
+ (set! nonacm? "nonacm=true")
+ (loop #'body)]
+ [(timestamp . body)
+ (set! timestamp? "timestamp=true")
+ (loop #'body)]
+ [((timestamp #t) . body)
+ (set! timestamp? "timestamp=true")
+ (loop #'body)]
+ [((timestamp #f) . body)
+ (set! timestamp? "timestamp=false")
+ (loop #'body)]
+ [(authordraft . body)
+ (set! author-draft? "authordraft=true")
+ (loop #'body)]
+ [((authordraft #t) . body)
+ (set! author-draft? "authordraft=true")
+ (loop #'body)]
+ [((authordraft #f) . body)
+ (set! author-draft? "authordraft=false")
+ (loop #'body)]
+ [(acmthm . body)
+ (set! acmthm? "acmthm=true")
+ (loop #'body)]
+ [((acmthm #t) . body)
+ (set! acmthm? "acmthm=true")
+ (loop #'body)]
+ [((acmthm #f) . body)
+ (set! acmthm? "acmthm=false")
+ (loop #'body)]
; format options
[((~and fmt
@@ -116,7 +156,9 @@
(loop #'body)]
[body
- #`(#%module-begin id (post-process #,review? #,screen? #,natbib? #,anonymous? #,authorversion? #,font-size #,format?) () . body)])))]))
+ #`(#%module-begin id (post-process #,review? #,screen? #,natbib? #,anonymous?
+ #,authorversion? #,font-size #,nonacm? #,timestamp?
+ #,author-draft? #,acmthm? #,format?) () . body)])))]))
(define ((post-process . opts) doc)
(let ([options
diff --git a/scribble-lib/scribble/acmart/style.tex b/scribble-lib/scribble/acmart/style.tex
@@ -1,3 +1,5 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% BEGIN acmart/style.tex
\renewcommand{\titleAndVersionAndAuthors}[3]{\title{#1}#3\maketitle}
\renewcommand{\titleAndEmptyVersionAndAuthors}[3]{\titleAndVersionAndAuthors{#1}{#2}{#3}}
@@ -37,6 +39,8 @@
\newcommand{\StitleShort}[2]{\title[#1]{#2}}
+\newcommand{\Sshortauthors}[1]{\renewcommand{\shortauthors}{#1}}
+
\newcommand{\SacmBadgeRURL}[2]{\acmBadgeR[#1]{#2}}
\newcommand{\SacmBadgeLURL}[2]{\acmBadgeL[#1]{#2}}
@@ -45,3 +49,5 @@
\newcommand{\SreceivedStage}[2]{\received[#1]{#2}}
\newcommand{\SccsdescNumber}[2]{\ccsdesc[#1]{#2}}
+% END acmart/style.tex
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/scribble-lib/scribble/bnf.rkt b/scribble-lib/scribble/bnf.rkt
@@ -1,19 +1,45 @@
(module bnf racket
- (require "struct.rkt"
- "decode.rkt"
- (only-in "core.rkt"
+ (require scribble/decode
+ (except-in scribble/struct
+ element?)
+ (only-in scribble/core
+ content?
+ element?
make-style
make-table-columns)
- mzlib/kw)
-
- (provide BNF
- nonterm
- BNF-seq BNF-seq-lines
- BNF-alt BNF-alt/close ; single-line alternatives
- BNF-etc
- BNF-group
- optional kleenestar kleeneplus kleenerange)
-
+ )
+
+ (provide (contract-out
+ [BNF (-> (cons/c (or/c block? content?)
+ (non-empty-listof (or/c block? content?)))
+ ...
+ table?)]
+ [BNF-etc element?]
+ ;; operate on content
+ [BNF-seq (-> content? ...
+ (or/c element? ""))]
+ [BNF-seq-lines (-> (listof content?) ...
+ block?)]
+ [BNF-alt (-> content? ...
+ element?)]
+ [BNF-alt/close (-> content? ...
+ element?)]
+ ;; operate on pre-content
+ [BNF-group (-> pre-content? ...
+ element?)]
+ [nonterm (-> pre-content? ...
+ element?)]
+ [optional (-> pre-content? ...
+ element?)]
+ [kleenestar (-> pre-content? ...
+ element?)]
+ [kleeneplus (-> pre-content? ...
+ element?)]
+ [kleenerange (-> any/c any/c pre-content? ...
+ element?)]
+ ))
+
+
(define spacer (make-element 'hspace (list " ")))
(define equals (make-element 'tt (list spacer "::=" spacer)))
(define alt (make-element 'tt (list spacer spacer "|" spacer spacer)))
@@ -33,14 +59,16 @@
(list baseline baseline baseline baseline))))
(apply
append
- (map (lambda (defn)
- (cons
- (list (as-flow spacer) (as-flow (car defn)) (as-flow equals) (as-flow (cadr defn)))
- (map (lambda (i)
- (list (as-flow spacer) (as-flow " ") (as-flow alt) (as-flow i)))
- (cddr defn))))
+ (map (match-lambda
+ [(cons lhs (cons rhs0 more-rhs))
+ (cons
+ (list (as-flow spacer) (as-flow lhs) (as-flow equals) (as-flow rhs0))
+ (map (lambda (i)
+ (list (as-flow spacer) (as-flow " ") (as-flow alt) (as-flow i)))
+ more-rhs))])
defns))))
+ ;; interleave : (listof content?) element? -> element?
(define (interleave l spacer)
(make-element #f (cons (car l)
(apply append
@@ -65,28 +93,28 @@
(define BNF-etc (make-element 'roman "..."))
- (define/kw (nonterm #:body s)
+ (define (nonterm . s)
(make-element 'roman (append (list 'lang)
(list (make-element 'italic (decode-content s)))
(list 'rang))))
- (define/kw (optional #:body s)
+ (define (optional . s)
(make-element #f (append (list (make-element 'roman "["))
(decode-content s)
(list (make-element 'roman "]")))))
- (define/kw (BNF-group #:body s)
+ (define (BNF-group . s)
(make-element #f (append (list (make-element 'roman "{"))
(list (apply BNF-seq (decode-content s)))
(list (make-element 'roman "}")))))
- (define/kw (kleenestar #:body s)
+ (define (kleenestar . s)
(make-element #f (append (decode-content s) (list (make-element 'roman "*")))))
- (define/kw (kleeneplus #:body s)
+ (define (kleeneplus . s)
(make-element #f (append (decode-content s) (list (make-element 'superscript (list "+"))))))
- (define/kw (kleenerange a b #:body s)
+ (define (kleenerange a b . s)
(make-element #f (append (decode-content s)
(list (make-element 'roman
(make-element 'superscript
diff --git a/scribble-lib/scribble/private/manual-bib.rkt b/scribble-lib/scribble/private/manual-bib.rkt
@@ -17,7 +17,8 @@
(#:is-book? boolean? #:author (or/c false/c pre-content?)
#:location (or/c false/c pre-content?)
#:date (or/c false/c pre-content?)
- #:url (or/c false/c pre-content?))
+ #:url (or/c false/c pre-content?)
+ #:note (or/c false/c pre-content?))
. ->* .
a-bib-entry?)]
[rename a-bib-entry? bib-entry? (any/c . -> . boolean?)]
@@ -46,7 +47,8 @@
#:author [author #f]
#:location [location #f]
#:date [date #f]
- #:url [url #f])
+ #:url [url #f]
+ #:note [note #f])
(make-a-bib-entry
key
(make-element
@@ -63,7 +65,8 @@
`(" " ,@(decode-content (list location)) ,(if date "," "."))
null)
(if date `(" " ,@(decode-content (list date)) ".") null)
- (if url `(" " ,(link url (tt url))) null)))))
+ (if url `(" " ,(link url (tt url))) null)
+ (if note (decode-content (list note)) null)))))
(define-on-demand bib-style (make-style "RBibliography" scheme-properties))
diff --git a/scribble-lib/scribble/scribble-common.js b/scribble-lib/scribble/scribble-common.js
@@ -168,3 +168,13 @@ AddOnLoad(function(){
indicator.innerHTML = label;
indicator.style.display = "block";
});
+
+// Pressing "S" focuses on the "...search manuals..." text field
+AddOnLoad(function(){
+ window.addEventListener("keypress", function(event) {
+ if (event && event.charCode == 115 && event.target == document.body) {
+ var field = document.getElementsByClassName("searchbox")[0];
+ field.focus();
+ }
+ }, false);
+});