Parameterize figure captions by language. ()

* Acmart font requirements
* Parameterize for different languages.
* Update acmart to v1.53
* Added three new document types to match acmart 1.53
This commit is contained in:
Leif Andersen 2018-05-11 17:25:24 -04:00 committed by GitHub
parent e7cf458de9
commit 67bfe3af4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 218 additions and 151 deletions
scribble-doc/scribblings/scribble
scribble-lib

View File

@ -34,6 +34,9 @@ Example:
@defidform[sigplan] @defidform[sigplan]
@defidform[sigchi] @defidform[sigchi]
@defidform[sigchi-a] @defidform[sigchi-a]
@defidform[dtrap]
@defidform[tiot]
@defidform[tdsci]
)]{ )]{
Enables the given document format. Use the format only on the same Enables the given document format. Use the format only on the same

View File

@ -9,6 +9,7 @@
scribble/html-properties scribble/html-properties
scribble/latex-properties scribble/latex-properties
scribble/private/tag scribble/private/tag
scribble/private/lang-parameters
(for-syntax racket/base)) (for-syntax racket/base))
(struct affiliation (position institution street-address city state postcode country) (struct affiliation (position institution street-address city state postcode country)
@ -132,7 +133,8 @@
...)) ...))
; format options ; format options
(defopts manuscript acmsmall acmlarge acmtog sigconf siggraph sigplan sigchi sigchi-a) (defopts manuscript acmsmall acmlarge acmtog sigconf siggraph sigplan sigchi sigchi-a
dtrap pacmcgit tiot tdsci)
; boolean options ; boolean options
(defopts review screen natbib anonymous authorversion 9pt 10pt 11pt 12pt) (defopts review screen natbib anonymous authorversion 9pt 10pt 11pt 12pt)
@ -407,3 +409,7 @@
; FIXME: theorem styles ; FIXME: theorem styles
(default-figure-label-text (make-element 'sf "Fig."))
(default-figure-label-sep ". ")
(default-figure-caption-style 'sf)
(default-figure-counter-style 'sf)

View File

@ -37,7 +37,7 @@
%% Right brace \} Tilde \~} %% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesClass{acmart} \ProvidesClass{acmart}
[2017/09/16 v1.48 Typesetting articles for the Association for [2018/04/14 v1.53 Typesetting articles for the Association for
Computing Machinery] Computing Machinery]
\def\@classname{acmart} \def\@classname{acmart}
\InputIfFileExists{acmart-preload-hook.tex}{% \InputIfFileExists{acmart-preload-hook.tex}{%
@ -199,22 +199,6 @@ Computing Machinery]
\ClassInfo{\@classname}{Using fontsize \ACM@fontsize} \ClassInfo{\@classname}{Using fontsize \ACM@fontsize}
\LoadClass[\ACM@fontsize, reqno]{amsart} \LoadClass[\ACM@fontsize, reqno]{amsart}
\RequirePackage{microtype} \RequirePackage{microtype}
\ifcase\ACM@format@nr
\relax % manuscript
\or % acmsmall
\or % acmlarge
\or % acmtog
\RequirePackage{flushend}
\or % sigconf
\RequirePackage{flushend}
\or % siggraph
\RequirePackage{flushend}
\or % sigplan
\RequirePackage{flushend}
\or % sigchi
\RequirePackage{flushend}
\or % sigchi-a
\fi
\RequirePackage{etoolbox} \RequirePackage{etoolbox}
\RequirePackage{refcount} \RequirePackage{refcount}
\RequirePackage{totpages} \RequirePackage{totpages}
@ -465,7 +449,6 @@ Computing Machinery]
\let\citeANP\citeauthor \let\citeANP\citeauthor
\let\citeNN\citeyearpar \let\citeNN\citeyearpar
\let\citeyearNP\citeyear \let\citeyearNP\citeyear
\let\citeyear\citeyearpar
\let\citeNP\citealt \let\citeNP\citealt
\DeclareRobustCommand\citeA \DeclareRobustCommand\citeA
{\begingroup\NAT@swafalse {\begingroup\NAT@swafalse
@ -477,7 +460,7 @@ Computing Machinery]
\providecommand\citename[1]{#1}} \providecommand\citename[1]{#1}}
\fi \fi
\newcommand\shortcite[2][]{% \newcommand\shortcite[2][]{%
\ifNAT@numbers\cite[#1]{#2}\else\citeyear[#1]{#2}\fi} \ifNAT@numbers\cite[#1]{#2}\else\citeyearpar[#1]{#2}\fi}
\def\bibliographystyle#1{% \def\bibliographystyle#1{%
\ifx\@begindocumenthook\@undefined\else \ifx\@begindocumenthook\@undefined\else
\expandafter\AtBeginDocument \expandafter\AtBeginDocument
@ -485,7 +468,8 @@ Computing Machinery]
{\if@filesw {\if@filesw
\immediate\write\@auxout{\string\bibstyle{#1}}% \immediate\write\@auxout{\string\bibstyle{#1}}%
\fi}} \fi}}
\RequirePackage{graphicx, xcolor} \RequirePackage{graphicx}
\RequirePackage[prologue]{xcolor}
\definecolor[named]{ACMBlue}{cmyk}{1,0.1,0,0.1} \definecolor[named]{ACMBlue}{cmyk}{1,0.1,0,0.1}
\definecolor[named]{ACMYellow}{cmyk}{0,0.16,1,0} \definecolor[named]{ACMYellow}{cmyk}{0,0.16,1,0}
\definecolor[named]{ACMOrange}{cmyk}{0,0.42,1,0.01} \definecolor[named]{ACMOrange}{cmyk}{0,0.42,1,0.01}
@ -499,8 +483,8 @@ Computing Machinery]
\SetWatermarkFontSize{0.5in} \SetWatermarkFontSize{0.5in}
\SetWatermarkColor[gray]{.9} \SetWatermarkColor[gray]{.9}
\SetWatermarkText{\parbox{12em}{\centering \SetWatermarkText{\parbox{12em}{\centering
Unpublished working draft\\ Unpublished working draft.\\
Not for distribution}} Not for distribution.}}
\fi \fi
\RequirePackage{geometry} \RequirePackage{geometry}
\ifcase\ACM@format@nr \ifcase\ACM@format@nr
@ -655,10 +639,16 @@ Computing Machinery]
have the newtxmath package installed. Please upgrade your have the newtxmath package installed. Please upgrade your
TeX}\@ACM@newfontsfalse} TeX}\@ACM@newfontsfalse}
\if@ACM@newfonts \if@ACM@newfonts
\RequirePackage[tt=false, type1=true]{libertine} \ifxetex
\RequirePackage[tt=false]{libertine}
\else
\RequirePackage[tt=false, type1=true]{libertine}
\fi
\RequirePackage[varqu]{zi4} \RequirePackage[varqu]{zi4}
\RequirePackage[libertine]{newtxmath} \RequirePackage[libertine]{newtxmath}
\RequirePackage[T1]{fontenc} \ifxetex\else
\RequirePackage[T1]{fontenc}
\fi
\fi \fi
\let\liningnums\@undefined \let\liningnums\@undefined
\AtEndPreamble{% \AtEndPreamble{%
@ -793,6 +783,7 @@ Computing Machinery]
\define@choicekey*+{ACM}{acmJournal}[\@journalCode\@journalCode@nr]{% \define@choicekey*+{ACM}{acmJournal}[\@journalCode\@journalCode@nr]{%
CIE,% CIE,%
CSUR,% CSUR,%
DTRAP,%
IMWUT,% IMWUT,%
JACM,% JACM,%
JDIQ,% JDIQ,%
@ -800,6 +791,7 @@ Computing Machinery]
JERIC,% JERIC,%
JETC,% JETC,%
JOCCH,% JOCCH,%
PACMCGIT,%
PACMHCI,% PACMHCI,%
PACMPL,% PACMPL,%
POMACS,% POMACS,%
@ -810,10 +802,12 @@ Computing Machinery]
TALLIP,% TALLIP,%
TAP,% TAP,%
TCPS,% TCPS,%
TDSCI,%
TEAC,% TEAC,%
TECS,% TECS,%
THRI,% THRI,%
TIIS,% TIIS,%
TIOT,%
TISSEC,% TISSEC,%
TIST,% TIST,%
TKDD,% TKDD,%
@ -853,6 +847,10 @@ Computing Machinery]
\def\@journalName{ACM Computing Surveys}% \def\@journalName{ACM Computing Surveys}%
\def\@journalNameShort{ACM Comput. Surv.}% \def\@journalNameShort{ACM Comput. Surv.}%
\def\@permissionCodeOne{0360-0300}% \def\@permissionCodeOne{0360-0300}%
\or % DTRAP
\def\@journalName{Digital Threats: Research and Practice}%
\def\@journalNameShort{Digit. Threat. Res. Pract.}%
\def\@permissionCodeOne{2576-5337}%
\or % IMWUT \or % IMWUT
\def\@journalName{Proceedings of the ACM on Interactive, Mobile, \def\@journalName{Proceedings of the ACM on Interactive, Mobile,
Wearable and Ubiquitous Technologies}% Wearable and Ubiquitous Technologies}%
@ -883,6 +881,12 @@ Computing Machinery]
\or % JOCCH \or % JOCCH
\def\@journalName{ACM Journal on Computing and Cultural Heritage}% \def\@journalName{ACM Journal on Computing and Cultural Heritage}%
\def\@journalNameShort{ACM J. Comput. Cult. Herit.}% \def\@journalNameShort{ACM J. Comput. Cult. Herit.}%
\or % PACMCGIT
\def\@journalName{Proceedings of the ACM on Computer Graphics and Interactive Techniques}%
\def\@journalNameShort{Proc. ACM Comput. Graph. Interact. Tech.}%
\def\@permissionCodeOne{2577-6193}%
\@ACM@screentrue
\PackageInfo{\@classname}{Using screen mode due to \@journalCode}%
\or % PACMHCI \or % PACMHCI
\def\@journalName{Proceedings of the ACM on Human-Computer Interaction}% \def\@journalName{Proceedings of the ACM on Human-Computer Interaction}%
\def\@journalNameShort{Proc. ACM Hum.-Comput. Interact.}% \def\@journalNameShort{Proc. ACM Hum.-Comput. Interact.}%
@ -924,6 +928,10 @@ Computing Machinery]
\def\@journalName{ACM Transactions on Applied Perception}% \def\@journalName{ACM Transactions on Applied Perception}%
\or % TCPS \or % TCPS
\def\@journalName{ACM Transactions on Cyber-Physical Systems}% \def\@journalName{ACM Transactions on Cyber-Physical Systems}%
\or % TDSCI
\def\@journalName{ACM Transactions on Data Science}%
\def\@journalNameShort{ACM Trans. Data Sci.}%
\def\@permissionCodeOne{2577-3224}%
\or % TEAC \or % TEAC
\def\@journalName{ACM Transactions on Economics and Computation}% \def\@journalName{ACM Transactions on Economics and Computation}%
\or % TECS \or % TECS
@ -938,6 +946,10 @@ Computing Machinery]
\def\@journalName{ACM Transactions on Interactive Intelligent Systems}% \def\@journalName{ACM Transactions on Interactive Intelligent Systems}%
\def\@journalNameShort{ACM Trans. Interact. Intell. Syst.}% \def\@journalNameShort{ACM Trans. Interact. Intell. Syst.}%
\def\@permissionCodeOne{2160-6455}% \def\@permissionCodeOne{2160-6455}%
\or % TIOT
\def\@journalName{ACM Transactions on Internet of Things}%
\def\@journalNameShort{ACM Trans. Internet Things}%
\def\@permissionCodeOne{2577-6207}%
\or % TISSEC \or % TISSEC
\def\@journalName{ACM Transactions on Information and System Security}% \def\@journalName{ACM Transactions on Information and System Security}%
\def\@journalNameShort{ACM Trans. Info. Syst. Sec.}% \def\@journalNameShort{ACM Trans. Info. Syst. Sec.}%
@ -1332,7 +1344,8 @@ Computing Machinery]
\acm@copyrightinput\acm@copyrightmode]{none,% \acm@copyrightinput\acm@copyrightmode]{none,%
acmcopyright,acmlicensed,rightsretained,% acmcopyright,acmlicensed,rightsretained,%
usgov,usgovmixed,cagov,cagovmixed,licensedusgovmixed,% usgov,usgovmixed,cagov,cagovmixed,licensedusgovmixed,%
licensedcagov,licensedcagovmixed,othergov,licensedothergov}{% licensedcagov,licensedcagovmixed,othergov,licensedothergov,%
iw3c2w3,iw3c2w3g}{%
\@printpermissiontrue \@printpermissiontrue
\@printcopyrighttrue \@printcopyrighttrue
\@acmownedtrue \@acmownedtrue
@ -1346,13 +1359,13 @@ Computing Machinery]
\fi \fi
\ifnum\acm@copyrightmode=3\relax % rightsretained \ifnum\acm@copyrightmode=3\relax % rightsretained
\@acmownedfalse \@acmownedfalse
\acmPrice{}% \AtBeginDocument{\acmPrice{}}%
\fi \fi
\ifnum\acm@copyrightmode=4\relax % usgov \ifnum\acm@copyrightmode=4\relax % usgov
\@printpermissiontrue \@printpermissiontrue
\@printcopyrightfalse \@printcopyrightfalse
\@acmownedfalse \@acmownedfalse
\acmPrice{}% \AtBeginDocument{\acmPrice{}}%
\fi \fi
\ifnum\acm@copyrightmode=6\relax % cagov \ifnum\acm@copyrightmode=6\relax % cagov
\@acmownedfalse \@acmownedfalse
@ -1371,6 +1384,14 @@ Computing Machinery]
\fi \fi
\ifnum\acm@copyrightmode=12\relax % licensedothergov \ifnum\acm@copyrightmode=12\relax % licensedothergov
\@acmownedfalse \@acmownedfalse
\fi
\ifnum\acm@copyrightmode=13\relax % iw3c2w3
\@acmownedfalse
\AtBeginDocument{\acmPrice{}}%
\fi
\ifnum\acm@copyrightmode=14\relax % iw3c2w3g
\@acmownedfalse
\AtBeginDocument{\acmPrice{}}%
\fi} \fi}
\def\setcopyright#1{\setkeys{ACM@}{acmcopyrightmode=#1}} \def\setcopyright#1{\setkeys{ACM@}{acmcopyrightmode=#1}}
\setcopyright{acmcopyright} \setcopyright{acmcopyright}
@ -1380,7 +1401,7 @@ Computing Machinery]
Association for Computing Machinery. Association for Computing Machinery.
\or % acmlicensed \or % acmlicensed
Copyright held by the owner/author(s). Publication rights licensed to Copyright held by the owner/author(s). Publication rights licensed to
Association for Computing Machinery. ACM\@.
\or % rightsretained \or % rightsretained
Copyright held by the owner/author(s). Copyright held by the owner/author(s).
\or % usgov \or % usgov
@ -1392,18 +1413,24 @@ Computing Machinery]
Association for Computing Machinery. Association for Computing Machinery.
\or %licensedusgovmixed \or %licensedusgovmixed
Copyright held by the owner/author(s). Publication rights licensed to Copyright held by the owner/author(s). Publication rights licensed to
Association for Computing Machinery. ACM\@.
\or % licensedcagov \or % licensedcagov
Crown in Right of Canada. Publication rights licensed to Crown in Right of Canada. Publication rights licensed to
Association for Computing Machinery. ACM\@.
\or %licensedcagovmixed \or %licensedcagovmixed
Copyright held by the owner/author(s). Publication rights licensed to Copyright held by the owner/author(s). Publication rights licensed to
Association for Computing Machinery. ACM\@.
\or % othergov \or % othergov
Association for Computing Machinery. Association for Computing Machinery.
\or % licensedothergov \or % licensedothergov
Copyright held by the owner/author(s). Publication rights licensed to Copyright held by the owner/author(s). Publication rights licensed to
Association for Computing Machinery. ACM\@.
\or % ic2w3www
IW3C2 (International World Wide Web Conference Committee), published
under Creative Commons CC-BY~4.0 License.
\or % ic2w3wwwgoogle
IW3C2 (International World Wide Web Conference Committee), published
under Creative Commons CC-BY-NC-ND~4.0 License.
\fi} \fi}
\def\@formatdoi#1{\url{https://doi.org/#1}} \def\@formatdoi#1{\url{https://doi.org/#1}}
\def\@copyrightpermission{% \def\@copyrightpermission{%
@ -1517,7 +1544,18 @@ Computing Machinery]
retains a nonexclusive, royalty-free right to publish or reproduce retains a nonexclusive, royalty-free right to publish or reproduce
this article, or to allow others to do so, for Government purposes this article, or to allow others to do so, for Government purposes
only. only.
\fi} \or % iw3c2w3
This paper is published under the Creative Commons Attribution~4.0
International (CC-BY~4.0) license. Authors reserve their rights to
disseminate the work on their personal and corporate Web sites with
the appropriate attribution.
\or % iw3c2w3g
This paper is published under the Creative Commons
Attribution-NonCommercial-NoDerivs~4.0 International
(CC-BY-NC-ND~4.0) license. Authors reserve their rights to
disseminate the work on their personal and corporate Web sites with
the appropriate attribution.
\fi}
\def\copyrightyear#1{\def\@copyrightyear{#1}} \def\copyrightyear#1{\def\@copyrightyear{#1}}
\copyrightyear{\@acmYear} \copyrightyear{\@acmYear}
\def\@teaserfigures{} \def\@teaserfigures{}
@ -1571,8 +1609,7 @@ Computing Machinery]
\footnotetextcopyrightpermission{% \footnotetextcopyrightpermission{%
\if@ACM@authordraft \if@ACM@authordraft
\raisebox{-2ex}[\z@][\z@]{\makebox[0pt][l]{\large\bfseries \raisebox{-2ex}[\z@][\z@]{\makebox[0pt][l]{\large\bfseries
Unpublished Unpublished working draft. Not for distribution.}}%
working draft. Not for distribution}}%
\color[gray]{0.9}% \color[gray]{0.9}%
\fi \fi
\parindent\z@\parskip0.1\baselineskip \parindent\z@\parskip0.1\baselineskip
@ -1642,10 +1679,17 @@ Computing Machinery]
\if@ACM@printacmref \if@ACM@printacmref
\@mkbibcitation \@mkbibcitation
\fi \fi
\hypersetup{pdfauthor={\authors}, \hypersetup{%
pdflang={English},
pdfdisplaydoctitle,
pdfauthor={\authors},
pdftitle={\@title}, pdftitle={\@title},
pdfsubject={\@concepts}, pdfsubject={\@concepts},
pdfkeywords={\@keywords}}% pdfkeywords={\@keywords},
pdfcreator={LaTeX with acmart
\csname ver@acmart.cls\endcsname\space
and hyperref
\csname ver@hyperref.sty\endcsname}}%
\@printendtopmatter \@printendtopmatter
\@afterindentfalse \@afterindentfalse
\@afterheading \@afterheading
@ -2119,7 +2163,7 @@ Computing Machinery]
ACM, New York, NY, USA% ACM, New York, NY, USA%
\@article@string\unskip, \ref{TotPages}~\@pages@word. \@article@string\unskip, \ref{TotPages}~\@pages@word.
\fi \fi
\@formatdoi{\@acmDOI} \ifx\@acmDOI\@empty\else\@formatdoi{\@acmDOI}\fi
\par\egroup} \par\egroup}
\def\@printendtopmatter{\par\bigskip} \def\@printendtopmatter{\par\bigskip}
\def\@setthanks{\long\def\thanks##1{\par##1\@addpunct.}\thankses} \def\@setthanks{\long\def\thanks##1{\par##1\@addpunct.}\thankses}
@ -2189,7 +2233,7 @@ Computing Machinery]
\fancyhead[RO]{\@headfootfont\@acmArticle\if@ACM@printfolios:\thepage\fi}% \fancyhead[RO]{\@headfootfont\@acmArticle\if@ACM@printfolios:\thepage\fi}%
\fancyhead[RE]{\@headfootfont\@shortauthors}% \fancyhead[RE]{\@headfootfont\@shortauthors}%
\fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}% \fancyhead[LO]{\ACM@linecountL\@headfootfont\shorttitle}%
\fancyfoot[RO,LE]{\footnotesize \@journalName, Vol. \@acmVolume, No. \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
\@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}% \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
\or % acmlarge \or % acmlarge
\fancyhead[LE]{\ACM@linecountL\@headfootfont \fancyhead[LE]{\ACM@linecountL\@headfootfont
@ -2197,7 +2241,7 @@ Computing Machinery]
\fancyhead[LO]{\ACM@linecountL}% \fancyhead[LO]{\ACM@linecountL}%
\fancyhead[RO]{\@headfootfont \fancyhead[RO]{\@headfootfont
\shorttitle\quad\textbullet\quad\@acmArticle\if@ACM@printfolios:\thepage\fi}% \shorttitle\quad\textbullet\quad\@acmArticle\if@ACM@printfolios:\thepage\fi}%
\fancyfoot[RO,LE]{\footnotesize \@journalName, Vol. \@acmVolume, No. \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
\@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}% \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
\or % acmtog \or % acmtog
\fancyhead[LE]{\ACM@linecountL\@headfootfont \fancyhead[LE]{\ACM@linecountL\@headfootfont
@ -2206,7 +2250,7 @@ Computing Machinery]
\fancyhead[RE]{\ACM@linecountR}% \fancyhead[RE]{\ACM@linecountR}%
\fancyhead[RO]{\@headfootfont \fancyhead[RO]{\@headfootfont
\shorttitle\quad\textbullet\quad\@acmArticle\if@ACM@printfolios:\thepage\fi\ACM@linecountR}% \shorttitle\quad\textbullet\quad\@acmArticle\if@ACM@printfolios:\thepage\fi\ACM@linecountR}%
\fancyfoot[RO,LE]{\footnotesize \@journalName, Vol. \@acmVolume, No. \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
\@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}% \@acmNumber, Article \@acmArticle. Publication date: \@acmPubDate.}%
\else % Proceedings \else % Proceedings
\fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}% \fancyfoot[C]{\if@ACM@printfolios\footnotesize\thepage\fi}%
@ -2275,7 +2319,7 @@ Computing Machinery]
\fancyfoot[RO,LE]{\if@ACM@printfolios\small\thepage\fi}% \fancyfoot[RO,LE]{\if@ACM@printfolios\small\thepage\fi}%
\fancyfoot[RE,LO]{\footnotesize Manuscript submitted to ACM}% \fancyfoot[RE,LO]{\footnotesize Manuscript submitted to ACM}%
\or % acmsmall \or % acmsmall
\fancyfoot[RO,LE]{\footnotesize \@journalName, Vol. \@acmVolume, No. \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
\@acmNumber, Article \@acmArticle. Publication date: \@acmNumber, Article \@acmArticle. Publication date:
\@acmPubDate.}% \@acmPubDate.}%
\fancyhead[LE]{\ACM@linecountL\@folioblob}% \fancyhead[LE]{\ACM@linecountL\@folioblob}%
@ -2283,7 +2327,7 @@ Computing Machinery]
\fancyhead[RO]{\@folioblob}% \fancyhead[RO]{\@folioblob}%
\fancyheadoffset[RO,LE]{0.6\@folio@wd}% \fancyheadoffset[RO,LE]{0.6\@folio@wd}%
\or % acmlarge \or % acmlarge
\fancyfoot[RO,LE]{\footnotesize \@journalName, Vol. \@acmVolume, No. \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
\@acmNumber, Article \@acmArticle. Publication date: \@acmNumber, Article \@acmArticle. Publication date:
\@acmPubDate.}% \@acmPubDate.}%
\fancyhead[RO]{\@folioblob}% \fancyhead[RO]{\@folioblob}%
@ -2291,7 +2335,7 @@ Computing Machinery]
\fancyhead[LO]{\ACM@linecountL}% \fancyhead[LO]{\ACM@linecountL}%
\fancyheadoffset[RO,LE]{1.4\@folio@wd}% \fancyheadoffset[RO,LE]{1.4\@folio@wd}%
\or % acmtog \or % acmtog
\fancyfoot[RO,LE]{\footnotesize \@journalName, Vol. \@acmVolume, No. \fancyfoot[RO,LE]{\footnotesize \@journalNameShort, Vol. \@acmVolume, No.
\@acmNumber, Article \@acmArticle. Publication date: \@acmNumber, Article \@acmArticle. Publication date:
\@acmPubDate.}% \@acmPubDate.}%
\fancyhead[L]{\ACM@linecountL}% \fancyhead[L]{\ACM@linecountL}%
@ -2465,8 +2509,9 @@ Computing Machinery]
\@ifundefined{proposition}{% \@ifundefined{proposition}{%
\newtheorem{proposition}[theorem]{Proposition} \newtheorem{proposition}[theorem]{Proposition}
}{} }{}
\@ifundefined{lemma}{%
\newtheorem{lemma}[theorem]{Lemma} \newtheorem{lemma}[theorem]{Lemma}
\@ifundefined{lemma}{}{} }{}
\@ifundefined{corollary}{% \@ifundefined{corollary}{%
\newtheorem{corollary}[theorem]{Corollary} \newtheorem{corollary}[theorem]{Corollary}
}{} }{}

View File

@ -6,7 +6,8 @@
scribble/latex-prefix scribble/latex-prefix
racket/list racket/list
"../private/defaults.rkt" "../private/defaults.rkt"
(for-syntax racket/base)) (for-syntax racket/base
syntax/parse))
(provide (except-out (all-from-out scribble/doclang) #%module-begin) (provide (except-out (all-from-out scribble/doclang) #%module-begin)
(all-from-out scribble/acmart) (all-from-out scribble/acmart)
(all-from-out scribble/base) (all-from-out scribble/base)
@ -23,106 +24,98 @@
[authorversion? #f] [authorversion? #f]
[font-size #f]) [font-size #f])
(let loop ([stuff #'body]) (let loop ([stuff #'body])
(syntax-case* stuff (manuscript acmsmall acmlarge acmtog sigconf siggraph sigplan sigchi sigchi-a (syntax-parse stuff
review screen natbib anonymous authorversion 9pt 10pt 11pt 12pt) #:datum-literals (manuscript acmsmall acmlarge acmtog sigconf siggraph sigplan sigchi
(lambda (a b) (eq? (syntax-e a) (syntax-e b))) sigchi-a dtrap pacmcgit tiot tdsci review screen natbib
anonymous authorversion 9pt 10pt 11pt 12pt)
;; Skip intraline whitespace to find options:
[(ws . body) [(ws . body)
;; Skip intraline whitespace to find options: #:when (and (string? (syntax-e #'ws))
(and (string? (syntax-e #'ws)) (regexp-match? #rx"^ *$" (syntax-e #'ws)))
(regexp-match? #rx"^ *$" (syntax-e #'ws)))
(loop #'body)] (loop #'body)]
; boolean options ; boolean options
[((review #t) . body) [((review #t) . body)
(set! review? "review=true") (set! review? "review=true")
(loop #'body)] (loop #'body)]
[((review #f) . body) [((review #f) . body)
(set! review? "review=false") (set! review? "review=false")
(loop #'body)] (loop #'body)]
[(review . body) [(review . body)
(set! review? "review=true") (set! review? "review=true")
(loop #'body)] (loop #'body)]
[((screen #t) . body) [((screen #t) . body)
(set! screen? "screen=true") (set! screen? "screen=true")
(loop #'body)] (loop #'body)]
[((screen #f) . body) [((screen #f) . body)
(set! screen? "screen=false") (set! screen? "screen=false")
(loop #'body)] (loop #'body)]
[(screen . body) [(screen . body)
(set! screen? "screen=true") (set! screen? "screen=true")
(loop #'body)] (loop #'body)]
[((natbib #t) . body) [((natbib #t) . body)
(set! natbib? "natbib=true") (set! natbib? "natbib=true")
(loop #'body)] (loop #'body)]
[((natbib #f) . body) [((natbib #f) . body)
(set! natbib? "natbib=false") (set! natbib? "natbib=false")
(loop #'body)] (loop #'body)]
[(natbib . body) [(natbib . body)
(set! natbib? "natbib=true") (set! natbib? "natbib=true")
(loop #'body)] (loop #'body)]
[((anonymous #t) . body) [((anonymous #t) . body)
(set! anonymous? "anonymous=true") (set! anonymous? "anonymous=true")
(loop #'body)] (loop #'body)]
[((anonymous #f) . body) [((anonymous #f) . body)
(set! anonymous? "anonymous=false") (set! anonymous? "anonymous=false")
(loop #'body)] (loop #'body)]
[(anonymous . body) [(anonymous . body)
(set! anonymous? "anonymous=true") (set! anonymous? "anonymous=true")
(loop #'body)] (loop #'body)]
[((authorversion #t) . body) [((authorversion #t) . body)
(set! authorversion? "authorversion=true") (set! authorversion? "authorversion=true")
(loop #'body)] (loop #'body)]
[((authorversion #f) . body) [((authorversion #f) . body)
(set! authorversion? "authorversion=false") (set! authorversion? "authorversion=false")
(loop #'body)] (loop #'body)]
[(authorversion . body) [(authorversion . body)
(set! authorversion? "authorversion=true") (set! authorversion? "authorversion=true")
(loop #'body)] (loop #'body)]
[(9pt . body) [(9pt . body)
(set! font-size "9pt") (set! font-size "9pt")
(loop #'body)] (loop #'body)]
[(10pt . body) [(10pt . body)
(set! font-size "10pt") (set! font-size "10pt")
(loop #'body)] (loop #'body)]
[(11pt . body) [(11pt . body)
(set! font-size "11pt") (set! font-size "11pt")
(loop #'body)] (loop #'body)]
[(12pt . body) [(12pt . body)
(set! font-size "12pt") (set! font-size "12pt")
(loop #'body)] (loop #'body)]
; format options ; format options
[(manuscript . body) [((~and fmt
(set! format? "manuscript") (~or manuscript
(loop #'body)] acmsmall
[(acmsmall . body) acmlarge
(set! format? "acmsmall") acmtog
(loop #'body)] sigconf
[(acmlarge . body) siggraph
(set! format? "acmlarge") sigplan
(loop #'body)] sigchi
[(acmtog . body) sigchi-a
(set! format? "acmtog") dtrap
(loop #'body)] pacmcgit
[(sigconf . body) tiot
(set! format? "sigconf") tdsci))
(loop #'body)] . body)
[(sigconf . body) (set! format? (symbol->string (syntax->datum #'fmt)))
(set! format? "siggraph")
(loop #'body)]
[(sigplan . body)
(set! format? "sigplan")
(loop #'body)]
[(sigchi . body)
(set! format? "sigchi")
(loop #'body)]
[(sigchi-a . body)
(set! format? "sigchi-a")
(loop #'body)] (loop #'body)]
[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 #,format?) () . body)])))]))
(define ((post-process . opts) doc) (define ((post-process . opts) doc)
@ -139,7 +132,7 @@
(scribble-file "acmart/style.tex") (scribble-file "acmart/style.tex")
(list (scribble-file "acmart/acmart.cls")) (list (scribble-file "acmart/acmart.cls"))
#f #f
#:replacements (hash "scribble-load-replace.tex" (scribble-file "acmart/acmart-load.tex")))))) #:replacements (hash "scribble-load-replace.tex" (scribble-file "acmart/acmart-load.tex"))))))
(define (add-acmart-styles doc) (define (add-acmart-styles doc)
(struct-copy part doc (struct-copy part doc

View File

@ -0,0 +1,19 @@
#lang racket/base
(provide (all-defined-out))
;; Some latex formats have different requirements on how
;; figures, citations, etc. are displayed. This allows different
;; scribble langs to handle them.
;; `Figure` string that appears in front of a figure caption
(define default-figure-label-text (make-parameter "Figure"))
;; Seperator string between figure counter and caption
(define default-figure-label-sep (make-parameter ": "))
;; Style for the figure caption
(define default-figure-caption-style (make-parameter #f))
;; Style for the number in the figure counter
(define default-figure-counter-style (make-parameter #f))

View File

@ -6,7 +6,8 @@
scribble/html-properties scribble/html-properties
scribble/latex-properties scribble/latex-properties
setup/main-collects setup/main-collects
"private/counter.rkt") "private/counter.rkt"
scribble/private/lang-parameters)
(provide figure (provide figure
figure* figure*
@ -75,11 +76,9 @@
figure-style-extras)) figure-style-extras))
c)) c))
(define default-label-sep ": ")
(define (figure tag caption (define (figure tag caption
#:style [style center-figure-style] #:style [style center-figure-style]
#:label-sep [label-sep default-label-sep] #:label-sep [label-sep (default-figure-label-sep)]
#:label-style [label-style #f] #:label-style [label-style #f]
#:continue? [continue? #f] #:continue? [continue? #f]
. content) . content)
@ -87,7 +86,7 @@
(define (figure-here tag caption (define (figure-here tag caption
#:style [style center-figure-style] #:style [style center-figure-style]
#:label-sep [label-sep default-label-sep] #:label-sep [label-sep (default-figure-label-sep)]
#:label-style [label-style #f] #:label-style [label-style #f]
#:continue? [continue? #f] #:continue? [continue? #f]
. content) . content)
@ -95,14 +94,14 @@
(define (figure* tag caption (define (figure* tag caption
#:style [style center-figure-style] #:style [style center-figure-style]
#:label-sep [label-sep default-label-sep] #:label-sep [label-sep (default-figure-label-sep)]
#:label-style [label-style #f] #:label-style [label-style #f]
#:continue? [continue? #f] #:continue? [continue? #f]
. content) . content)
(figure-helper figuremulti-style style label-sep label-style tag caption content continue?)) (figure-helper figuremulti-style style label-sep label-style tag caption content continue?))
(define (figure** tag caption (define (figure** tag caption
#:style [style center-figure-style] #:style [style center-figure-style]
#:label-sep [label-sep default-label-sep] #:label-sep [label-sep (default-figure-label-sep)]
#:label-style [label-style #f] #:label-style [label-style #f]
#:continue? [continue? #f] #:continue? [continue? #f]
. content) . content)
@ -124,7 +123,7 @@
#:label-sep label-sep #:label-sep label-sep
#:label-style label-style #:label-style label-style
#:continue? continue?) #:continue? continue?)
caption))))))) (make-element (default-figure-caption-style) caption))))))))
(define figures (new-counter "figure" (define figures (new-counter "figure"
#:target-wrap make-figure-target #:target-wrap make-figure-target
@ -134,7 +133,7 @@
#:label-sep [label-sep ": "] #:label-sep [label-sep ": "]
#:label-style [label-style #f]) #:label-style [label-style #f])
(counter-target figures tag (counter-target figures tag
"Figure" (default-figure-label-text)
#:label-suffix (list (if continue? " (continued)" "") label-sep) #:label-suffix (list (if continue? " (continued)" "") label-sep)
#:label-style label-style #:label-style label-style
#:target-style figure-target-style #:target-style figure-target-style

View File

@ -1,6 +1,7 @@
#lang racket/base #lang racket/base
(require scribble/core (require scribble/core
scribble/decode) scribble/decode
scribble/private/lang-parameters)
(provide new-counter (provide new-counter
counter-target counter-target
@ -38,7 +39,8 @@
(let ([n (resolve-get part ri (tag->counter-tag counter tag "value"))]) (let ([n (resolve-get part ri (tag->counter-tag counter tag "value"))])
(cons (cons
(make-element label-style (make-element label-style
(let ([l (cons (format "~a" n) (decode-content (list label-suffix)))]) (let ([l (cons (make-element (default-figure-counter-style) (format "~a" n))
(decode-content (list label-suffix)))])
(if label (if label
(list* label 'nbsp l) (list* label 'nbsp l)
l))) l)))