diff --git a/scribble-doc/scribblings/scribble/core.scrbl b/scribble-doc/scribblings/scribble/core.scrbl index 25b2602a..b17c5ab0 100644 --- a/scribble-doc/scribblings/scribble/core.scrbl +++ b/scribble-doc/scribblings/scribble/core.scrbl @@ -830,7 +830,7 @@ The @racket[_get] procedure passed to @racket[traverse] takes a symbol and any value to act as a default; it returns information registered for the symbol or the given default if no value has been registered. The @racket[_set] procedure passed to @racket[traverse] -takes a symbol and a value to registered for the symbol. +takes a symbol and a value to be registered for the symbol. @margin-note*{See also @racket[cond-block] in @racketmodname[scriblib/render-cond].} @; diff --git a/scribble-doc/scribblings/scribble/srcdoc.scrbl b/scribble-doc/scribblings/scribble/srcdoc.scrbl index 7402f32e..85848ec1 100644 --- a/scribble-doc/scribblings/scribble/srcdoc.scrbl +++ b/scribble-doc/scribblings/scribble/srcdoc.scrbl @@ -180,6 +180,27 @@ See @racket[defform] for information on @racket[options], @history[#:added "1.6"]} +@defform[(class*-doc id super (intf-id ...) pre-flow)]{ + +Like @racket[proc-doc], but for class declarations that use @racket[class*]. + +The @racket[id], @racket[super], and @racket[intf-id] expressions have the same +meaning as in @racket[defclass]. + +@history[#:added "1.30"]} + + +@defform[(class-doc id super pre-flow)]{ + +Like @racket[class*-doc], but for class declarations that use @racket[class] +omitting @racket[interface-expr]s. + +The @racket[id], and @racket[super] expressions have the same meaning as in +@racket[defclass]. + +@history[#:added "1.30"]} + + @defform[(begin-for-doc form ...)]{ Like to @racket[begin-for-syntax], but for documentation time instead diff --git a/scribble-lib/info.rkt b/scribble-lib/info.rkt index 2135010a..674af7ef 100644 --- a/scribble-lib/info.rkt +++ b/scribble-lib/info.rkt @@ -23,4 +23,4 @@ (define pkg-authors '(mflatt eli)) -(define version "1.29") +(define version "1.30") diff --git a/scribble-lib/scribble/acmart/acmart.cls b/scribble-lib/scribble/acmart/acmart.cls index eb1f7e5a..59820d82 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/08/12 v1.55 Typesetting articles for the Association for +[2019/04/22 v1.60 Typesetting articles for the Association for Computing Machinery] \def\@classname{acmart} \InputIfFileExists{acmart-preload-hook.tex}{% @@ -71,6 +71,14 @@ Computing Machinery] \fi}{\PackageError{\@classname}{The option screen can be either true or false}} \ExecuteOptionsX{screen=false} +\define@boolkey+{acmart.cls}[@ACM@]{urlbreakonhyphens}[true]{% + \if@ACM@urlbreakonhyphens + \PackageInfo{\@classname}{Using breaking urls on hyphens}% + \else + \PackageInfo{\@classname}{Not breaking urls on hyphens}% + \fi}{\PackageError{\@classname}{The option urlbreakonhyphens can be either true or + false}} +\ExecuteOptionsX{urlbreakonhyphens=true} \define@boolkey+{acmart.cls}[@ACM@]{acmthm}[true]{% \if@ACM@acmthm \PackageInfo{\@classname}{Requiring acmthm}% @@ -108,6 +116,10 @@ Computing Machinery] \fi}{\PackageError{\@classname}{The option nonacm can be either true or false}} \ExecuteOptionsX{nonacm=false} +\define@boolkey+{acmart.cls}[@ACM@]{balance}[true]{}{% + \PackageError{\@classname}{The option balance can be either true or + false}} +\ExecuteOptionsX{balance} \define@boolkey+{acmart.cls}[@ACM@]{natbib}[true]{% \if@ACM@natbib \PackageInfo{\@classname}{Explicitly selecting natbib mode}% @@ -153,6 +165,7 @@ Computing Machinery] \ClassInfo{\@classname}{Using format \ACM@format, number \ACM@format@nr} \newif\if@ACM@manuscript \newif\if@ACM@journal +\newif\if@ACM@journal@bibstrip \newif\if@ACM@sigchiamode \ifnum\ACM@format@nr=5\relax % siggraph \ClassWarning{\@classname}{The format siggraph is now obsolete. @@ -186,6 +199,11 @@ Computing Machinery] \@ACM@journalfalse \@ACM@sigchiamodetrue \fi +\if@ACM@journal + \@ACM@journal@bibstriptrue +\else + \@ACM@journal@bibstripfalse +\fi \ifx\ACM@fontsize\@empty \ifcase\ACM@format@nr \relax % manuscript @@ -212,6 +230,7 @@ Computing Machinery] \LoadClass[\ACM@fontsize, reqno]{amsart} \RequirePackage{microtype} \RequirePackage{etoolbox} +\RequirePackage{booktabs} \RequirePackage{refcount} \RequirePackage{totpages} \RequirePackage{environ} @@ -452,6 +471,7 @@ Computing Machinery] \let\@footnotetext@nolink\@footnotetext \RequirePackage[bookmarksnumbered,unicode]{hyperref} \pdfstringdefDisableCommands{% + \def\addtocounter#1#2{}% \def\unskip{}% \def\textbullet{- }% \def\textrightarrow{ -> }% @@ -472,16 +492,19 @@ Computing Machinery] \urlstyle{sf} \fi \AtEndPreamble{% + \if@ACM@urlbreakonhyphens + \def\do@url@hyp{\do\-}% + \fi \if@ACM@screen \hypersetup{colorlinks, - linkcolor=ACMRed, + linkcolor=ACMPurple, citecolor=ACMPurple, urlcolor=ACMDarkBlue, filecolor=ACMDarkBlue} \else \hypersetup{hidelinks} \fi - \hypersetup{pdflang={English}, + \hypersetup{pdflang={en}, pdfdisplaydoctitle}} \if@ACM@natbib \let\citeN\cite @@ -628,6 +651,22 @@ Computing Machinery] \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}} \def\@textbottom{\vskip \z@ \@plus 1pt} \let\@texttop\relax +\ifcase\ACM@format@nr +\relax % manuscript +\or % acmsmall +\or % acmlarge +\or % acmtog + \flushbottom +\or % sigconf + \flushbottom +\or % siggraph + \flushbottom +\or % sigplan + \flushbottom +\or % sigchi + \flushbottom +\or % sigchi-a +\fi \RequirePackage{iftex} \ifPDFTeX \input{glyphtounicode} @@ -656,6 +695,7 @@ Computing Machinery] \RequirePackage[T1]{fontenc} \ifxetex \RequirePackage[tt=false]{libertine} + \setmonofont{inconsolata} \else \RequirePackage[tt=false, type1=true]{libertine} \fi @@ -668,6 +708,29 @@ Computing Machinery] \if@ACM@sigchiamode \renewcommand{\familydefault}{\sfdefault} \fi +\newif\if@Description@present +\@Description@presenttrue +\newif\if@undescribed@images +\@undescribed@imagesfalse +\newcommand\Description[2][]{\global\@Description@presenttrue\ignorespaces} +\AtEndDocument{\if@undescribed@images + \ClassWarningNoLine{\@classname}{Some images may lack descriptions}\fi} +\AtBeginEnvironment{figure}{\@Description@presentfalse + \let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig} +\AtBeginEnvironment{figure*}{\@Description@presentfalse + \let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig} +\AtEndEnvironment{figure}{\if@Description@present\else + \global\@undescribed@imagestrue + \ClassWarning{\@classname}{A possible image without description}\fi} +\AtEndEnvironment{figure*}{\if@Description@present\else + \global\@undescribed@imagestrue + \ClassWarning{\@classname}{A possible image without description}\fi} +\AtBeginEnvironment{table}{\let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig} +\AtBeginEnvironment{table*}{\let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig} \RequirePackage{caption, float} \captionsetup[table]{position=top} \if@ACM@journal @@ -691,26 +754,41 @@ Computing Machinery] \or % sigchi \captionsetup[figure]{labelfont={bf, small}, textfont={bf, small}} + \captionsetup[table]{labelfont={bf, small}, + textfont={bf, small}} \or % sigchi-a \captionsetup[figure]{labelfont={bf, small}, textfont={bf, small}} + \captionsetup[table]{labelfont={bf, small}, + textfont={bf, small}} \fi \fi \newfloat{sidebar}{}{sbar} \floatname{sidebar}{Sidebar} \renewenvironment{sidebar}{\Collect@Body\@sidebar}{} -\long\def\@sidebar#1{\bgroup\captionsetup{type=sidebar}% +\long\def\@sidebar#1{\bgroup\let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig\captionsetup{type=sidebar}% \marginpar{\small#1}\egroup} \newenvironment{marginfigure}{\Collect@Body\@marginfigure}{} -\long\def\@marginfigure#1{\bgroup\captionsetup{type=figure}% - \marginpar{\centering\small#1}\egroup} +\long\def\@marginfigure#1{\bgroup + \let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig + \captionsetup{type=figure}% + \marginpar{\@Description@presentfalse\centering + \small#1\if@Description@present\else + \global\@undescribed@imagestrue + \ClassWarning{\@classname}{A possible image without description} + \fi}% + \egroup} \newenvironment{margintable}{\Collect@Body\@margintable}{} -\long\def\@margintable#1{\bgroup\captionsetup{type=table}% +\long\def\@margintable#1{\bgroup\let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig\captionsetup{type=table}% \marginpar{\centering\small#1}\egroup} \newdimen\fulltextwidth \fulltextwidth=\dimexpr(\textwidth+\marginparwidth+\marginparsep) \if@ACM@sigchiamode -\def\@dblfloat{\bgroup\columnwidth=\fulltextwidth +\def\@dblfloat{\bgroup\let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig\columnwidth=\fulltextwidth \let\@endfloatbox\@endwidefloatbox \def\@fpsadddefault{\def\@fps{tp}}% \@float} @@ -796,6 +874,7 @@ Computing Machinery] CIE,% CSUR,% DTRAP,% + HEALTH,% IMWUT,% JACM,% JDIQ,% @@ -814,7 +893,7 @@ Computing Machinery] TALLIP,% TAP,% TCPS,% - TDSCI,% + TDS,% TEAC,% TECS,% THRI,% @@ -863,6 +942,10 @@ Computing Machinery] \def\@journalName{Digital Threats: Research and Practice}% \def\@journalNameShort{Digit. Threat. Res. Pract.}% \def\@permissionCodeOne{2576-5337}% +\or % HEALTH + \def\@journalName{ACM Transactions on Computing for Healthcare}% + \def\@journalNameShort{ACM Trans. Comput. Healthcare}% + \def\@permissionCodeOne{2637-8051}% \or % IMWUT \def\@journalName{Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies}% @@ -940,7 +1023,7 @@ Computing Machinery] \def\@journalName{ACM Transactions on Applied Perception}% \or % TCPS \def\@journalName{ACM Transactions on Cyber-Physical Systems}% -\or % TDSCI +\or % TDS \def\@journalName{ACM Transactions on Data Science}% \def\@journalNameShort{ACM Trans. Data Sci.}% \def\@permissionCodeOne{2577-3224}% @@ -1082,7 +1165,8 @@ Computing Machinery] }{% \ClassError{\@classname}{Incorrect journal #1}% }% -\def\acmJournal#1{\setkeys{ACM}{acmJournal=#1}} +\def\acmJournal#1{\setkeys{ACM}{acmJournal=#1}% + \global\@ACM@journal@bibstriptrue} \def\@journalCode@nr{0} \def\@journalName{}% \def\@journalNameShort{\@journalName}% @@ -1095,9 +1179,13 @@ Computing Machinery] \gdef\acmConference@venue{#4}% \ifx\acmConference@shortname\@empty \gdef\acmConference@shortname{#2}% - \fi} + \fi + \global\@ACM@journal@bibstripfalse +} +\if@ACM@journal\else \acmConference[Conference'17]{ACM Conference}{July 2017}{Washington, - DC, USA} + DC, USA}% +\fi \def\acmBooktitle#1{\gdef\@acmBooktitle{#1}} \acmBooktitle{Proceedings of \acmConference@name \ifx\acmConference@name\acmConference@shortname\else @@ -1119,6 +1207,8 @@ Computing Machinery] \newif\if@insideauthorgroup \@insideauthorgroupfalse \renewcommand\author[2][]{% + \IfSubStr{#2}{,}{\ClassWarning{\@classname}{Do not put several + authors in the same \string\author\space macro!}}{}% \global\advance\num@authors by 1\relax \if@insideauthorgroup\else \global\advance\num@authorgroups by 1\relax @@ -1182,6 +1272,8 @@ Computing Machinery] \let\country\position Also with #1\unskip.\egroup} \renewcommand{\email}[2][]{% + \IfSubStr{#2}{,}{\ClassWarning{\@classname}{Do not put several + addresses in the same \string\email\space macro!}}{}% \if@ACM@anonymous\else \g@addto@macro\addresses{\email{#1}{#2}}% \fi} @@ -1327,10 +1419,12 @@ Computing Machinery] \RequirePackage{comment} \excludecomment{CCSXML} \let\@concepts\@empty +\newcounter{@concepts} \newcommand\ccsdesc[2][100]{% \ccsdesc@parse#1~#2~~\ccsdesc@parse@end} \RequirePackage{textcomp} \def\ccsdesc@parse#1~#2~#3~{% + \stepcounter{@concepts}% \expandafter\ifx\csname CCS@General@#2\endcsname\relax \expandafter\gdef\csname CCS@General@#2\endcsname{\textbullet\ \textbf{#2}}% @@ -1344,9 +1438,10 @@ Computing Machinery] \expandafter\gdef\csname CCS@Punctuation@#2\endcsname{ \textrightarrow\ }% \expandafter\g@addto@macro\expandafter{\csname CCS@Specific@#2\endcsname}{% - \ifnum#1>499\textbf{#3}; \else - \ifnum#1>299\textit{#3}; \else - #3; \fi\fi}% + \addtocounter{@concepts}{-1}% + \ifnum#1>499\textbf{#3}\else + \ifnum#1>299\textit{#3}\else + #3\fi\fi\ifnum\value{@concepts}=0.\else; \fi}% \fi \ccsdesc@parse@finish} \def\ccsdesc@parse@finish#1\ccsdesc@parse@end{} @@ -1591,12 +1686,11 @@ Computing Machinery] \ifnum\num@authorgroups=0\author{}\fi \fi \begingroup + \let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig \let\@footnotemark\@footnotemark@nolink \let\@footnotetext\@footnotetext@nolink \renewcommand\thefootnote{\@fnsymbol\c@footnote}% - \global\@topnum\z@ % this prevents floats from falling - % at the top of page 1 - \global\@botnum\z@ % we do not want them to be on the bottom either \hsize=\textwidth \def\@makefnmark{\hbox{\@textsuperscript{\@thefnmark}}}% \@mktitle\if@ACM@sigchiamode\else\@mkauthors\fi\@mkteasers @@ -1616,7 +1710,7 @@ Computing Machinery] \fi \ifx\@empty\@authorsaddresses\else \if@ACM@anonymous\else - \if@ACM@journal + \if@ACM@journal@bibstrip \footnotetextauthorsaddresses{% \def\par{\let\par\@par}\parindent\z@\@setauthorsaddresses}% \fi @@ -1633,7 +1727,7 @@ Computing Machinery] \if@printpermission\@copyrightpermission\par\fi \fi \if@ACM@manuscript\else - \if@ACM@journal\else % Print the conference information + \if@ACM@journal@bibstrip\else % Print the conference information {\itshape \acmConference@shortname, \acmConference@date, \acmConference@venue}\par \fi \fi @@ -1649,7 +1743,7 @@ Computing Machinery] This is the author's version of the work. It is posted here for your personal use. Not for redistribution. The definitive Version of Record was published in - \if@ACM@journal + \if@ACM@journal@bibstrip \emph{\@journalName}% \else \emph{\@acmBooktitle}% @@ -1661,7 +1755,7 @@ Computing Machinery] \fi\\ \else \if@ACM@nonacm\else - \if@ACM@journal + \if@ACM@journal@bibstrip \@permissionCodeOne/\@acmYear/\@acmMonth-ART\@acmArticle \ifx\@acmPrice\@empty\else\ \$\@acmPrice\fi\\ \@formatdoi{\@acmDOI}% @@ -1678,7 +1772,7 @@ Computing Machinery] \setcounter{footnote}{0}% \@mkabstract \if@ACM@printccs - \ifx\@concepts\@empty\else\bgroup + \ifx\@concepts\@empty\else\bgroup {\@specialsection{CCS Concepts}% \@concepts\par}\egroup \fi @@ -1707,6 +1801,9 @@ Computing Machinery] \csname ver@acmart.cls\endcsname\space and hyperref \csname ver@hyperref.sty\endcsname}}% + \global\@topnum\z@ % this prevents floats from falling + % at the top of page 1 + \global\@botnum\z@ % we do not want them to be on the bottom either \@printendtopmatter \@afterindentfalse \@afterheading @@ -1731,7 +1828,7 @@ Computing Machinery] \section*{#1}% \or % sigchi-a \section*{#1}% - \fi} + \fi} \def\@printtopmatter{% \ifx\@startPage\@empty \gdef\@startPage{1}% @@ -2056,9 +2153,11 @@ Computing Machinery] \fi \gdef\and{}}% \def\email##1##2{\ifx\@currentaffiliation\@empty - \gdef\@currentaffiliation{\nolinkurl{##2}}% + \gdef\@currentaffiliation{\bgroup + \mathchardef\UrlBreakPenalty=10000\nolinkurl{##2}\egroup}% \else - \g@addto@macro\@currentaffiliation{\par\nolinkurl{##2}}% + \g@addto@macro\@currentaffiliation{\par\bgroup + \mathchardef\UrlBreakPenalty=10000\nolinkurl{##2}\egroup}% \fi}% \def\affiliation##1##2{\ifx\@currentaffiliation\@empty \gdef\@currentaffiliation{% @@ -2144,7 +2243,12 @@ Computing Machinery] \def\@teaser##1{\par\bigskip\bgroup \captionsetup{type=figure}##1\egroup\par} \global\setbox\mktitle@bx=\vbox{\noindent\box\mktitle@bx\par - \noindent\@teaserfigures\par\medskip}% + \noindent\@Description@presentfalse + \@teaserfigures\par\if@Description@present\else + \global\@undescribed@imagestrue + \ClassWarning{\@classname}{A possible image without + description}\fi + \medskip}% \fi} \def\@mkabstract{\bgroup \ifx\@abstract\@lempty\else @@ -2152,11 +2256,13 @@ Computing Machinery] \if@ACM@journal \everypar{\setbox\z@\lastbox\everypar{}}\small \else - \section*{Abstract}% + \section*{\abstractname}% \fi \ignorespaces\@abstract\par}% \fi\egroup} \def\@mkbibcitation{\bgroup + \let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig \def\@pages@word{\ifnum\getrefnumber{TotPages}=1\relax page\else pages\fi}% \def\footnotemark{}% \def\\{\unskip{} \ignorespaces}% @@ -2174,7 +2280,7 @@ Computing Machinery] % 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 + \if@ACM@journal@bibstrip \textit{\@journalNameShort} \@acmVolume, \@acmNumber \@article@string (\@acmPubDate), \ref{TotPages}~\@pages@word. @@ -2189,10 +2295,22 @@ Computing Machinery] \fi \ifx\@acmDOI\@empty\else\@formatdoi{\@acmDOI}\fi \par\egroup} -\def\@printendtopmatter{\par\bigskip} +\def\@printendtopmatter{\bgroup + \let\@vspace\@vspace@orig + \let\@vspacer\@vspacer@orig + \par\bigskip + \egroup} \def\@setthanks{\long\def\thanks##1{\par##1\@addpunct.}\thankses} \def\@setauthorsaddresses{\@authorsaddresses\unskip\@addpunct.} \RequirePackage{fancyhdr} +\let\ACM@ps@plain\ps@plain +\let\ACM@ps@myheadings\ps@myheadings +\let\ACM@ps@headings\ps@headings +\def\ACM@restore@pagestyle{% + \let\ps@plain\ACM@ps@plain + \let\ps@myheadings\ACM@ps@myheadings + \let\ps@headings\ACM@ps@headings} +\AtBeginDocument{\ACM@restore@pagestyle} \if@ACM@review \newsavebox{\ACM@linecount@bx} \newlength\ACM@linecount@bxht @@ -2244,7 +2362,8 @@ Computing Machinery] Anon. \ifx\@acmSubmissionID\@empty\else Submission Id: \@acmSubmissionID\fi \else\shortauthors\fi} -\def\@headfootfont{\sffamily} +\def\@headfootfont{\sffamily\footnotesize} +\AtBeginDocument{% \fancypagestyle{standardpagestyle}{% \fancyhf{}% \renewcommand{\headrulewidth}{\z@}% @@ -2255,56 +2374,72 @@ Computing Machinery] \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}% - \if@ACM@nonacm\else% - \fancyfoot[RO,LE]{\footnotesize Manuscript submitted to ACM} - \fi% - \or % acmsmall - \fancyhead[LE]{\ACM@linecountL\@headfootfont\@acmArticlePage}% - \fancyhead[RO]{\@headfootfont\@acmArticlePage}% - \fancyhead[RE]{\@headfootfont\@shortauthors}% - \fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}% - \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 + }% + \if@ACM@journal@bibstrip + \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}% + \if@ACM@nonacm\else% + \fancyfoot[RO,LE]{\footnotesize Manuscript submitted to ACM} + \fi% + \or % acmsmall + \fancyhead[LE]{\ACM@linecountL\@headfootfont\@acmArticlePage}% + \fancyhead[RO]{\@headfootfont\@acmArticlePage}% + \fancyhead[RE]{\@headfootfont\@shortauthors}% + \fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}% + \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 \@acmArticlePage\quad\textbullet\quad\@shortauthors}% - \fancyhead[LO]{\ACM@linecountL}% - \fancyhead[RO]{\@headfootfont - \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 - \@acmArticlePage\quad\textbullet\quad\@shortauthors}% - \fancyhead[LO]{\ACM@linecountL}% - \fancyhead[RE]{\ACM@linecountR}% - \fancyhead[RO]{\@headfootfont - \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% + \fancyhead[LO]{\ACM@linecountL}% + \fancyhead[RO]{\@headfootfont + \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 + \@acmArticlePage\quad\textbullet\quad\@shortauthors}% + \fancyhead[LO]{\ACM@linecountL}% + \fancyhead[RE]{\ACM@linecountR}% + \fancyhead[RO]{\@headfootfont + \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}% + \if@ACM@nonacm\else% + \fancyhead[LE]{\ACM@linecountL\@headfootfont\footnotesize + \acmConference@shortname, + \acmConference@date, \acmConference@venue}% + \fancyhead[RO]{\@headfootfont + \acmConference@shortname, + \acmConference@date, \acmConference@venue\ACM@linecountR}% + \fi + \fi \else % Proceedings \fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}% \fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}% \fancyhead[RE]{\@headfootfont\@shortauthors\ACM@linecountR}% \if@ACM@nonacm\else% - \fancyhead[LE]{\ACM@linecountL\@headfootfont\acmConference@shortname, + \fancyhead[LE]{\ACM@linecountL\@headfootfont + \acmConference@shortname, \acmConference@date, \acmConference@venue}% - \fancyhead[RO]{\@headfootfont\acmConference@shortname, + \fancyhead[RO]{\@headfootfont + \acmConference@shortname, \acmConference@date, \acmConference@venue\ACM@linecountR}% - \fi% + \fi \fi \if@ACM@sigchiamode \fancyheadoffset[L]{\dimexpr(\marginparsep+\marginparwidth)}% @@ -2312,8 +2447,9 @@ Computing Machinery] \if@ACM@timestamp \fancyfoot[LO,RE]{\ACM@timestamp} \fi -} +}% \pagestyle{standardpagestyle} +} \newdimen\@folio@wd \@folio@wd=\z@ \newdimen\@folio@ht @@ -2354,46 +2490,53 @@ Computing Machinery] \textcolor{white}{\LARGE\sffamily\bfseries\@acmArticle}}}} \end{picture}\fi} +\AtBeginDocument{% \fancypagestyle{firstpagestyle}{% \fancyhf{}% \renewcommand{\headrulewidth}{\z@}% \renewcommand{\footrulewidth}{\z@}% - \ifcase\ACM@format@nr - \relax % manuscript - \fancyhead[L]{\ACM@linecountL}% - \fancyfoot[RO,LE]{\if@ACM@printfolios\small\thepage\fi}% - \if@ACM@nonacm\else% - \fancyfoot[RE,LO]{\footnotesize Manuscript submitted to ACM}% - \fi% - \or % acmsmall - \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 - \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 - \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 + \if@ACM@journal@bibstrip + \ifcase\ACM@format@nr + \relax % manuscript + \fancyhead[L]{\ACM@linecountL}% + \fancyfoot[RO,LE]{\if@ACM@printfolios\small\thepage\fi}% + \if@ACM@nonacm\else% + \fancyfoot[RE,LO]{\footnotesize Manuscript submitted to ACM}% + \fi% + \or % acmsmall + \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 + \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 + \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 + \fancyhead[L]{\ACM@linecountL}% + \fancyhead[R]{\ACM@linecountR}% + \fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}% + \fi + \else \fancyhead[L]{\ACM@linecountL}% \fancyhead[R]{\ACM@linecountR}% \fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}% @@ -2408,15 +2551,7 @@ Computing Machinery] \fancyfoot[LO,RE]{\ACM@timestamp} \fi \fi -} -\let\ACM@ps@plain\ps@plain -\let\ACM@ps@myheadings\ps@myheadings -\let\ACM@ps@headings\ps@headings -\def\ACM@restore@pagestyle{% - \let\ps@plain\ACM@ps@plain - \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 @@ -2634,10 +2769,40 @@ Computing Machinery] }{% \popQED\endtrivlist\@endpefalse } +\AtEndPreamble{% + \if@ACM@balance + \ifcase\ACM@format@nr + \relax % manuscript + \global\@ACM@balancefalse + \or % acmsmall + \global\@ACM@balancefalse + \or % acmlarge + \global\@ACM@balancefalse + \or % acmtog + \RequirePackage{balance}% + \or % sigconf + \RequirePackage{balance}% + \or % siggraph + \RequirePackage{balance}% + \or % sigplan + \RequirePackage{balance}% + \or % sigchi + \RequirePackage{balance}% + \or % sigchi-a + \global\@ACM@balancefalse + \fi + \fi +} +\AtEndDocument{% + \if@ACM@balance + \if@twocolumn + \balance + \fi\fi} +\newcommand\acksname{Acknowledgments} \specialcomment{acks}{% \begingroup - \section*{Acknowledgments} - \phantomsection\addcontentsline{toc}{section}{Acknowledgments} + \section*{\acksname} + \phantomsection\addcontentsline{toc}{section}{\acksname} }{% \endgroup } @@ -2665,6 +2830,19 @@ Computing Machinery] \ifx\@tempa\@tempb arXiv:\href{http://arxiv.org/abs/#2}{#2}\else arXiv:#2% \fi} +\let\@vspace@orig=\@vspace +\let\@vspacer@orig=\@vspacer +\apptocmd{\@vspace}{\ClassWarning{\@classname}{\string\vspace\space should + only be used to provide space above/below surrounding + objects}}{}{} +\apptocmd{\@vspacer}{\ClassWarning{\@classname}{\string\vspace\space should + only be used to provide space above/below surrounding + objects}}{}{} +\let\ACM@origbaselinestretch\baselinestretch +\AtEndDocument{\ifx\baselinestretch\ACM@origbaselinestretch\else + \ClassError{\@classname}{An attempt to redefine + \string\baselinestretch\space detected. Please do not do this for + ACM submissions!}\fi} \normalsize\normalfont\frenchspacing \endinput %% diff --git a/scribble-lib/scribble/private/manual-proc.rkt b/scribble-lib/scribble/private/manual-proc.rkt index 4fc93e10..6b7ae258 100644 --- a/scribble-lib/scribble/private/manual-proc.rkt +++ b/scribble-lib/scribble/private/manual-proc.rkt @@ -40,7 +40,7 @@ (case n [(1) "("] [(0) ""] [(2) "(("] [else (make-string n #\()]))) (define (make-closers n) (racketparenfont - (case n [(1) ")"] [(0) ""] [(2) "))"] [else (make-string n #\()]))) + (case n [(1) ")"] [(0) ""] [(2) "))"] [else (make-string n #\))]))) (define-syntax (arg-contract stx) (syntax-case stx (... ...+ _...superclass-args...) @@ -207,13 +207,13 @@ (list (result-value value.value) ...)))))])) (define-struct arg - (special? kw id optional? starts-optional? ends-optional? num-closers)) + (special? kw id optional? starts-optional? ends-optional? depth)) (define (*defproc kind link? mode within-id stx-ids sym prototypes arg-contractss arg-valss result-contracts content-thunk [result-values (map (lambda (x) #f) result-contracts)]) (define max-proto-width (current-display-width)) - (define ((arg->elem show-opt-start?) arg) + (define ((arg->elem show-opt-start?) arg next-depth) (let* ([e (cond [(not (arg-special? arg)) (if (arg-kw arg) (if (eq? mode 'new) @@ -235,10 +235,11 @@ [e (if (arg-ends-optional? arg) (make-element #f (list e "]")) e)] - [e (if (zero? (arg-num-closers arg)) + [num-closers (- (arg-depth arg) next-depth)] + [e (if (zero? num-closers) e (make-element - #f (list e (make-closers (arg-num-closers arg)))))]) + #f (list e (make-closers num-closers))))]) (if (and show-opt-start? (arg-starts-optional? arg)) (make-element #f (list "[" e)) e))) @@ -258,21 +259,23 @@ (not next-optional?) (not next-special-dots?))) depth))) - (let loop ([p p] [last-depth 0]) + (let loop ([p p] [depth 0]) + (define head + (if (symbol? (car p)) + null + (loop (car p) (add1 depth)))) (append - (if (symbol? (car p)) - null - (loop (car p) (add1 last-depth))) - (let loop ([p (cdr p)][in-optional? #f]) + head + (let loop ([p (cdr p)] [in-optional? #f]) (cond [(null? p) null] [(null? (cdr p)) - (list (parse-arg (car p) in-optional? last-depth #f #f))] + (list (parse-arg (car p) in-optional? depth #f #f))] [else (let ([a (parse-arg (car p) in-optional? - 0 + depth (let ([v (cadr p)]) (and (pair? v) (not @@ -282,6 +285,10 @@ (cons a (loop (cdr p) (and (arg-optional? a) (not (arg-ends-optional? a))))))]))))) + (define (next-args-depth args) + (if (null? args) + 0 + (arg-depth (car args)))) (define (prototype-size args first-combine next-combine special-combine?) (let loop ([s args] [combine first-combine]) (if (null? s) @@ -289,7 +296,7 @@ (combine (loop (cdr s) next-combine) (let ([a (car s)]) - (+ (arg-num-closers a) + (+ (- (arg-depth a) (next-args-depth (cdr s))) (if (arg-special? a) (string-length (symbol->string (arg-id a))) (+ (if (arg-kw a) @@ -468,11 +475,19 @@ #f `(,(make-openers (add1 p-depth)) ,tagged + ,(let ([num-closers (- p-depth (next-args-depth args))]) + (if (zero? num-closers) + '() + (make-closers num-closers))) ,@(if (null? args) (list (make-closers p-depth)) - (append-map (lambda (arg) - (list spacer ((arg->elem #t) arg))) - args)) + (let loop ([args args]) + (cond + [(null? args) null] + [else + (append + (list spacer ((arg->elem #t) (car args) (next-args-depth (cdr args)))) + (loop (cdr args)))]))) ,(racketparenfont ")")))) (if result-next-line? null end)))) ;; The multi-line case: @@ -498,7 +513,7 @@ (if (arg-starts-optional? (car args)) (to-flow (make-element #f (list spacer "["))) flow-spacer) - (to-flow ((arg->elem #f) (car args))) + (to-flow ((arg->elem #f) (car args) (next-args-depth (cdr args)))) not-end) (list* 'cont 'cont not-end))) (let loop ([args (if one-ok? (cdr args) args)]) @@ -517,12 +532,13 @@ (if (arg-starts-optional? (car args)) (to-flow (make-element #f (list spacer "["))) flow-spacer) - (let ([a ((arg->elem #f) (car args))] + (let ([a ((arg->elem #f) (car args) (next-args-depth (cdr args)))] [next (if dots-next? (make-element #f (list spacer ((arg->elem #f) - (cadr args)))) + (cadr args) + (next-args-depth (cddr args))))) "")]) (to-flow (cond diff --git a/scribble-lib/scribble/srcdoc.rkt b/scribble-lib/scribble/srcdoc.rkt index ee977a16..df6ec9da 100644 --- a/scribble-lib/scribble/srcdoc.rkt +++ b/scribble-lib/scribble/srcdoc.rkt @@ -1,5 +1,6 @@ #lang racket/base (require racket/contract/base + racket/class (for-syntax racket/base racket/require-transform racket/provide-transform @@ -16,6 +17,8 @@ struct-doc struct*-doc form-doc + class*-doc + class-doc generate-delayed-documents begin-for-doc) @@ -577,7 +580,7 @@ [(_ id contract desc) (begin (unless (identifier? #'id) - (raise-syntax-error 'parameter/doc + (raise-syntax-error 'thing-doc "expected an identifier" stx #'id)) @@ -662,6 +665,48 @@ #'((only-in scribble/manual defform)) #'id))]))) +(define-provide/doc-transformer class*-doc + (lambda (stx) + (syntax-case stx () + [(_ id super (intf-id ...) pre-flow) + (begin + (unless (identifier? #'id) + (raise-syntax-error 'class*-doc + "expected an identifier" + stx + #'id)) + (unless (identifier? #'super) + (raise-syntax-error 'class*-doc + "expected super class identifier" + stx + #'id)) + (values + #'[id class?] + #'(defclass id super (intf-id ...) . pre-flow) + #'((only-in scribble/manual defclass defconstructor defmethod this-obj)) + #'id))]))) + +(define-provide/doc-transformer class-doc + (lambda (stx) + (syntax-case stx () + [(_ id super pre-flow) + (begin + (unless (identifier? #'id) + (raise-syntax-error 'class-doc + "expected an identifier" + stx + #'id)) + (unless (identifier? #'super) + (raise-syntax-error 'class-doc + "expected super class identifier" + stx + #'id)) + (values + #'[id class?] + #'(defclass id super () . pre-flow) + #'((only-in scribble/manual defclass defconstructor defmethod this-obj)) + #'id))]))) + (define-syntax (generate-delayed-documents stx) (syntax-case stx () [(_)