This commit is contained in:
Carl Colglazier 2024-01-31 17:08:47 -06:00
commit fc929dbfed
36 changed files with 21433 additions and 0 deletions

1
.Rprofile Normal file
View File

@ -0,0 +1 @@
source("renv/activate.R")

35
.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
data/
.DS_Store
index_cache/
index_files/
# R stuff
.Rproj.user
.Rhistory
.RData
.Ruserdata
# Quarto stuff
/.quarto/
**/*_cache/*
_site/
_freeze/
_manuscript/
*.pdf
*.html
*.docx
*.odt
*.log
*.aux
/.luarc.json
# Targets stuff
_targets
_targets.yaml
# Python stuff
__pycache__/
*.pyc

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
title: acmart (ACM) format template
author: Carlos Scheidegger
version: 0.0.3
quarto-required: ">= 1.2.198"
contributes:
format:
common:
# define below YAML configuration common to all formats
filters:
# You can include here Lua filters from your extension format
- color-text.lua
- build-acm-authors.lua
- add-bibliography.lua
- fancy-figure.lua
shortcodes:
# You can include here Lua filters defining shortcodes from your extension
- shortcodes.lua
knitr:
opts_chunk:
echo: false
pdf:
# define default configuration for the pdf version of your format
template: acmarttemplate.tex
colorlinks: true
urlcolor: red
fig-width: 6.5
fig-height: 4.5
biblio-style: te.bst
documentclass: acmart
header-includes: |
\definecolor{mypink}{RGB}{219, 48, 122}
template-partials:
# Add here the partials your format is using
- "partials/title.tex"
- "partials/_acmart_preamble.tex"
- "partials/_acmart_authors.tex"
- "partials/_acmart_abstract.tex"
cite-method: natbib
html:
# define default configuration for the html version of your format
number-sections: true
toc: true
theme: custom.scss
csl: association-for-computing-machinery.csl

View File

@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
<info>
<title>ACM SIGCHI Proceedings (2016)</title>
<id>http://www.zotero.org/styles/acm-sigchi-proceedings</id>
<link href="http://www.zotero.org/styles/acm-sigchi-proceedings" rel="self"/>
<link href="http://cscw.acm.org/2016/submit/sigchi-word-proceedings.zip" rel="documentation"/>
<author>
<name>Yevgeniy Medynskiy</name>
<email>eugenem@gatech.edu</email>
</author>
<contributor>
<name>Sebastian Karcher</name>
</contributor>
<contributor>
<name>Eric Baumer</name>
<email>ebaumer@ics.uci.edu</email>
</contributor>
<contributor>
<name>Svetlana Yarosh</name>
<email>lana@cc.gatech.edu</email>
</contributor>
<contributor>
<name>Lilly Irani</name>
<email>lirani@ics.uci.edu</email>
</contributor>
<category citation-format="numeric"/>
<category field="engineering"/>
<updated>2012-09-27T22:06:38+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="author">
<group suffix=".">
<names variable="author">
<name delimiter=", " and="text" sort-separator=", "/>
<label form="short" prefix=" (" suffix=")"/>
<substitute>
<names variable="editor"/>
</substitute>
</names>
</group>
</macro>
<macro name="editor">
<names variable="editor">
<name delimiter=", " and="text" delimiter-precedes-last="never"/>
<label form="short" prefix=" (" suffix=")"/>
</names>
</macro>
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<text variable="title" font-style="italic"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="year">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="journal">
<group delimiter=", ">
<group delimiter=" ">
<text variable="container-title" font-style="italic"/>
<text variable="volume"/>
</group>
<text variable="issue"/>
</group>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition"/>
</else>
</choose>
</macro>
<macro name="book-publisher">
<group delimiter=", ">
<text variable="publisher"/>
<text variable="publisher-place"/>
</group>
</macro>
<macro name="access">
<choose>
<if variable="DOI">
<text variable="DOI" prefix="https://doi.org/"/>
</if>
<else-if variable="URL">
<group delimiter=" ">
<text term="retrieved" text-case="capitalize-first"/>
<text variable="accessed"/>
<text term="from"/>
<text variable="URL"/>
</group>
</else-if>
</choose>
</macro>
<citation collapse="citation-number">
<sort>
<key variable="citation-number"/>
</sort>
<layout prefix="[" suffix="]" delimiter=",">
<group delimiter=":">
<text variable="citation-number"/>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography second-field-align="flush" entry-spacing="0">
<sort>
<key macro="author"/>
<key variable="issued"/>
</sort>
<layout>
<text variable="citation-number" prefix="[" suffix="]"/>
<group delimiter=". " suffix=". ">
<text macro="author"/>
<text macro="year"/>
<text macro="title"/>
</group>
<group suffix=".">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song thesis" match="any">
<text macro="book-publisher" suffix="."/>
</if>
<else-if type="paper-conference">
<group suffix="." delimiter=", ">
<group delimiter=" ">
<text term="in" text-case="capitalize-first"/>
<group delimiter=" ">
<text variable="container-title" font-style="italic"/>
<text variable="collection-title" prefix="(" suffix=")"/>
</group>
</group>
<text variable="page"/>
</group>
</else-if>
<else-if type="chapter" match="any">
<group delimiter=" ">
<text term="in" text-case="capitalize-first"/>
<group delimiter=", ">
<group delimiter=" ">
<text variable="container-title" font-style="italic"/>
<text macro="edition" prefix="(" suffix=")"/>
</group>
<text macro="editor"/>
</group>
</group>
<group suffix="." delimiter=", " prefix=". ">
<text macro="book-publisher"/>
<text variable="page"/>
</group>
</else-if>
<else-if type="article-journal">
<group suffix="." delimiter=": ">
<text macro="journal"/>
<text variable="page"/>
</group>
</else-if>
<else>
<group suffix="." delimiter=", ">
<group delimiter=" " font-style="italic">
<text variable="container-title"/>
<text variable="volume"/>
</group>
<text variable="page"/>
</group>
</else>
</choose>
</group>-->
<text macro="access" prefix=" "/>
<!--<group delimiter=" ">
<text term="What about this"/>
</group>-->
</layout>
</bibliography>
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,436 @@
\documentclass[$if(acm-metadata.acmart-options)$$acm-metadata.acmart-options$$else$manuscript,screen$if(acm-metadata.final)$$else$,review$endif$$if(acm-metadata.anonymous)$,anonymous$endif$$endif$]{acmart}
$-- % Options for packages loaded elsewhere
$-- \PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
$-- \PassOptionsToPackage{hyphens}{url}
$-- $if(colorlinks)$
$-- \PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
$-- $endif$
$-- $if(CJKmainfont)$
$-- \PassOptionsToPackage{space}{xeCJK}
$-- $endif$
$-- %
$-- $doc-class.tex()$
$-- \usepackage{amsmath,amssymb}
$-- $if(fontfamily)$
$-- \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$-- $else$
$-- \usepackage{lmodern}
$-- $endif$
$-- $if(linestretch)$
$-- \usepackage{setspace}
$-- $endif$
$-- \usepackage{iftex}
$-- \ifPDFTeX
$-- \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
$-- \usepackage[utf8]{inputenc}
$-- \usepackage{textcomp} % provide euro and other symbols
$-- \else % if luatex or xetex
$-- $if(mathspec)$
$-- \ifXeTeX
$-- \usepackage{mathspec}
$-- \else
$-- \usepackage{unicode-math}
$-- \fi
$-- $else$
$-- \usepackage{unicode-math}
$-- $endif$
$-- \defaultfontfeatures{Scale=MatchLowercase}
$-- \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
$-- $if(mainfont)$
$-- \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$-- $endif$
$-- $if(sansfont)$
$-- \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$-- $endif$
$-- $if(monofont)$
$-- \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
$-- $endif$
$-- $for(fontfamilies)$
$-- \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
$-- $endfor$
$-- $if(mathfont)$
$-- $if(mathspec)$
$-- \ifXeTeX
$-- \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$-- \else
$-- \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$-- \fi
$-- $else$
$-- \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$-- $endif$
$-- $endif$
$-- $if(CJKmainfont)$
$-- \ifXeTeX
$-- \usepackage{xeCJK}
$-- \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$-- \fi
$-- $endif$
$-- $if(luatexjapresetoptions)$
$-- \ifLuaTeX
$-- \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
$-- \fi
$-- $endif$
$-- $if(CJKmainfont)$
$-- \ifLuaTeX
$-- \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
$-- \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$-- \fi
$-- $endif$
$-- \fi
$-- $if(zero-width-non-joiner)$
$-- %% Support for zero-width non-joiner characters.
$-- \makeatletter
$-- \def\zerowidthnonjoiner{%
$-- % Prevent ligatures and adjust kerning, but still support hyphenating.
$-- \texorpdfstring{%
$-- \textormath{\nobreak\discretionary{-}{}{\kern.03em}%
$-- \ifvmode\else\nobreak\hskip\z@skip\fi}{}%
$-- }{}%
$-- }
$-- \makeatother
$-- \ifPDFTeX
$-- \DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner}
$-- \else
$-- \catcode`^^^^200c=\active
$-- \protected\def ^^^^200c{\zerowidthnonjoiner}
$-- \fi
$-- %% End of ZWNJ support
$-- $endif$
$-- % Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
$if(indent)$
$else$
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
$endif$
$-- $if(verbatim-in-note)$
$-- \usepackage{fancyvrb}
$-- $endif$
$-- \usepackage{xcolor}
$-- $if(geometry)$
$-- $if(beamer)$
$-- \geometry{$for(geometry)$$geometry$$sep$,$endfor$}
$-- $else$
$-- \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
$-- $endif$
$-- $endif$
$-- $if(beamer)$
$-- \newif\ifbibliography
$-- $endif$
$-- $if(listings)$
$-- \usepackage{listings}
$-- \newcommand{\passthrough}[1]{#1}
$-- \lstset{defaultdialect=[5.3]Lua}
$-- \lstset{defaultdialect=[x86masm]Assembler}
$-- $endif$
$-- $if(lhs)$
$-- \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$-- $endif$
$-- $if(links-as-notes)$
$-- % Make links footnotes instead of hotlinks:
$-- \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
$-- $endif$
$-- $if(strikeout)$
$-- $-- also used for underline
$-- \usepackage[normalem]{ulem}
$-- $endif$
$-- \setlength{\emergencystretch}{3em} % prevent overfull lines
$-- $if(numbersections)$
$-- \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
$-- $else$
$-- \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
$-- $endif$
$-- $if(beamer)$
$-- $else$
$-- $if(block-headings)$
$-- % Make \paragraph and \subparagraph free-standing
$-- \ifx\paragraph\undefined\else
$-- \let\oldparagraph\paragraph
$-- \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
$-- \fi
$-- \ifx\subparagraph\undefined\else
$-- \let\oldsubparagraph\subparagraph
$-- \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
$-- \fi
$-- $endif$
$-- $endif$
$-- $if(pagestyle)$
$-- \pagestyle{$pagestyle$}
$-- $endif$
$-- $pandoc.tex()$
$-- $if(lang)$
$-- \ifLuaTeX
$-- \usepackage[bidi=basic]{babel}
$-- \else
$-- \usepackage[bidi=default]{babel}
$-- \fi
$-- $if(babel-lang)$
$-- \babelprovide[main,import]{$babel-lang$}
$-- $endif$
$-- $for(babel-otherlangs)$
$-- \babelprovide[import]{$babel-otherlangs$}
$-- $endfor$
$-- % get rid of language-specific shorthands (see #6817):
$-- \let\LanguageShortHands\languageshorthands
$-- \def\languageshorthands#1{}
$-- $endif$
$-- \ifLuaTeX
$-- \usepackage{selnolig} % disable illegal ligatures
$-- \fi
$-- $if(dir)$
$-- \ifPDFTeX
$-- \TeXXeTstate=1
$-- \newcommand{\RL}[1]{\beginR #1\endR}
$-- \newcommand{\LR}[1]{\beginL #1\endL}
$-- \newenvironment{RTL}{\beginR}{\endR}
$-- \newenvironment{LTR}{\beginL}{\endL}
$-- \fi
$-- $endif$
$-- $if(biblio-config)$
$-- $if(natbib)$
$-- \usepackage[$natbiboptions$]{natbib}
$-- \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
$-- $endif$
$-- $if(biblatex)$
$-- \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
$-- $for(bibliography)$
$-- \addbibresource{$bibliography$}
$-- $endfor$
$-- $endif$
$-- $endif$
$-- $if(nocite-ids)$
$-- \nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
$-- $endif$
$-- $if(csquotes)$
$-- \usepackage{csquotes}
$-- $endif$
$-- \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
$-- \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
$-- \urlstyle{same} % disable monospaced font for URLs
$-- $if(verbatim-in-note)$
$-- \VerbatimFootnotes % allow verbatim text in footnotes
$-- $endif$
$-- \hypersetup{
$-- $if(title-meta)$
$-- pdftitle={$title-meta$},
$-- $endif$
$-- $if(author-meta)$
$-- pdfauthor={$author-meta$},
$-- $endif$
$-- $if(lang)$
$-- pdflang={$lang$},
$-- $endif$
$-- $if(subject)$
$-- pdfsubject={$subject$},
$-- $endif$
$-- $if(keywords)$
$-- pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
$-- $endif$
$-- $if(colorlinks)$
$-- colorlinks=true,
$-- linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$},
$-- filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$},
$-- citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$},
$-- urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$},
$-- $else$
$-- hidelinks,
$-- $endif$
$-- pdfcreator={LaTeX via pandoc}}
$-- $title.tex()$
$-- \begin{document}
$-- $before-body.tex()$
$-- $for(include-before)$
$-- $include-before$
$-- $endfor$
$-- $toc.tex()$
$-- $if(linestretch)$
$-- \setstretch{$linestretch$}
$-- $endif$
$-- $if(has-frontmatter)$
$-- \mainmatter
$-- $endif$
$-- $body$
$-- $before-bib.tex()$
$-- $if(has-frontmatter)$
$-- \backmatter
$-- $endif$
$-- $biblio.tex()$
$-- $for(include-after)$
$-- $include-after$
$-- $endfor$
$-- $after-body.tex()$
$-- \end{document}
%%
%% This is file `sample-manuscript.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% samples.dtx (with options: `manuscript')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from sample-manuscript.tex.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file samples.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%%
%% Commands for TeXCount
%TC:macro \cite [option:text,text]
%TC:macro \citep [option:text,text]
%TC:macro \citet [option:text,text]
%TC:envir table 0 1
%TC:envir table* 0 1
%TC:envir tabular [ignore] word
%TC:envir displaymath 0 word
%TC:envir math 0 word
%TC:envir comment 0 0
%%
%%
%% The first command in your LaTeX source must be the \documentclass command.
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
$endif$
$if(CJKmainfont)$
\PassOptionsToPackage{space}{xeCJK}
$endif$
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
%% PANDOC PREAMBLE BEGINS
$pandoc.tex()$
%% PANDOC PREAMBLE ENDS
\setlength{\parindent}{10pt}
\setlength{\parskip}{0pt}
\hypersetup{
$if(title-meta)$
pdftitle={$title-meta$},
$endif$
$if(author-meta)$
pdfauthor={$author-meta$},
$endif$
$if(lang)$
pdflang={$lang$},
$endif$
$if(subject)$
pdfsubject={$subject$},
$endif$
$if(keywords)$
pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
$endif$
$if(colorlinks)$
colorlinks=true,
linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$},
filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$},
citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$},
urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$},
$else$
hidelinks,
$endif$
pdfcreator={LaTeX via pandoc, via quarto}}
%% \BibTeX command to typeset BibTeX logo in the docs
\AtBeginDocument{%
\providecommand\BibTeX{{%
Bib\TeX}}}
$_acmart_preamble.tex()$
%% end of the preamble, start of the body of the document source.
\begin{document}
$title.tex()$
$_acmart_authors.tex()$
%%
%% The abstract is a short summary of the work to be presented in the
%% article.
$_acmart_abstract.tex()$
%%
%% The code below is generated by the tool at http://dl.acm.org/ccs.cfm.
%% Please copy and paste the code instead of the example below.
%%
$if(acm-metadata.ccs)$
$acm-metadata.ccs$
$endif$
%%
%% Keywords. The author(s) should pick words that accurately describe
%% the work being presented. Separate the keywords with commas.
$if(acm-metadata.keywords)$
\keywords{$for(acm-metadata.keywords)$$it$$sep$, $endfor$}
$endif$
$if(acm-metadata.teaser)$
\begin{verbatim}
\begin{teaserfigure}
\includegraphics[width=\textwidth]{$acm-metadata.teaser.image$}
\caption{$acm-metadata.teaser.caption$}
\Description{$acm-metadata.teaser.description$}
\end{teaserfigure}
\end{verbatim}
$endif$
%%
%% This command processes the author and affiliation and title
%% information and builds the first part of the formatted document.
\maketitle
\setlength{\parskip}{-0.1pt}
$body$
%% begin pandoc before-bib
$-- $before-bib.tex()$
%% end pandoc before-bib
$-- $if(has-frontmatter)$
$-- \backmatter
$-- $endif$
%% begin pandoc biblio
$-- $biblio.tex()$
%% end pandoc biblio
%% begin pandoc include-after
$-- $for(include-after)$
$-- $include-after$
$-- $endfor$
%% end pandoc include-after
%% begin pandoc after-body
$-- $after-body.tex()$
%% end pandoc after-body
\end{document}
\endinput
%%
%% End of file `sample-manuscript.tex'.

View File

@ -0,0 +1,900 @@
\ProvidesFile{acmauthoryear.bbx}[2022-02-14 v0.1 biblatex bibliography style]
% Inherit a default style
\RequireBibliographyStyle{authoryear-comp}
%%% New command definitions from trad-standard.bbx
\newcommand*{\newcommaunit}{\@ifstar\newcommaunitStar\newcommaunitNoStar}
\newcommand*{\newcommaunitStar}{\setunit*{\addcomma\space}}
\newcommand*{\newcommaunitNoStar}{\setunit{\addcomma\space}}
%%% Forward compatibility for date+extradate
\ifcsundef{ifbibmacroundef}{
\ifcsundef{abx@macro@date+extradate}{ %%% For really really old biblatex that miss \ifbibmacroundef
\blx@warning{bibmacro 'date+extradate' is missing.\MessageBreak
Please consider updating your version of biblatex.\MessageBreak
Using 'date+extrayear' instead}%
\providebibmacro*{date+extradate}{\usebibmacro{date+extrayear}}
}{}
}
{
\ifbibmacroundef{date+extradate}{
\blx@warning{bibmacro 'date+extradate' is missing.\MessageBreak
Please consider updating your version of biblatex.\MessageBreak
Using 'date+extrayear' instead}%
\providebibmacro*{date+extradate}{\usebibmacro{date+extrayear}}
}{}
}
%%% Localisation strings for ACM
\DefineBibliographyStrings{american}{%
mathesis = {Master's thesis},
phdthesis = {Ph\adddot{}D\adddotspace Dissertation},
editor = {(Ed\adddot)},
editors = {(Eds\adddot)},
edition = {ed\adddot},
}
%%% Formatting for fields
%\DeclareFieldFormat
% [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
% {title}{#1}
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{numpages}{#1 pages}
\DeclareFieldFormat{number}{#1}
\DeclareFieldFormat{articleno}{Article #1}
\DeclareFieldFormat{key}{#1}
\DeclareFieldFormat{urldate}{Retrieved\space{}#1\space{}from}
\DeclareFieldFormat{lastaccessed}{Retrieved\space{}#1\space{}from}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{edition}{%
\printtext[parens]{\ifinteger{#1}
{\mkbibordedition{#1}~\bibstring{edition}}
{#1\isdot~\bibstring{edition}}}}
% Handle urls field containing 'and' separated list of URLs
% https://github.com/plk/biblatex/issues/229
\DeclareListFormat{urls}{%
\url{#1}%
\ifthenelse{\value{listcount}<\value{liststop}}
{\addcomma\space}
{}}
\renewbibmacro*{url}{\iffieldundef{url}{\printlist{urls}}{\printfield{url}}}
%%% Bibmacro definitions
\renewbibmacro*{translator+others}{%
\ifboolexpr{
test \ifusetranslator
and
not test {\ifnameundef{translator}}
}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}
{\printfield{key}}}
\newbibmacro*{year}{%
\iffieldundef{year}%
{\printtext{[n.\ d.]}}%
{\printfield{year}}%
}
\renewbibmacro*{date}{\printtext[parens]{\printdate}}
\renewbibmacro*{url+urldate}{\iffieldundef{urlyear}
{\iffieldundef{lastaccessed}
{}
{\printfield{lastaccessed}%
\setunit*{\addspace}}%
}
{\usebibmacro{urldate}%
\setunit*{\addspace}}%
\usebibmacro{url}%
}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addcomma\space}%
\iffieldundef{series}
{}
{\newunit%
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{volume+number+date+pages+eid}%
\newcommaunit%
% \setunit{\addspace}%
\usebibmacro{issue-issue}%
\setunit*{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\newbibmacro*{volume+number+date+pages+eid}{%
\printfield{volume}%
\setunit*{\addcomma\space}%
\printfield{number}%
\setunit*{\addcomma\space}%
\printfield{articleno}
\setunit{\addcomma\space}
\usebibmacro{date-ifmonth}
\setunit{\addcomma\space}%
\iffieldundef{pages}%
{\printfield{numpages}}%
{\printfield{pages}}%
\newcommaunit%
\printfield{eid}}%
\renewbibmacro*{chapter+pages}{%
\printfield{chapter}%
\setunit{\bibpagespunct}%
\iffieldundef{pages}%
{\printfield{numpages}}%
{\printfield{pages}}%
\newunit}
\renewbibmacro*{editor+others}{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\setunit{\addcomma\space}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}
{\iflistundef{organization}{}{\printlist{organization}}}
\usebibmacro{date+extradate}
}
\newbibmacro*{issue-issue}{%
\iffieldundef{issue}%
{}%
{\printfield{issue}%
\setunit*{\addcomma\space}%
\usebibmacro{date-ifmonth}%
}%
\newunit}
\newbibmacro*{maintitle+booktitle+series+number}{%
\iffieldundef{maintitle}
{}
{\usebibmacro{maintitle}%
\newunit\newblock
\iffieldundef{volume}
{}
{\printfield{volume}%
\printfield{part}%
\setunit{\addcolon\space}}}%
\usebibmacro{booktitle}%
\setunit*{\addspace}
\printfield[parens]{series}%
\setunit*{\addspace}%
\printfield{number}%
\setunit*{\addcomma\space}%
\printfield{articleno}
\newunit
}
\renewbibmacro*{booktitle}{%
\ifboolexpr{
test {\iffieldundef{booktitle}}
and
test {\iffieldundef{booksubtitle}}
}
{}
{\printtext[booktitle]{%
\printfield[titlecase]{booktitle}%
\iffieldundef{booksubtitle}{}{
\setunit{\subtitlepunct}%
\printfield[titlecase]{booksubtitle}}%
}%
}%
\printfield{booktitleaddon}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit*{\addcomma\space}%
\printfield{number}%
\setunit*{\addcomma\space}%
\printfield{articleno}
\setunit{\addcomma\space}%
\printfield{eid}}
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date-ifmonth}%
\newunit}
\newbibmacro{date-ifmonth}{%
\iffieldundef{month}{}{%
\usebibmacro{date}
}%
}
\renewbibmacro*{institution+location+date}{%
\printlist{school}%
\setunit*{\addcomma\space}%
\printlist{institution}%
\setunit*{\addcomma\space}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date-ifmonth}%
\newunit}
\renewbibmacro*{periodical}{%
\iffieldundef{title}
{}
{\printtext[title]{%
\printfield[titlecase]{title}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{subtitle}}}%
\newunit%
\usebibmacro{journal}}
\renewbibmacro*{issue+date}{%
\iffieldundef{issue}
{\usebibmacro{date}}
{\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}}%
\newunit}
\renewbibmacro*{title+issuetitle}{%
\usebibmacro{periodical}%
\setunit*{\addspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\printfield{volume}%
\setunit*{\addcomma\space}%
\printfield{number}%
\setunit*{\addcomma\space}%
\printfield{articleno}
\setunit{\addcomma\space}%
\printfield{eid}%
\setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:url}
{\iffieldundef{doi}{
\usebibmacro{url+urldate}
}{\iffieldundef{distinctURL}
{}
{\usebibmacro{url+urldate}}
}
}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\iftoggle{bbx:doi}
{\printfield{doi}}
{}}
%%% Definitions for drivers (alphabetical)
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock%
\usebibmacro{title}%
\newunit%
\printlist{language}%
\newunit\newblock%
\usebibmacro{byauthor}%
\newunit\newblock%
\usebibmacro{bytranslator+others}%
\newunit\newblock%
\printfield{version}%
\newunit\newblock%
\usebibmacro{journal+issuetitle}%
\newunit%
\usebibmacro{byeditor+others}%
\newunit%
\printfield{note}%
\newunit\newblock%
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock%
\usebibmacro{doi+eprint+url}%
\newunit\newblock%
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock%
\usebibmacro{related}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{maintitle+title}%
\newunit%
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\usebibmacro{series+number}%
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\newunit\newblock
\printfield{volumes}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\iffieldundef{author}%
{\usebibmacro{byeditor+others}}%
{\usebibmacro{author/translator+others}}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
% \usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\iffieldundef{author}{}%if undef then we already printed editor
{\usebibmacro{byeditor+others}}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{incollection}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{inproceedings}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle+series+number}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{manual}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor}%
\newunit\newblock
\printfield{edition}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{type}%
\newunit
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{misc}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{howpublished}%
\newunit\newblock
\printfield{type}%
\newunit
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\usebibmacro{organization+location+date}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit\newblock
\usebibmacro{date-ifmonth}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\usebibmacro{url+urldate}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareFieldFormat[patent]{number}{Patent No.~#1}
\DeclareBibliographyDriver{patent}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{date}%
\newunit\newblock
\printfield{type}%
\setunit*{\addspace}%
\printfield{number}%
\iflistundef{location}
{}
{\setunit*{\addspace}%
\printtext[parens]{%
\printlist[][-\value{listtotal}]{location}}}%
\newunit\newblock
\usebibmacro{byholder}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{periodical}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{editor}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title+issuetitle}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byeditor}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{report}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\printfield{type}%
\setunit*{\addspace}%
\printfield{number}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\usebibmacro{institution+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isrn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{thesis}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\printfield{type}%
\newunit
\usebibmacro{institution+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
%
% Include support for software entries
%
\blx@inputonce{software.bbx}{biblatex style for software}{}{}{}{}
%
% Handle ACM specific ArtifactSoftware entry exactly as the software entry (a soft alias will not work)
%
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
\map{
\step[typesource=artifactsoftware,typetarget=software]
\step[typesource=artifactdataset,typetarget=dataset]
}
}
}
%%% Compatibility with ACM bibtex formatting
%
% Show given name first in the reference list
%
\DeclareNameAlias{sortname}{given-family}
%
% Produce a bibliography with small font size
%
\renewcommand*{\bibfont}{\bibliofont\footnotesize}
%
% Remove parentheses from date+extradate
%
\RequirePackage{xpatch}
\xpatchbibmacro{date+extradate}{%
\printtext[parens]%
}{%
\newblock\setunit*{.\space}%
\printtext%
}{}{}
%%% Set option values for ACM style
\ExecuteBibliographyOptions{
dashed=false, % Do not use dashes for bibliography items with the same set of authors
labeldate=year,
abbreviate=true,
dateabbrev=true,
isbn=true,
doi=true,
urldate=comp,
url=true,
maxbibnames=9,
maxcitenames=2,
backref=false,
sorting=nty,
halid=true,
swhid=true,
swlabels=true,
vcs=true,
license=false,
language=american
}

View File

@ -0,0 +1,219 @@
\ProvidesFile{acmauthoryear.cbx}[2022-02-14 v0.1]
\RequireCitationStyle{authoryear-comp}
\RequirePackage{xpatch}
%
% Hyperlink citations like acmart natbib implementation
%
% From https://tex.stackexchange.com/a/27615/133551
% Combine label and labelyear links
\xpatchbibmacro{cite}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}%
\usebibmacro{cite:labeldate+extradate}}
{\printtext[bibhyperref]{%
\DeclareFieldAlias{bibhyperref}{default}%
\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}%
\usebibmacro{cite:labeldate+extradate}}}
{}
{\PackageWarning{biblatex-patch}
{Failed to patch cite bibmacro}}
% Include labelname in labelyear link
\xpatchbibmacro{cite}
{\printnames{labelname}%
\setunit{\printdelim{nameyeardelim}}%
\usebibmacro{cite:labeldate+extradate}}
{\printtext[bibhyperref]{%
\DeclareFieldAlias{bibhyperref}{default}%
\printnames{labelname}%
\setunit{\printdelim{nameyeardelim}}%
\usebibmacro{cite:labeldate+extradate}}}
{}
{\PackageWarning{biblatex-patch}
{Failed to patch cite bibmacro}}
\renewbibmacro*{textcite}{%
\iffieldequals{namehash}{\cbx@lasthash}
{\iffieldundef{shorthand}
{\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
\(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
{\setunit{\addcomma}%
\usebibmacro{cite:extradate}}
{\setunit{\compcitedelim}%
\usebibmacro{cite:labeldate+extradate}%
\savefield{labelyear}{\cbx@lastyear}}}
{\setunit{\compcitedelim}%
\usebibmacro{cite:shorthand}%
\global\undef\cbx@lastyear}}
{\ifnameundef{labelname}
{\iffieldundef{shorthand}
{\usebibmacro{cite:label}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nonameyeardelim}\bibopenbracket}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}}
{\printnames{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nameyeardelim}\bibopenbracket}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\iffieldundef{shorthand}
{\iffieldundef{labelyear}
{\usebibmacro{cite:label}}
{\usebibmacro{cite:labeldate+extradate}}%
\savefield{labelyear}{\cbx@lastyear}}
{\usebibmacro{cite:shorthand}%
\global\undef\cbx@lastyear}}%
\stepcounter{textcitecount}%
\savefield{namehash}{\cbx@lasthash}}%
\setunit{%
\ifbool{cbx:parens}
{\bibclosebracket\global\boolfalse{cbx:parens}}
{}%
\textcitedelim}}
\xpatchbibmacro{textcite}
{\printnames{labelname}}
{\printtext[bibhyperref]{\printnames{labelname}}}
{}
{\PackageWarning{biblatex-patch}
{Failed to patch textcite bibmacro}}
\renewbibmacro*{textcite:postnote}{%
\usebibmacro{postnote}%
\ifthenelse{\value{multicitecount}=\value{multicitetotal}}
{\setunit{}%
\printtext{%
\ifbool{cbx:parens}
{\bibclosebracket\global\boolfalse{cbx:parens}}
{}}}
{\setunit{%
\ifbool{cbx:parens}
{\bibclosebracket\global\boolfalse{cbx:parens}}
{}%
\textcitedelim}}}
% NEW
\newbibmacro*{citeauthor}{%
\ifnameundef{labelname}
{\iffieldundef{shorthand}
{\printtext[bibhyperref]{%
\usebibmacro{cite:label}}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nonameyeardelim}\bibopenbracket}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\printtext[bibhyperref]{\usebibmacro{cite:labeldate+extradate}}}
{\printtext[bibhyperref]{\usebibmacro{cite:shorthand}}}}
\printtext[bibhyperref]{\printnames{labelname}}}
%
% Put brackets around citations
%
\DeclareCiteCommand{\cite}[\mkbibbrackets]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{}
{\usebibmacro{postnote}}
\DeclareCiteCommand*{\cite}[\mkbibbrackets]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citeyear}}
{}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\parencite}[\mkbibbrackets]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{}
{\usebibmacro{postnote}}
\DeclareCiteCommand*{\parencite}[\mkbibbrackets]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citeyear}}
{}
{\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\parencites}[\mkbibbrackets]{\parencite}
{\setunit{\multicitedelim}}
\DeclareCiteCommand{\footcite}[\mkbibfootnote]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibbrackets\mkbibfootnote]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{}
{\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\smartcites}[\iffootnote\mkbibbrackets\mkbibfootnote]
{\smartcite}{\setunit{\multicitedelim}}
\DeclareCiteCommand{\citeauthor}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citeauthor}}
{}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\citeyear}
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citeyear}}
{}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\citeyearpar}[\mkbibbrackets]
{\usebibmacro{cite:init}%
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citeyear}}
{}
{\usebibmacro{postnote}}
%
% Provide aliases for natbib-compatible commands
%
\newcommand*{\citep}{\parencite}
\newcommand*{\citet}{\textcite}
% add others here
\endinput

View File

@ -0,0 +1,33 @@
% Teach biblatex about numpages field
\DeclareDatamodelFields[type=field, datatype=literal]{numpages}
\DeclareDatamodelEntryfields{numpages}
% Teach biblatex about articleno field
\DeclareDatamodelFields[type=field, datatype=literal]{articleno}
\DeclareDatamodelEntryfields{articleno}
% Teach biblatex about urls field
\DeclareDatamodelFields[type=list, datatype=uri]{urls}
\DeclareDatamodelEntryfields{urls}
% Teach biblatex about school field
\DeclareDatamodelFields[type=list, datatype=literal]{school}
\DeclareDatamodelEntryfields[thesis]{school}
\DeclareDatamodelFields[type=field, datatype=literal]{key}
\DeclareDatamodelEntryfields{key}
% Teach biblatex about lastaccessed field
\DeclareDatamodelFields[type=field,datatype=literal]{lastaccessed}
\DeclareDatamodelEntryfields{lastaccessed}
% Teach biblatex about distincturl field
\DeclareDatamodelFields[type=field, datatype=literal]{distinctURL}
\DeclareDatamodelEntryfields{distinctURL}
%
% include software data model from biblatex-software
%
\blx@inputonce{software.dbx}{biblatex data model extension for software}{}{}{}{}

View File

@ -0,0 +1,885 @@
\ProvidesFile{acmnumeric.bbx}[2017-09-27 v0.1 biblatex bibliography style]
% Inherit a default style
\RequireBibliographyStyle{trad-plain}
%%% Localisation strings for ACM
\DefineBibliographyStrings{american}{%
mathesis = {Master's thesis},
phdthesis = {Ph\adddot{}D\adddotspace Dissertation},
editor = {(Ed\adddot)},
editors = {(Eds\adddot)},
edition = {ed\adddot},
}
%%% Formatting for fields
%\DeclareFieldFormat
% [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
% {title}{#1}
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{numpages}{#1 pages}
\DeclareFieldFormat{number}{#1}
\DeclareFieldFormat{articleno}{Article #1}
\DeclareFieldFormat{key}{#1}
\DeclareFieldFormat{urldate}{Retrieved\space{}#1\space{}from}
\DeclareFieldFormat{lastaccessed}{Retrieved\space{}#1\space{}from}
\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{edition}{%
\printtext[parens]{\ifinteger{#1}
{\mkbibordedition{#1}~\bibstring{edition}}
{#1\isdot~\bibstring{edition}}}}
% Handle urls field containing 'and' separated list of URLs
% https://github.com/plk/biblatex/issues/229
\DeclareListFormat{urls}{%
\url{#1}%
\ifthenelse{\value{listcount}<\value{liststop}}
{\addcomma\space}
{}}
\renewbibmacro*{url}{\iffieldundef{url}{\printlist{urls}}{\printfield{url}}}
%%% Bibmacro definitions
\renewbibmacro*{translator+others}{%
\ifboolexpr{
test \ifusetranslator
and
not test {\ifnameundef{translator}}
}
{\printnames{translator}%
\setunit{\addcomma\space}%
\usebibmacro{translator+othersstrg}%
\clearname{translator}}
{\printfield{key}}}
\newbibmacro*{year}{%
\iffieldundef{year}%
{\printtext{[n.\ d.]}}%
{\printfield{year}}%
}
\renewbibmacro*{date}{\printtext[parens]{\printdate}}
\renewbibmacro*{url+urldate}{\iffieldundef{urlyear}
{\iffieldundef{lastaccessed}
{}
{\printfield{lastaccessed}%
\setunit*{\addspace}}%
}
{\usebibmacro{urldate}%
\setunit*{\addspace}}%
\usebibmacro{url}%
}
\renewbibmacro*{journal+issuetitle}{%
\usebibmacro{journal}%
\setunit*{\addcomma\space}%
\iffieldundef{series}
{}
{\newunit%
\printfield{series}%
\setunit{\addspace}}%
\usebibmacro{volume+number+date+pages+eid}%
\newcommaunit%
% \setunit{\addspace}%
\usebibmacro{issue-issue}%
\setunit*{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\newbibmacro*{volume+number+date+pages+eid}{%
\printfield{volume}%
\setunit*{\addcomma\space}%
\printfield{number}%
\setunit*{\addcomma\space}%
\printfield{articleno}
\setunit{\addcomma\space}
\usebibmacro{date-ifmonth}
\setunit{\addcomma\space}%
\iffieldundef{pages}%
{\printfield{numpages}}%
{\printfield{pages}}%
\newcommaunit%
\printfield{eid}}%
\renewbibmacro*{chapter+pages}{%
\printfield{chapter}%
\setunit{\bibpagespunct}%
\iffieldundef{pages}%
{\printfield{numpages}}%
{\printfield{pages}}%
\newunit}
\renewbibmacro*{editor+others}{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\printnames{editor}%
\setunit{\addcomma\space}%
\usebibmacro{editor+othersstrg}%
\clearname{editor}}
{\iflistundef{organization}{}{\printlist{organization}}}}
\newbibmacro*{issue-issue}{%
\iffieldundef{issue}%
{}%
{\printfield{issue}%
\setunit*{\addcomma\space}%
\usebibmacro{date-ifmonth}%
}%
\newunit}
\newbibmacro*{maintitle+booktitle+series+number}{%
\iffieldundef{maintitle}
{}
{\usebibmacro{maintitle}%
\newunit\newblock
\iffieldundef{volume}
{}
{\printfield{volume}%
\printfield{part}%
\setunit{\addcolon\space}}}%
\usebibmacro{booktitle}%
\setunit*{\addspace}
\printfield[parens]{series}%
\setunit*{\addspace}%
\printfield{number}%
\setunit*{\addcomma\space}%
\printfield{articleno}
\newunit
}
\renewbibmacro*{booktitle}{%
\ifboolexpr{
test {\iffieldundef{booktitle}}
and
test {\iffieldundef{booksubtitle}}
}
{}
{\printtext[booktitle]{%
\printfield[titlecase]{booktitle}%
\iffieldundef{booksubtitle}{}{
\setunit{\subtitlepunct}%
\printfield[titlecase]{booksubtitle}}%
}%
}%
\printfield{booktitleaddon}}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
\setunit*{\addcomma\space}%
\printfield{number}%
\setunit*{\addcomma\space}%
\printfield{articleno}
\setunit{\addcomma\space}%
\printfield{eid}}
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date-ifmonth}%
\newunit}
\newbibmacro{date-ifmonth}{%
\iffieldundef{month}{}{%
\usebibmacro{date}
}%
}
\renewbibmacro*{institution+location+date}{%
\printlist{school}%
\setunit*{\addcomma\space}%
\printlist{institution}%
\setunit*{\addcomma\space}%
\printlist{location}%
\setunit*{\addcomma\space}%
\usebibmacro{date-ifmonth}%
\newunit}
\renewbibmacro*{periodical}{%
\iffieldundef{title}
{}
{\printtext[title]{%
\printfield[titlecase]{title}%
\setunit{\subtitlepunct}%
\printfield[titlecase]{subtitle}}}%
\newunit%
\usebibmacro{journal}}
\renewbibmacro*{issue+date}{%
\iffieldundef{issue}
{\usebibmacro{date}}
{\printfield{issue}%
\setunit*{\addspace}%
\usebibmacro{date}}%
\newunit}
\renewbibmacro*{title+issuetitle}{%
\usebibmacro{periodical}%
\setunit*{\addspace}%
\iffieldundef{series}
{}
{\newunit
\printfield{series}%
\setunit{\addspace}}%
\printfield{volume}%
\setunit*{\addcomma\space}%
\printfield{number}%
\setunit*{\addcomma\space}%
\printfield{articleno}
\setunit{\addcomma\space}%
\printfield{eid}%
\setunit{\addspace}%
\usebibmacro{issue+date}%
\setunit{\addcolon\space}%
\usebibmacro{issue}%
\newunit}
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:url}
{\iffieldundef{doi}{
\usebibmacro{url+urldate}
}{\iffieldundef{distinctURL}
{}
{\usebibmacro{url+urldate}}
}
}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\iftoggle{bbx:doi}
{\printfield{doi}}
{}}
%%% Definitions for drivers (alphabetical)
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock%
\usebibmacro{year}%
\newunit%
\usebibmacro{title}%
\newunit%
\printlist{language}%
\newunit\newblock%
\usebibmacro{byauthor}%
\newunit\newblock%
\usebibmacro{bytranslator+others}%
\newunit\newblock%
\printfield{version}%
\newunit\newblock%
\usebibmacro{journal+issuetitle}%
\newunit%
\usebibmacro{byeditor+others}%
\newunit%
\printfield{note}%
\newunit\newblock%
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock%
\usebibmacro{doi+eprint+url}%
\newunit\newblock%
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock%
\usebibmacro{related}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}%
\newunit%
\usebibmacro{maintitle+title}%
\newunit%
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{edition}%
\newunit
\usebibmacro{series+number}%
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\newunit\newblock
\printfield{volumes}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\iffieldundef{author}%
{\usebibmacro{byeditor+others}}%
{\usebibmacro{author/translator+others}}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}
\newunit\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
% \usebibmacro{in:}%
\usebibmacro{bybookauthor}%
\newunit\newblock
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\iffieldundef{author}{}%if undef then we already printed editor
{\usebibmacro{byeditor+others}}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{incollection}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}
\newunit\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{edition}%
\newunit
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{inproceedings}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}
\newunit\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{in:}%
\usebibmacro{maintitle+booktitle+series+number}%
\newunit\newblock
\usebibmacro{event+venue+date}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\iffieldundef{maintitle}
{\printfield{volume}%
\printfield{part}}
{}%
\newunit
\printfield{volumes}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{manual}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}
\newunit\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor}%
\newunit\newblock
\printfield{edition}%
\newunit\newblock
\usebibmacro{series+number}%
\newunit\newblock
\printfield{type}%
\newunit
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit
\usebibmacro{publisher+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{misc}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}
\newunit\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{howpublished}%
\newunit\newblock
\printfield{type}%
\newunit
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\usebibmacro{organization+location+date}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{online}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor+others/translator+others}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{byeditor+others}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\printlist{organization}%
\newunit\newblock
\usebibmacro{date-ifmonth}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\usebibmacro{url+urldate}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareFieldFormat[patent]{number}{Patent No.~#1}
\DeclareBibliographyDriver{patent}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}%
\newunit
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\usebibmacro{date}%
\newunit\newblock
\printfield{type}%
\setunit*{\addspace}%
\printfield{number}%
\iflistundef{location}
{}
{\setunit*{\addspace}%
\printtext[parens]{%
\printlist[][-\value{listtotal}]{location}}}%
\newunit\newblock
\usebibmacro{byholder}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{periodical}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{editor}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}
\newunit
\usebibmacro{title+issuetitle}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byeditor}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{issn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{report}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}
\newunit
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\printfield{type}%
\setunit*{\addspace}%
\printfield{number}%
\newunit\newblock
\printfield{version}%
\newunit
\printfield{note}%
\newunit\newblock
\usebibmacro{institution+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isrn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
\DeclareBibliographyDriver{thesis}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}%
\setunit{\labelnamepunct}\newblock
\usebibmacro{year}
\newunit
\usebibmacro{title}%
\newunit
\printlist{language}%
\newunit\newblock
\usebibmacro{byauthor}%
\newunit\newblock
\printfield{type}%
\newunit
\usebibmacro{institution+location+date}%
\newunit\newblock
\usebibmacro{chapter+pages}%
\newunit
\printfield{pagetotal}%
\newunit\newblock
\iftoggle{bbx:isbn}
{\printfield{isbn}}
{}%
\newunit\newblock
\usebibmacro{doi+eprint+url}%
\newunit\newblock
\usebibmacro{addendum+pubstate}%
\setunit{\bibpagerefpunct}\newblock
\usebibmacro{pageref}%
\newunit\newblock
\printfield{note}%
\newunit\newblock
\iftoggle{bbx:related}
{\usebibmacro{related:init}%
\usebibmacro{related}}
{}%
\usebibmacro{finentry}}
%
% Include support for software entries
%
\blx@inputonce{software.bbx}{biblatex style for software}{}{}{}{}
%
% Handle ACM specific ArtifactSoftware entry exactly as the software entry (a soft alias will not work)
%
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{
\map{
\step[typesource=artifactsoftware,typetarget=software]
\step[typesource=artifactdataset,typetarget=dataset]
}
}
}
%
% Show given name first in the reference list
%
\DeclareNameAlias{sortname}{given-family}
%
% Produce a bibliography with small font size
%
\renewcommand*{\bibfont}{\bibliofont\footnotesize}
%%% Set option values for ACM style
\ExecuteBibliographyOptions{
labeldate=year,
abbreviate=true,
dateabbrev=true,
isbn=true,
doi=true,
urldate=comp,
url=true,
maxbibnames=9,
maxcitenames=2,
backref=false,
sorting=nty,
halid=true,
swhid=true,
swlabels=true,
vcs=true,
license=false,
language=american
}

View File

@ -0,0 +1,5 @@
\ProvidesFile{acmnumeric.cbx}[2017-09-27 v0.1]
\RequireCitationStyle{numeric}
\endinput

View File

@ -0,0 +1,95 @@
function has_class(el, class)
if el.attr == nil then
return nil
end
for i,v in ipairs(el.attr.classes) do
if v == class then
return true
end
end
return false
end
function get_block_with_class(el, class)
return find_node(el, function(el)
return has_class(el, class)
end)
end
function get_image(el)
return find_node(el, function (v)
return v.t == "Image"
end)
end
function attribute(el, name, default)
for k,v in pairs(el.attr.attributes) do
if k == name then
return v
end
end
return default
end
function replace_node(blocks, predicate, replacement)
for i, el in pairs(blocks) do
if predicate(el) then
table.remove(blocks, i)
if type(replacement) == "function" then
replacement = replacement(el)
end
table.insert(blocks, i, replacement)
return el
end
end
return nil
end
local bibname = ''
return {
{
Meta = function(meta)
for _i, v in ipairs(meta.bibliography) do
if bibname ~= '' then
bibname = bibname .. ','
end
bibname = bibname .. pandoc.utils.stringify(v)
end
end,
Pandoc = function(doc)
if not quarto.doc.is_format("latex") then
return doc
end
-- add bibliography to the right place
-- local bibname = "sample-base"
local bibliography = pandoc.RawBlock(
"latex",
"\\bibliographystyle{ACM-Reference-Format}\n\\bibliography{" .. bibname .. "}")
replace_node(doc.blocks, function(el)
return el.t == "Header" and pandoc.utils.stringify(el.content) == "References"
end, bibliography)
-- fix appendix compilation
local appendix = pandoc.RawBlock("latex", "\\appendix")
replace_node(doc.blocks, function(el)
return el.t == "Header" and pandoc.utils.stringify(el.content) == "Appendix"
end, appendix)
-- fix acknowledgments
replace_node(doc.blocks, function(el)
return el.t == "Div" and has_class(el, "acks")
end, function(el)
local text = pandoc.write(pandoc.Pandoc(el.content), "latex")
local node = pandoc.RawBlock(
"latex", "\\begin{acks}\n" .. text .. "\n\\end{acks}")
return node
end)
return doc
end
}
}

View File

@ -0,0 +1,644 @@
%%
%% This is file `article.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% classes.dtx (with options: `article')
%%
%% This is a generated file.
%%
%% The source is maintained by the LaTeX Project team and bug
%% reports for it can be opened at https://latex-project.org/bugs.html
%% (but please observe conditions on bug reports sent to that address!)
%%
%%
%% Copyright (C) 1993-2022
%% The LaTeX Project and any individual authors listed elsewhere
%% in this file.
%%
%% This file was generated from file(s) of the LaTeX base system.
%% --------------------------------------------------------------
%%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008 or later.
%%
%% This file has the LPPL maintenance status "maintained".
%%
%% This file may only be distributed together with a copy of the LaTeX
%% base system. You may however distribute the LaTeX base system without
%% such generated files.
%%
%% The list of all files belonging to the LaTeX base distribution is
%% given in the file `manifest.txt'. See also `legal.txt' for additional
%% information.
%%
%% The list of derived (unpacked) files belonging to the distribution
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{article}
[2021/10/04 v1.4n
Standard LaTeX document class]
\newcommand\@ptsize{}
\newif\if@restonecol
\newif\if@titlepage
\@titlepagefalse
\if@compatibility\else
\DeclareOption{a4paper}
{\setlength\paperheight {297mm}%
\setlength\paperwidth {210mm}}
\DeclareOption{a5paper}
{\setlength\paperheight {210mm}%
\setlength\paperwidth {148mm}}
\DeclareOption{b5paper}
{\setlength\paperheight {250mm}%
\setlength\paperwidth {176mm}}
\DeclareOption{letterpaper}
{\setlength\paperheight {11in}%
\setlength\paperwidth {8.5in}}
\DeclareOption{legalpaper}
{\setlength\paperheight {14in}%
\setlength\paperwidth {8.5in}}
\DeclareOption{executivepaper}
{\setlength\paperheight {10.5in}%
\setlength\paperwidth {7.25in}}
\DeclareOption{landscape}
{\setlength\@tempdima {\paperheight}%
\setlength\paperheight {\paperwidth}%
\setlength\paperwidth {\@tempdima}}
\fi
\if@compatibility
\renewcommand\@ptsize{0}
\else
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\fi
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
\if@compatibility\else
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\fi
\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
\DeclareOption{draft}{\setlength\overfullrule{5pt}}
\if@compatibility\else
\DeclareOption{final}{\setlength\overfullrule{0pt}}
\fi
\DeclareOption{titlepage}{\@titlepagetrue}
\if@compatibility\else
\DeclareOption{notitlepage}{\@titlepagefalse}
\fi
\if@compatibility\else
\DeclareOption{onecolumn}{\@twocolumnfalse}
\fi
\DeclareOption{twocolumn}{\@twocolumntrue}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
\DeclareOption{openbib}{%
\AtEndOfPackage{%
\renewcommand\@openbib@code{%
\advance\leftmargin\bibindent
\itemindent -\bibindent
\listparindent \itemindent
\parsep \z@
}%
\renewcommand\newblock{\par}}%
}
\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final}
\ProcessOptions
\input{size1\@ptsize.clo}
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}
\setlength\parskip{0\p@ \@plus \p@}
\@lowpenalty 51
\@medpenalty 151
\@highpenalty 301
\setcounter{topnumber}{2}
\renewcommand\topfraction{.7}
\setcounter{bottomnumber}{1}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{3}
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\renewcommand\dbltopfraction{.7}
\renewcommand\dblfloatpagefraction{.5}
\if@twoside
\def\ps@headings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
\def\@evenhead{\thepage\hfil\slshape\leftmark}%
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\let\@mkboth\markboth
\def\sectionmark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
\thesection\quad
\fi
##1}}{}}%
\def\subsectionmark##1{%
\markright {%
\ifnum \c@secnumdepth >\@ne
\thesubsection\quad
\fi
##1}}}
\else
\def\ps@headings{%
\let\@oddfoot\@empty
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\let\@mkboth\markboth
\def\sectionmark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\thesection\quad
\fi
##1}}}}
\fi
\def\ps@myheadings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
\def\@evenhead{\thepage\hfil\slshape\leftmark}%
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\let\@mkboth\@gobbletwo
\let\sectionmark\@gobble
\let\subsectionmark\@gobble
}
\if@titlepage
\newcommand\maketitle{\begin{titlepage}%
\let\footnotesize\small
\let\footnoterule\relax
\let \footnote \thanks
\null\vfil
\vskip 60\p@
\begin{center}%
{\LARGE \@title \par}%
\vskip 3em%
{\large
\lineskip .75em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1.5em%
{\large \@date \par}% % Set date in \large size.
\end{center}\par
\@thanks
\vfil\null
\end{titlepage}%
\setcounter{footnote}{0}%
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
}
\else
\newcommand\maketitle{\par
\begingroup
\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
\long\def\@makefntext##1{\parindent 1em\noindent
\hb@xt@1.8em{%
\hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
\if@twocolumn
\ifnum \col@number=\@ne
\@maketitle
\else
\twocolumn[\@maketitle]%
\fi
\else
\newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle
\fi
\thispagestyle{plain}\@thanks
\endgroup
\setcounter{footnote}{0}%
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
}
\def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\large \@date}%
\end{center}%
\par
\vskip 1.5em}
\fi
\setcounter{secnumdepth}{3}
\newcounter {part}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]
\renewcommand \thepart {\@Roman\c@part}
\renewcommand \thesection {\@arabic\c@section}
\renewcommand\thesubsection {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}
\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
\newcommand\part{%
\if@noskipsec \leavevmode \fi
\par
\addvspace{4ex}%
\@afterindentfalse
\secdef\@part\@spart}
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
{\parindent \z@ \raggedright
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >\m@ne
\Large\bfseries \partname\nobreakspace\thepart
\par\nobreak
\fi
\huge \bfseries #2%
\markboth{}{}\par}%
\nobreak
\vskip 3ex
\@afterheading}
\def\@spart#1{%
{\parindent \z@ \raggedright
\interlinepenalty \@M
\normalfont
\huge \bfseries #1\par}%
\nobreak
\vskip 3ex
\@afterheading}
\newcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}}
\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries}}
\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries}}
\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\if@twocolumn
\setlength\leftmargini {2em}
\else
\setlength\leftmargini {2.5em}
\fi
\leftmargin \leftmargini
\setlength\leftmarginii {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv {1.7em}
\if@twocolumn
\setlength\leftmarginv {.5em}
\setlength\leftmarginvi {.5em}
\else
\setlength\leftmarginv {1em}
\setlength\leftmarginvi {1em}
\fi
\setlength \labelsep {.5em}
\setlength \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\@beginparpenalty -\@lowpenalty
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{(\theenumii)}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}
\newcommand\labelitemi {\labelitemfont \textbullet}
\newcommand\labelitemii {\labelitemfont \bfseries \textendash}
\newcommand\labelitemiii{\labelitemfont \textasteriskcentered}
\newcommand\labelitemiv {\labelitemfont \textperiodcentered}
\newcommand\labelitemfont{\normalfont}
\newenvironment{description}
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\descriptionlabel}}
{\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep
\normalfont\bfseries #1}
\if@titlepage
\newenvironment{abstract}{%
\titlepage
\null\vfil
\@beginparpenalty\@lowpenalty
\begin{center}%
\bfseries \abstractname
\@endparpenalty\@M
\end{center}}%
{\par\vfil\null\endtitlepage}
\else
\newenvironment{abstract}{%
\if@twocolumn
\section*{\abstractname}%
\else
\small
\begin{center}%
{\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
\end{center}%
\quotation
\fi}
{\if@twocolumn\else\endquotation\fi}
\fi
\newenvironment{verse}
{\let\\\@centercr
\list{}{\itemsep \z@
\itemindent -1.5em%
\listparindent\itemindent
\rightmargin \leftmargin
\advance\leftmargin 1.5em}%
\item\relax}
{\endlist}
\newenvironment{quotation}
{\list{}{\listparindent 1.5em%
\itemindent \listparindent
\rightmargin \leftmargin
\parsep \z@ \@plus\p@}%
\item\relax}
{\endlist}
\newenvironment{quote}
{\list{}{\rightmargin\leftmargin}%
\item\relax}
{\endlist}
\if@compatibility
\newenvironment{titlepage}
{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse\newpage
\fi
\thispagestyle{empty}%
\setcounter{page}\z@
}%
{\if@restonecol\twocolumn \else \newpage \fi
}
\else
\newenvironment{titlepage}
{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse\newpage
\fi
\thispagestyle{empty}%
\setcounter{page}\@ne
}%
{\if@restonecol\twocolumn \else \newpage \fi
\if@twoside\else
\setcounter{page}\@ne
\fi
}
\fi
\newcommand\appendix{\par
\setcounter{section}{0}%
\setcounter{subsection}{0}%
\gdef\thesection{\@Alph\c@section}}
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
\renewcommand \theequation {\@arabic\c@equation}
\newcounter{figure}
\renewcommand \thefigure {\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\figurename\nobreakspace\thefigure}
\newenvironment{figure}
{\@float{figure}}
{\end@float}
\newenvironment{figure*}
{\@dblfloat{figure}}
{\end@dblfloat}
\newcounter{table}
\renewcommand\thetable{\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\tablename\nobreakspace\thetable}
\newenvironment{table}
{\@float{table}}
{\end@float}
\newenvironment{table*}
{\@dblfloat{table}}
{\end@dblfloat}
\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{0\p@}
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}%
\ifdim \wd\@tempboxa >\hsize
#1: #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
\newcommand\@pnumwidth{1.55em}
\newcommand\@tocrmarg{2.55em}
\newcommand\@dotsep{4.5}
\setcounter{tocdepth}{3}
\newcommand\tableofcontents{%
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{toc}%
}
\newcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty\@secpenalty
\addvspace{2.25em \@plus\p@}%
\setlength\@tempdima{3em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\large \bfseries #1\hfil
\hb@xt@\@pnumwidth{\hss #2%
\kern-\p@\kern\p@}}\par
\nobreak
\if@compatibility
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\fi
\endgroup
\fi}
\newcommand*\l@section[2]{%
\ifnum \c@tocdepth >\z@
\addpenalty\@secpenalty
\addvspace{1.0em \@plus\p@}%
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil
\nobreak\hb@xt@\@pnumwidth{\hss #2%
\kern-\p@\kern\p@}\par
\endgroup
\fi}
\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
\newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\newcommand\listoffigures{%
\section*{\listfigurename}%
\@mkboth{\MakeUppercase\listfigurename}%
{\MakeUppercase\listfigurename}%
\@starttoc{lof}%
}
\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
\newcommand\listoftables{%
\section*{\listtablename}%
\@mkboth{%
\MakeUppercase\listtablename}%
{\MakeUppercase\listtablename}%
\@starttoc{lot}%
}
\let\l@table\l@figure
\newdimen\bibindent
\setlength\bibindent{1.5em}
\newenvironment{thebibliography}[1]
{\section*{\refname}%
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\let\@openbib@code\@empty
\newenvironment{theindex}
{\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\twocolumn[\section*{\indexname}]%
\@mkboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
\thispagestyle{plain}\parindent\z@
\parskip\z@ \@plus .3\p@\relax
\columnseprule \z@
\columnsep 35\p@
\let\item\@idxitem}
{\if@restonecol\onecolumn\else\clearpage\fi}
\newcommand\@idxitem{\par\hangindent 40\p@}
\newcommand\subitem{\@idxitem \hspace*{20\p@}}
\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
\renewcommand\footnoterule{%
\kern-3\p@
\hrule\@width.4\columnwidth
\kern2.6\p@}
\newcommand\@makefntext[1]{%
\parindent 1em%
\noindent
\hb@xt@1.8em{\hss\@makefnmark}#1}
\newcommand\contentsname{Contents}
\newcommand\listfigurename{List of Figures}
\newcommand\listtablename{List of Tables}
\newcommand\refname{References}
\newcommand\indexname{Index}
\newcommand\figurename{Figure}
\newcommand\tablename{Table}
\newcommand\partname{Part}
\newcommand\appendixname{Appendix}
\newcommand\abstractname{Abstract}
\def\today{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space\number\day, \number\year}
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}
\pagestyle{plain}
\pagenumbering{arabic}
\if@twoside
\else
\raggedbottom
\fi
\if@twocolumn
\twocolumn
\sloppy
\flushbottom
\else
\onecolumn
\fi
\endinput
%%
%% End of file `article.cls'.

View File

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
<info>
<title>Association for Computing Machinery</title>
<title-short>ACM</title-short>
<id>http://www.zotero.org/styles/association-for-computing-machinery</id>
<link href="http://www.zotero.org/styles/association-for-computing-machinery" rel="self"/>
<link href="http://www.zotero.org/styles/acm-sigchi-proceedings" rel="template"/>
<link href="https://www.acm.org/publications/authors/reference-formatting" rel="documentation"/>
<author>
<name>Patrick O'Brien</name>
<email>obrienpat86@gmail.com</email>
</author>
<category citation-format="numeric"/>
<category field="engineering"/>
<updated>2019-12-18T14:04:18+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="author">
<group suffix=".">
<names variable="author">
<name delimiter=", " and="text" sort-separator=", "/>
<label form="short" text-case="capitalize-first" prefix=" (" suffix=")"/>
<substitute>
<names variable="editor"/>
</substitute>
</names>
</group>
</macro>
<macro name="editor">
<names variable="editor">
<name delimiter=", " and="text" delimiter-precedes-last="never"/>
<label form="short" prefix=" (" suffix=")"/>
</names>
</macro>
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<group delimiter=" ">
<text variable="title" font-style="italic"/>
<group delimiter=" " prefix="(" suffix=")">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</group>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="year">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="journal">
<group delimiter=", ">
<group delimiter=" ">
<text variable="container-title" form="short" font-style="italic"/>
<text variable="volume" suffix=","/>
<group>
<text variable="issue" suffix=" "/>
<date date-parts="year-month" form="text" variable="issued" prefix="(" suffix=")"/>
</group>
</group>
</group>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition"/>
</else>
</choose>
</macro>
<macro name="book-publisher">
<group delimiter=", ">
<text variable="publisher"/>
<text variable="publisher-place"/>
</group>
</macro>
<macro name="access">
<choose>
<if variable="DOI">
<text variable="DOI" prefix="DOI:https://doi.org/"/>
</if>
<else-if variable="URL">
<group delimiter=" ">
<text term="retrieved" text-case="capitalize-first"/>
<date variable="accessed" form="text"/>
<text term="from"/>
<text variable="URL"/>
</group>
</else-if>
</choose>
</macro>
<citation collapse="citation-number">
<sort>
<key variable="citation-number"/>
</sort>
<layout prefix="[" suffix="]" delimiter=",">
<group delimiter=":">
<text variable="citation-number"/>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography second-field-align="flush" entry-spacing="0">
<sort>
<key macro="author"/>
<key variable="issued"/>
</sort>
<layout>
<text variable="citation-number" prefix="[" suffix="]"/>
<group delimiter=". " suffix=". ">
<text macro="author"/>
<text macro="year"/>
<text macro="title"/>
</group>
<group suffix=".">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<text macro="book-publisher" suffix="."/>
</if>
<else-if type="paper-conference">
<group suffix="." delimiter=", ">
<group delimiter=" ">
<text term="in" text-case="capitalize-first"/>
<group delimiter=" ">
<text variable="container-title" font-style="italic"/>
<text variable="collection-title" prefix="(" suffix=")"/>
</group>
</group>
<text macro="book-publisher"/>
<text variable="page"/>
</group>
</else-if>
<else-if type="chapter" match="any">
<group delimiter=" ">
<text term="in" text-case="capitalize-first"/>
<group delimiter=", ">
<group delimiter=" ">
<text variable="container-title" font-style="italic"/>
<text macro="edition" prefix="(" suffix=")"/>
</group>
<text macro="editor"/>
</group>
</group>
<group suffix="." delimiter=", " prefix=". ">
<text macro="book-publisher"/>
<text variable="page"/>
</group>
</else-if>
<else-if type="speech" match="any">
<group delimiter=". ">
<group delimiter=" ">
<text term="in" text-case="capitalize-first"/>
<group delimiter=", ">
<group delimiter=" ">
<text variable="event" font-style="italic"/>
<text macro="edition" prefix="(" suffix=")"/>
</group>
<text macro="editor"/>
</group>
</group>
<group delimiter=", " suffix=".">
<text macro="book-publisher"/>
<text variable="page"/>
</group>
</group>
</else-if>
<else-if type="article-journal">
<group delimiter=", " suffix=".">
<text macro="journal"/>
<text variable="page"/>
</group>
</else-if>
<else-if type="thesis" match="any">
<group delimiter=". ">
<text variable="genre"/>
<text macro="book-publisher"/>
</group>
</else-if>
<else>
<group suffix="." delimiter=", ">
<group delimiter=" " font-style="italic">
<text variable="container-title"/>
<text variable="volume"/>
</group>
<text variable="page"/>
</group>
</else>
</choose>
</group>
<text macro="access" prefix=" "/>
</layout>
</bibliography>
</style>

View File

@ -0,0 +1,46 @@
--[[
If you extension format needs some special processing, include a Lua filter to be used in addition of Quarto built-in ones.
Quarto exports utils function that can be used in all filters. See
https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/pandoc/datadir/init.lua#L1522-L1576
]]--
-- Example: allow to color words by using a span attribute.
-- This filter will use the correct syntax depending on the format
color_span = function(el)
color = el.attributes['color']
-- if no color attribute, return unchange
if color == nil then return el end
-- transform to <span class="color-*"></span>
if quarto.doc.is_format("html") then
-- remove color attributes
el.attributes['color'] = nil
-- use style attribute instead
el.classes:insert('color-' .. color )
-- return full span element
return el
elseif quarto.doc.is_format("pdf") then
-- remove color attributes
el.attributes['color'] = nil
-- encapsulate in latex code
table.insert(
el.content, 1,
pandoc.RawInline('latex', '\\textcolor{'..color..'}{')
)
table.insert(
el.content,
pandoc.RawInline('latex', '}')
)
-- returns only span content
return el.content
else
-- for other format return unchanged
return el
end
end
return {
{
Span = color_span
}
}

View File

@ -0,0 +1,7 @@
/*-- scss:defaults --*/
$pink: rgb(219, 48, 122);
/*-- scss:rules --*/
.mcolor-mypink {
color: $pink;
}

View File

@ -0,0 +1,74 @@
function has_class(el, class)
if el.attr == nil then
return nil
end
for i,v in ipairs(el.attr.classes) do
if v == class then
return true
end
end
return false
end
function find_node(el, predicate)
if el.content == nil then
return nil
end
for i, v in ipairs(el.content) do
if predicate(v) then
return v
end
if v.content ~= nil then
local r = find_node(v, predicate)
if r ~= nil then
return r
end
end
end
return nil
end
function get_block_with_class(el, class)
return find_node(el, function(el)
return has_class(el, class)
end)
end
function get_image(el)
return find_node(el, function (v)
return v.t == "Image"
end)
end
function attribute(el, name, default)
for k,v in pairs(el.attr.attributes) do
if k == name then
return v
end
end
return default
end
return {
{
Image = function(image)
local description = attribute(image, "fig-alt", nil)
if description == nil then
return image
end
description = pandoc.write(pandoc.Pandoc({description}), "latex")
if quarto.doc.is_format("latex") then
local caption = pandoc.write(pandoc.Pandoc({image.caption}), "latex")
local blockStr = "\\begin{figure}\n" ..
"{\\centering \\includegraphics{" .. image.src .. "}}\n" ..
"\\caption{" .. caption .. "}\n\\Description{"
.. description .. "}\n\\end{figure}\n"
return {pandoc.RawInline("latex", blockStr)}
else
image.attr.attributes["alt"] = description
image.attr.attributes["fig-alt"] = nil
return image
end
end
}
}

View File

@ -0,0 +1,5 @@
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$

View File

@ -0,0 +1,52 @@
%%
%% The "author" command and its associated commands are used to define
%% the authors and their affiliations.
%% Of note is the shared affiliation of the first two authors, and the
%% "authornote" and "authornotemark" commands
%% used to denote shared contribution to the research.
$-- TODO:
$-- - generate output from data structure synthesized from Lua filter
$-- - handle equal-contribution
$-- -
$for(by-author)$
\author{$by-author.name.literal$}
$if(by-author.orcid)$\orcid{$by-author.orcid$}$endif$
$if(by-author.affiliations)$
$for(by-author.affiliations)$
\affiliation{%
$if(by-author.affiliations.name)$
\institution{$by-author.affiliations.name$}
$endif$
$if(by-author.affiliations.address)$
\streetaddress{$by-author.affiliations.address$}
$endif$
$if(by-author.affiliations.city)$
\city{$by-author.affiliations.city$}
$endif$
$if(by-author.affiliations.state)$
\state{$by-author.affiliations.state$}
$endif$
$if(by-author.affiliations.country)$
\country{$by-author.affiliations.country$}
$endif$
$if(by-author.affiliations.postal-code)$
\postcode{$by-author.affiliations.postal-code$}
$endif$
}
$endfor$
$endif$
$endfor$
$if(acm-metadata.shortauthors)$
\renewcommand{\shortauthors}{$acm-metadata.shortauthors$}
$endif$
%% By default, the full list of authors will be used in the page
%% headers. Often, this list is too long, and will overlap
%% other information printed in the page headers. This command allows
%% the author to define a more concise list
%% of authors' names for this purpose.
%\renewcommand{\shortauthors}{Trovato et al.}

View File

@ -0,0 +1,47 @@
%% Rights management information. This information is sent to you
%% when you complete the rights form. These commands have SAMPLE
%% values in them; it is your responsibility as an author to replace
%% the commands and values with those provided to you when you
%% complete the rights form.
\setcopyright{$acm-metadata.copyright$}
\copyrightyear{$acm-metadata.copyright-year$}
\acmYear{$acm-metadata.acm-year$}
\acmDOI{$acm-metadata.doi$}
%% These commands are for a PROCEEDINGS abstract or paper.
\acmConference[$acm-metadata.conference-acronym$]{$acm-metadata.conference-name$}{$acm-metadata.conference-date$}{$acm-metadata.conference-location$}
\acmPrice{$acm-metadata.price$}
\acmISBN{$acm-metadata.isbn$}
%% Submission ID.
%% Use this when submitting an article to a sponsored event. You'll
%% receive a unique submission ID from the organizers
%% of the event, and this ID should be used as the parameter to this command.
%%\acmSubmissionID{123-A56-BU3}
%%
%% For managing citations, it is recommended to use bibliography
%% files in BibTeX format.
%%
%% You can then either use BibTeX with the ACM-Reference-Format style,
%% or BibLaTeX with the acmnumeric or acmauthoryear sytles, that include
%% support for advanced citation of software artefact from the
%% biblatex-software package, also separately available on CTAN.
%%
%% Look at the sample-*-biblatex.tex files for templates showcasing
%% the biblatex styles.
%%
%%
%% The majority of ACM publications use numbered citations and
%% references. The command \citestyle{authoryear} switches to the
%% "author year" style.
%%
%% If you are preparing content for an event
%% sponsored by ACM SIGGRAPH, you must use the "author year" style of
%% citations and references.
%% Uncommenting
%% the next command will enable that style.
%%\citestyle{acmauthoryear}

View File

@ -0,0 +1,15 @@
$-- Provides configuration of document metadata for writing the title block.
$-- Note that in addition to these templates and partials, Quarto will also make normalized authors and affiliations data available to the template,
$-- making is easy to write custom title blocks against a standard schema.
$--
$-- %%%% TODO %%%%%
$-- Customize is needed, otherwise remove this partials to use Quarto default one
$-- %%%%%%%%%%%%%%%%
%%
%% The "title" command has an optional parameter,
%% allowing the author to define a "short title" to be used in page headers.
$if(title)$
\title$if(short-title)$[$short-title$]$endif${$title$}
$endif$

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View File

@ -0,0 +1,17 @@
--[[
This file defines the shortcodes that your extension will make available
https://quarto.org/docs/authoring/shortcodes.html#custom-shortcodes
Quarto exports utils function that can be used in all filters. See
https://github.com/quarto-dev/quarto-cli/blob/main/src/resources/pandoc/datadir/init.lua#L1522-L1576
]]--
-- Example shortcode that provides a nicely formatted 'LaTeX' string
function latex()
if quarto.doc.is_format("pdf") then
return pandoc.RawBlock('tex', '{\\LaTeX}')
elseif quarto.doc.is_format("html") then
return pandoc.Math('InlineMath', "\\LaTeX")
else
return pandoc.Span('LaTeX')
end
end

File diff suppressed because it is too large Load Diff

20
_quarto.yml Normal file
View File

@ -0,0 +1,20 @@
project:
type: manuscript
manuscript:
article: index.qmd
format:
html:
comments:
hypothesis: true
#docx: default
#jats: default
# (other formats)
pdf: default
execute:
freeze: true

0
code/__init__.py Normal file
View File

73
code/load_accounts.py Normal file
View File

@ -0,0 +1,73 @@
import polars as pl
import json
def get_fullweek_status_count(x: str):
try:
data = json.loads(x)
return int(data[1]["logins"])
except:
return -1
def read_activity_file(f):
return pl.read_ipc("data/activity.feather").filter(
pl.col("data_string").str.starts_with('[{"week":')
).with_columns(
pl.col("data_string").map_elements(lambda x: get_fullweek_status_count(x)).alias('logins')
).sort("logins")
def read_metadata_file(f):
return pl.read_ipc(f).filter(
pl.col("data_string").str.starts_with('{"uri":')
).with_columns(
# replace all null \0 with nothing
pl.col("data_string").str.replace_all("\0", "").alias("data_string")
).with_columns(
pl.col("data_string").str.json_decode().alias("data")
).with_columns(
pl.col("data").struct.field("uri").alias("uri"),
pl.col("data").struct.field("title").alias("title"),
pl.col("data").struct.field("short_description").alias("short_description"),
pl.col("data").struct.field("description").alias("description"),
pl.col("data").struct.field("email").alias("email"),
pl.col("data").struct.field("version").alias("version"),
pl.col("data").struct.field("stats").struct.field("user_count").alias("user_count"),
)
def read_accounts_file(f):
df = pl.read_ipc(f).with_columns(
pl.col("data_string").str.json_decode().alias("data")
).with_columns(
pl.col("data").struct.field("id"),
pl.col("data").struct.field("username"),
pl.col("data").struct.field("acct"),
pl.col("data").struct.field("display_name"),
pl.col("data").struct.field("locked"),
pl.col("data").struct.field("bot"),
pl.col("data").struct.field("discoverable"),
pl.col("data").struct.field("group"),
pl.col("data").struct.field("created_at").str.to_datetime(),
pl.col("data").struct.field("note"),
pl.col("data").struct.field("url"),
pl.col("data").struct.field("uri"),
pl.col("data").struct.field("avatar"),
pl.col("data").struct.field("avatar_static"),
pl.col("data").struct.field("header"),
pl.col("data").struct.field("header_static"),
pl.col("data").struct.field("followers_count"),
pl.col("data").struct.field("following_count"),
pl.col("data").struct.field("statuses_count"),
pl.col("data").struct.field("last_status_at"),
pl.col("data").struct.field("noindex"),
pl.col("data").struct.field("emojis"),
pl.col("data").struct.field("roles"),
pl.col("data").struct.field("fields"),
pl.col("data").struct.field("suspended"),
).with_columns(
pl.when(
pl.col("last_status_at").str.len_chars() > 10).then(
pl.col("last_status_at").str.strptime(pl.Datetime, format='%Y-%m-%dT%H:%M:%S%.fZ', strict=False).dt.replace_time_zone("UTC")
).otherwise(
pl.col("last_status_at").str.strptime(pl.Datetime, format='%Y-%m-%d', strict=False).dt.replace_time_zone("UTC")
).alias("last_status_at")
)
return df

319
index.qmd Normal file
View File

@ -0,0 +1,319 @@
---
title: Onboarding The Fediverse (working title)
short-title: Onboarding Fediverse
authors:
- name: Carl Colglazier
affiliation:
name: Northwestern University
city: Evanston
state: Illinois
country: United States
#roles: writing
corresponding: true
bibliography: references.bib
acm-metadata:
final: false
copyright-year: 2024
acm-year: 2024
copyright: rightsretained
doi: XXXXXXX.XXXXXXX
conference-acronym: "PACMHCI"
#conference-name: |
# Make sure to enter the correct
# conference title from your rights confirmation email
#conference-date: June 03--05, 2018
#conference-location: Woodstock, NY
#price: "15.00"
#isbn: 978-1-4503-XXXX-X/18/06
format:
acm-pdf:
documentclass: acmart
classoption: [acmsmall,manuscript,screen,authorversion,nonacm,timestamp]
abstract: |
When trying to join the Fediverse, a decentralized collection of interoperable social networking websites, new users face the dillema of choosing a home server. Using trace data from thousands of new Fediverse accounts, we show that this choice matters and significantly effects the probably that the account remains active in the future. We then use these insights from this relationship to build a tool that can help new Fediverse users find a server with a high probability of being a good match based on their interests.
execute:
echo: false
error: false
freeze: auto
---
```{r}
#| label: r-setup
#| output: false
library(reticulate)
library(tidyverse)
library(arrow)
library(statnet)
library(network)
library(survival)
library(ggsurvfit)
library(modelsummary)
options(arrow.skip_nul = TRUE)
```
We first explore the extent to which server choice matters. We find that accounts that join smaller, more interest-based servers are more likely to continue posting six months after their creation.
Using these findings, we then propose a tool that can help users find servers that match their interests.
# Background
## Newcomers in Online Communities
Onboarding newcomers is an important thing for online communities. Any community can expect a certain amount of turnover, and so it is important for the long-term health and longevity of the community to be able to bring in new members.
RQ: What server attributes correspond with better newcomer retention?
## Migrations in Online Communities
All online communities and accounts trend toward death.
+ Fiesler on online fandom communities [@fieslerMovingLandsOnline2020]
+ TeBlunthuis on competition and mutalism [@teblunthuisIdentifyingCompetitionMutualism2022]
+ Work on "alt-tech" communities.
# Empirical Setting
The Fediverse is a set of decentralized online social networks which interoperate using shared protocols like ActivityPub. Mastodon is a software program used by many Fediverse servers and offers a user experience similar to the Tweetdeck client for Twitter.
Discovery has been challenging on Masotodon. The developers and user base tend to be skeptical of algorithmic intrusions, instead opting for timelines which only show posts in reverse chronological order. Search is also difficult. Public hashtags are searchable, but most servers have traditionally not supported searching keywords or simple strings. Accounts can only be searched using their full `username@server` form.
Mastodon features a "home" timeline which shows all public posts from accounts that share the same home server. On larger servers, this timeline can be unwieldy; however, on smaller servers, this presents the opportunity to discover new posts and users of potential interest.
Mastodon offers its users high levels of data portability. Users can move their accounts accross instances while retaining their follows (their post data; however, does not move with the new account). The choice of an initial instance consequentially is not irreversible.
# Data
```{python}
#| label: py-preprocess-data
#| cache: true
#| output: false
from code.load_accounts import *
accounts = read_accounts_file("data/accounts.feather")
# Write a parsed accounts file for R to use
accounts.with_columns(
pl.col("data").struct.field("moved").is_not_null().alias("has_moved")
).drop(
["data", "data_string"]
).write_ipc("data/scratch/accounts.feather")
moved_accounts = accounts.with_columns(
pl.col("data").struct.field("moved")
).drop_nulls("moved").with_columns(
pl.col("moved").struct.field("acct").alias("moved_acct"),
).filter(
pl.col("moved_acct").str.contains('@')
).with_columns(
pl.col("moved_acct").str.split('@').list.get(1).alias("moved_server")
)
number_of_accounts = len(accounts)
popular_servers = accounts.group_by("server").count().sort("count", descending=True)
common_moves = moved_accounts.group_by(
["server", "moved_server"]
).count().sort("count", descending=True)
common_moves.write_ipc("data/scratch/moved_accounts.feather")
common_moves.rename({
"server": "Source",
"moved_server": "Target",
}).write_csv("data/scratch/moved_accounts.csv")
maccounts = moved_accounts.select(["account", "server", "moved_server"])
popular_servers.write_ipc("data/scratch/popular_servers.feather")
jm = pl.read_json("data/joinmastodon.json")
jm.write_ipc("data/scratch/joinmastodon.feather")
read_metadata_file("data/metadata_2023-10-01.feather").drop(
["data", "data_string"]
).write_ipc("data/scratch/metadata.feather")
```
```{r}
#| label: r-load-accounts
#| output: false
accounts <- arrow::read_feather("data/scratch/accounts.feather", col_select=c("server", "username", "created_at", "last_status_at", "statuses_count", "has_moved", "bot")) %>%
filter(!has_moved) %>%
filter(!bot) %>%
# TODO: what's going on here?
filter(!is.na(last_status_at)) %>%
# sanity check
filter(created_at >= "2022-01-01") %>%
filter(created_at < "2023-03-01") %>%
# We don't want accounts that were created and then immediately stopped being active
filter(statuses_count >= 5) %>%
filter(last_status_at >= created_at) %>%
mutate(active = last_status_at >= "2023-09-01") %>%
# set max last_status_at to 2023-06-01
mutate(last_status_at = ifelse(active, lubridate::ymd_hms("2023-09-01 00:00:00", tz = "UTC"), last_status_at)) %>%
mutate(active_time = difftime(last_status_at, created_at, units="secs"))
```
**Mastodon Profiles**: We collected accounts using data previously collected from posts on public Mastodon timelines from October 2020 to February 2023. We then queried for up-to-date infromation on those accounts including their most recent status and if the account had moved. This gave us a total of `r nrow(accounts)` accounts.
```{r}
adv_server_counts <- arrow::read_feather("data/scratch/accounts.feather", col_select=c("server", "username", "created_at", "bot")) %>%
filter(!bot) %>%
filter(created_at > "2017-01-01") %>%
filter(created_at <= "2023-01-01") %>%
group_by(server) %>%
arrange(created_at) %>%
mutate(r = row_number()) %>%
arrange(desc(r)) %>%
distinct(server, created_at, .keep_all=TRUE) %>%
select(server, created_at, r) %>%
ungroup() %>%
mutate(server_date = as.Date(created_at))
```
```{r}
adv_server_counts %>% filter(server == "mastodon.social") %>%
ggplot(aes(x=server_date, y=r)) +
geom_line() + theme_minimal()
```
```{r}
#| label: fig-account-activity-prop
#| fig-cap: "Account Activity Over Time"
#| fig-height: 4
server_counts <- arrow::read_feather("data/scratch/accounts.feather", col_select=c("server", "username", "created_at", "bot")) %>%
filter(created_at <= "2023-01-01") %>%
group_by(server) %>%
summarize(server_count = n()) %>%
arrange(desc(server_count)) %>%
mutate(server_count_bin = floor(log10(server_count)))
metadata <- arrow::read_feather("data/scratch/metadata.feather", col_select=c("server", "user_count")) %>%
arrange(desc(user_count)) %>%
mutate(server_count = user_count) %>%
mutate(server_count_bin = floor(log10(server_count)))
jm <- arrow::read_feather("data/scratch/joinmastodon.feather")
a <- accounts %>%
inner_join(metadata, by="server") %>%
mutate(metadata = server_count > 500) %>%
mutate(active_time = as.integer(active_time)) %>%
mutate(active_time_weeks = active_time / 60 / 60 / 24 / 7) %>%
mutate(status = ifelse(active, 0, 1)) %>% mutate(jm = server %in% jm$domain)# %>% filter(jm)
survfit2(Surv(active_time_weeks, status) ~ server_count_bin, data = a) %>%
ggsurvfit() +
add_confidence_interval() +
scale_y_continuous(limits = c(0, 1)) +
labs(
y = "Overall survival probability",
x = "Time (weeks)",
colour = "Server Size (log10)",
fill = "Server Size (log10)",
) +
add_risktable() +
scale_x_continuous(
breaks = seq(0, max(a$active_time_weeks, na.rm = TRUE), by = 52),
labels = seq(0, max(a$active_time_weeks, na.rm = TRUE), by = 52)
) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
```
To determine the relationship between server size and user retention, we...
## Moved Accounts
```{r}
#| label: fig-moved-accounts
#| fig-height: 4
moved_accounts <- arrow::read_feather("data/scratch/moved_accounts.feather")
popular_servers <- arrow::read_feather("data/scratch/popular_servers.feather")
server_movement_data <- left_join(
(moved_accounts %>% group_by(server) %>% summarize(out_count = sum(count)) %>% select(server, out_count)),
(moved_accounts %>% group_by(moved_server) %>% summarize(in_count = sum(count)) %>% select(moved_server, in_count) %>% rename(server=moved_server)),
by="server"
) %>% replace_na(list(out_count = 0, in_count = 0)) %>%
mutate(diff = in_count - out_count) %>%
arrange(diff) %>%
left_join(., popular_servers, by="server") %>%
rename(user_count = count) %>% arrange(desc(user_count))
server_movement_data %>%
ggplot(aes(x=user_count, y=diff)) +
geom_point() + scale_x_log10() + theme_minimal()
```
If there was no relationship, we would expect these jumps to be random with respect to server size.
```{r}
popular_servers <- arrow::read_feather("data/scratch/popular_servers.feather")
moved_accounts <- arrow::read_feather("data/scratch/moved_accounts.feather")
activity <- arrow::read_feather("data/scratch/activity.feather", col_select=c("server", "logins")) %>% arrange(desc(logins))
popular_and_large_servers <- popular_servers %>% filter(count >= 1) %>%
mutate(count = log10(count))
jm <- arrow::read_feather("data/scratch/joinmastodon.feather")
ma <- moved_accounts %>% filter(server %in% popular_and_large_servers$server) %>% filter(moved_server %in% popular_and_large_servers$server)
edgeNet<-network(ma,matrix.type="edgelist")
edgeNet%v%"user_count" <- left_join((as_tibble(edgeNet%v%'vertex.names') %>% rename(server=value)), popular_and_large_servers, by="server") %>% select(count) %>% unlist()
edgeNet%v%"in_jm" <- as_tibble(edgeNet%v%'vertex.names') %>% mutate(in_jm = value %in% jm$domain) %>% select(in_jm) %>% unlist()
```
```{r}
#| label: ergm-model
#| cache: true
m1 <- ergm(edgeNet ~ sum + diff("user_count", pow=1, form="sum") + nodecov("user_count", form="sum") + nodematch("in_jm", diff=TRUE, form="sum"), response="count", reference=~Binomial(3))
save(m1, file="data/scratch/ergm-model.rda")
```
```{r}
#| label: tag-ergm-result
#| output: asis
ergm_model <- load("data/scratch/ergm-model.rda")
modelsummary(
m1,
coef_rename = c(
"sum" = "Intercept",
"diff.sum.t-h.user_count " = "User Count Difference",
"nodecov.sum.user_count " = "User Count (Node Covariate)",
"nodematch.sum.in_jm.TRUE" = "In JoinMastodon (Both True)",
"nodematch.sum.in_jm.FALSE" = "In JoinMastodon (Both False)"
),
)
```
```{python}
#| eval: false
#| include: false
import random
def simulate_account_moves(origin: str, servers: dict, n: int):
server_list = list(set(servers.keys()) - {origin})
weights = [servers[x] for x in server_list]
return pl.DataFrame({
"simulation": list(range(n)),
"server": [origin] * n,
"moved_server": random.choices(server_list, weights=weights, k=n)
})
simulations = pl.concat([simulate_account_moves(row["server"], {x["server"]: x["count"] for x in popular_servers.iter_rows(named=True)}, 1000) for row in maccounts.iter_rows(named=True)])
m_counts = maccounts.join(popular_servers, how="inner", on="server").rename({"count": "origin_count"}).join(popular_servers.rename({"server": "moved_server"}), how="inner", on="moved_server").rename({"count": "target_count"})
sim_counts = simulations.join(popular_servers, how="inner", on="server").rename({"count": "origin_count"}).join(popular_servers.rename({"server": "moved_server"}), how="inner", on="moved_server").rename({"count": "target_count"})
```
## Tag Clusters
We found _number_ posts which contained between two and five tags.

29
references.bib Normal file
View File

@ -0,0 +1,29 @@
@article{fieslerMovingLandsOnline2020,
title = {Moving across Lands: Online Platform Migration in Fandom Communities},
shorttitle = {Moving across Lands},
author = {Fiesler, Casey and Dym, Brianna},
year = {2020},
month = may,
journal = {Proc. ACM Hum.-Comput. Interact},
volume = {4},
number = {CSCW1},
pages = {042:1--042:25},
doi = {10.1145/3392847},
urldate = {2020-06-27},
abstract = {When online platforms rise and fall, sometimes communities fade away, and sometimes they pack their bags and relocate to a new home. To explore the causes and effects of online community migration, we examine transformative fandom, a longstanding, technology-agnostic community surrounding the creation, sharing, and discussion of creative works based on existing media. For over three decades, community members have left and joined many different online spaces, from Usenet to Tumblr to platforms of their own design. Through analysis of 28 in-depth interviews and 1,886 survey responses from fandom participants, we traced these migrations, the reasons behind them, and their impact on the community. Our findings highlight catalysts for migration that provide insights into factors that contribute to success and failure of platforms, including issues surrounding policy, design, and community. Further insights into the disruptive consequences of migrations (such as social fragmentation and lost content) suggest ways that platforms might both support commitment and better support migration when it occurs.}
}
@inproceedings{teblunthuisIdentifyingCompetitionMutualism2022,
title = {Identifying Competition and Mutualism between Online Groups},
booktitle = {International {{AAAI Conference}} on {{Web}} and {{Social Media}} ({{ICWSM}} 2022)},
author = {TeBlunthuis, Nathan and Hill, Benjamin Mako},
year = {2022},
month = jun,
volume = {16},
pages = {993--1004},
publisher = {{AAAI}},
address = {{Atlanta, Georgia, USA}},
urldate = {2021-07-16},
abstract = {Platforms often host multiple online groups with highly overlapping topics and members. How can researchers and designers understand how interactions between related groups affect measures of group health? Inspired by population ecology, prior social computing research has studied competition and mutualism among related groups by correlating group size with degrees of overlap in content and membership. The resulting body of evidence is puzzling as overlaps seem sometimes to help and other times to hurt. We suggest that this confusion results from aggregating inter-group relationships into an overall environmental effect instead of focusing on networks of competition and mutualism among groups. We propose a theoretical framework based on community ecology and a method for inferring competitive and mutualistic interactions from time series participation data. We compare population and community ecology analyses of online community growth by analyzing clusters of subreddits with high user overlap but varying degrees of competition and mutualism.},
keywords = {Computer Science - Human-Computer Interaction,Computer Science - Social and Information Networks}
}

28
renv.lock Normal file
View File

@ -0,0 +1,28 @@
{
"R": {
"Version": "4.3.2",
"Repositories": [
{
"Name": "CRAN",
"URL": "https://cran.case.edu"
}
]
},
"Python": {
"Version": "3.12.1",
"Type": "virtualenv",
"Name": "./renv/python/virtualenvs/renv-python-3.12"
},
"Packages": {
"renv": {
"Package": "renv",
"Version": "1.0.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"utils"
],
"Hash": "41b847654f567341725473431dd0d5ab"
}
}
}

7
renv/.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
library/
local/
cellar/
lock/
python/
sandbox/
staging/

1180
renv/activate.R Normal file

File diff suppressed because it is too large Load Diff

19
renv/settings.json Normal file
View File

@ -0,0 +1,19 @@
{
"bioconductor.version": null,
"external.libraries": [],
"ignored.packages": [],
"package.dependency.fields": [
"Imports",
"Depends",
"LinkingTo"
],
"ppm.enabled": null,
"ppm.ignored.urls": [],
"r.version": null,
"snapshot.type": "implicit",
"use.cache": true,
"vcs.ignore.cellar": true,
"vcs.ignore.library": true,
"vcs.ignore.local": true,
"vcs.manage.ignores": true
}