Skip to content

Add ACM Proceedings Template #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Generated by roxygen2 (4.0.1): do not edit by hand

export(acm)
export(jss_article)
export(rjournal_article)
export(use_r_abstract)
10 changes: 10 additions & 0 deletions R/acm_article.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#' @export
acm <- function() {
template <- find_resource("acm", "template.tex")
csl <- find_resource("acm" ,"acm-sig-proceedings.csl")

rmarkdown::pdf_document(
template = template,
pandoc_args = c("--csl", rmarkdown::pandoc_path_arg(csl)))
}

1 change: 1 addition & 0 deletions inst/rmarkdown/templates/acm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pdf
161 changes: 161 additions & 0 deletions inst/rmarkdown/templates/acm/resources/acm-sig-proceedings.csl
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<?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 SIG Proceedings ("et al." for 3+ authors)</title>
<id>http://www.zotero.org/styles/acm-sig-proceedings</id>
<link href="http://www.zotero.org/styles/acm-sig-proceedings" rel="self"/>
<link href="http://www.acm.org/sigs/publications/proceedings-templates" rel="documentation"/>
<author>
<name>Naeem Esfahani</name>
<email>[email protected]</email>
<uri>http://mason.gmu.edu/~nesfaha2/</uri>
</author>
<contributor>
<name>Chris Horn</name>
<email>[email protected]</email>
</contributor>
<category citation-format="numeric"/>
<category field="science"/>
<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">
<choose>
<if type="webpage">
<text variable="title" suffix=":"/>
</if>
<else>
<names variable="author">
<name name-as-sort-order="all" and="text" sort-separator=", " initialize-with="." delimiter-precedes-last="never" delimiter=", "/>
<label form="short" prefix=" " suffix="." strip-periods="true"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</else>
</choose>
</macro>
<macro name="editor">
<names variable="editor">
<name initialize-with="." delimiter=", " and="text"/>
<label form="short" prefix=", "/>
</names>
</macro>
<citation collapse="citation-number">
<sort>
<key variable="citation-number"/>
</sort>
<layout prefix="[" suffix="]" delimiter=", ">
<text variable="citation-number"/>
</layout>
</citation>
<bibliography entry-spacing="0" second-field-align="flush" et-al-min="3" et-al-use-first="1">
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout suffix=".">
<text variable="citation-number" prefix="[" suffix="]"/>
<text macro="author" suffix=" "/>
<date variable="issued" suffix=". ">
<date-part name="year"/>
</date>
<choose>
<if type="paper-conference">
<group delimiter=". ">
<text variable="title"/>
<group delimiter=" ">
<text variable="container-title" font-style="italic"/>
<group delimiter=", ">
<group delimiter=", " prefix="(" suffix=")">
<text variable="publisher-place"/>
<date variable="issued">
<date-part name="month" form="short" suffix=" "/>
<date-part name="year"/>
</date>
</group>
<text variable="page"/>
</group>
</group>
</group>
</if>
<else-if type="article-journal">
<group delimiter=". ">
<text variable="title"/>
<text variable="container-title" font-style="italic"/>
<group delimiter=", ">
<text variable="volume"/>
<group delimiter=" ">
<text variable="issue"/>
<date variable="issued" prefix="(" suffix=")">
<date-part name="month" form="short" suffix=" "/>
<date-part name="year"/>
</date>
</group>
<text variable="page"/>
</group>
</group>
</else-if>
<else-if type="patent">
<group delimiter=". ">
<text variable="title"/>
<text variable="number"/>
<date variable="issued">
<date-part name="month" form="short" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date>
</group>
</else-if>
<else-if type="thesis">
<group delimiter=". ">
<text variable="title" font-style="italic"/>
<text variable="archive_location" prefix="Doctoral Thesis #"/>
<text variable="publisher"/>
</group>
</else-if>
<else-if type="report">
<group delimiter=". ">
<text variable="title" font-style="italic"/>
<text variable="number" prefix="Technical Report #"/>
<text variable="publisher"/>
</group>
</else-if>
<else-if type="webpage">
<group delimiter=". ">
<text variable="URL" font-style="italic"/>
<date variable="accessed" prefix="Accessed: ">
<date-part name="year" suffix="-"/>
<date-part name="month" form="numeric-leading-zeros" suffix="-"/>
<date-part name="day" form="numeric-leading-zeros"/>
</date>
</group>
</else-if>
<else-if type="chapter paper-conference" match="any">
<group delimiter=". ">
<text variable="title"/>
<text variable="container-title" font-style="italic"/>
<text macro="editor"/>
<text variable="publisher"/>
<text variable="page"/>
</group>
</else-if>
<else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<group delimiter=". ">
<text variable="title" font-style="italic"/>
<text variable="publisher"/>
</group>
</else-if>
<else>
<group delimiter=". ">
<text variable="title"/>
<text variable="container-title" font-style="italic"/>
<text variable="publisher"/>
</group>
</else>
</choose>
</layout>
</bibliography>
</style>
70 changes: 70 additions & 0 deletions inst/rmarkdown/templates/acm/resources/template.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
\documentclass{acm_proc_article-sp}

\renewcommand{\paragraph}[1]{\vskip 6pt\noindent\textbf{#1 }}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{url}

$if(title)$
\title{$title$}
$endif$
$if(subtitle)$
\subtitle{$subtitle$}
$endif$


% Add imagehandling
$if(graphics)$
\usepackage{graphicx}
% Redefine \includegraphics so that, unless explicit options are
% given, the image width will not exceed the width of the page.
% Images get their normal width if they fit onto the page, but
% are scaled down if they would overflow the margins.
\makeatletter
\def\ScaleIfNeeded{%
\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi
}
\makeatother
\let\Oldincludegraphics\includegraphics
{%
\catcode`\@=11\relax%
\gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\ScaleIfNeeded]}}%
}%
$endif$

\numberofauthors{2}
\author{
$for(author)$
\alignauthor $author.name$ \\
\affaddr{$author.affiliation$}\\
\email{$author.email$}
\and $endfor$
}

\date{$date$}

%Remove copyright shit
\permission{}
\conferenceinfo{} {}
\CopyrightYear{}
\crdata{}

\begin{document}
$if(title)$
\maketitle
$endif$

$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$

$body$
\setlength{\parindent}{0in}

\end{document}
16 changes: 16 additions & 0 deletions inst/rmarkdown/templates/acm/skeleton/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Produce sensys-abstract compliant PDFs from all Markdown files in a directory
# Manuel Moraga | [email protected]

# List files to be made
PDFS := $(patsubst %.md,%.pdf,$(wildcard *.md))

all : $(PDFS)

# Accepts PDF target with markdown syntax, makes them using pandoc
%.pdf : %.md
pandoc $< -o $@ --template=shortpaper.latex --filter pandoc-citeproc --csl=acm-sig-proceedings.csl

clean :
rm $(PDFS)

rebuild: clean all
23 changes: 23 additions & 0 deletions inst/rmarkdown/templates/acm/skeleton/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# pandoc-shortpaper

A template for building shortpapers in pandoc using the sensys-abstract.csl latex documentclass

## Usage

To compile all markdown files to pdf

make

## Example

[View example PDF](http://spanners.github.io/pandoc-shortpaper/example.pdf)

## Sources

* `acm-sig-proceedings.csl`: ACM SIG Proceedings Template.
CC-SA Naeem Esfahani and Chris Horn.
<https://github.com/citation-style-language/styles>
* `shortpaper.latex`: ...
* `sensys-abstract.cls`: ...
* ...

Loading