]> code.communitydata.science - cdsc_tex.git/blob - paper_template/text.Rnw
faf5f9c80567f8f1d805e591bafc7def448a0e69
[cdsc_tex.git] / paper_template / text.Rnw
1 \documentclass[12pt]{memoir}
2
3 \usepackage{cdsc-memoir}
4 % there are two chapter styles: cdsc-article and cdsc-memo
5 % memo assumes that you remove the "\\" and the email address from the
6 % \author field below as well as that you will comment out the
7 % \published tag
8 \chapterstyle{cdsc-article}
9
10 \usepackage[utf8]{inputenc}
11 \usepackage{wrapfig}
12
13 <<init, echo=FALSE>>=
14 knit_hooks$set(document = function(x) {
15   sub('\\usepackage[]{color}',
16 '\\usepackage[usenames,dvipsnames]{color}', x, fixed = TRUE)
17 })
18 opts_chunk$set(fig.path="figures/knitr-")
19
20 source("resources/preamble.R")
21 @
22
23 \usepackage[T1]{fontenc}
24 \usepackage{textcomp}
25 \usepackage[garamond]{mathdesign}
26
27 \usepackage[letterpaper,left=1.65in,right=1.65in,top=1.3in,bottom=1.2in]{geometry}
28
29 % packages i use in essentially every document
30 \usepackage{graphicx}
31 \usepackage{enumerate}
32
33 % packages i use in many documents but leave off by default
34 % \usepackage{amsmath, amsthm, amssymb}
35 % \usepackage{dcolumn}
36 % \usepackage{endfloat}
37
38 % import and customize urls
39 \usepackage[breaklinks]{hyperref}
40 \hypersetup{colorlinks=true, linkcolor=Black, citecolor=Black, filecolor=Blue,
41     urlcolor=Blue, unicode=true}
42
43 % list of footnote symbols for \thanks{}
44 \makeatletter
45 \renewcommand*{\@fnsymbol}[1]{\ensuremath{\ifcase#1\or *\or \dagger\or \ddagger\or
46  \mathsection\or \mathparagraph\or \|\or **\or \dagger\dagger
47   \or \ddagger\ddagger \else\@ctrerr\fi}}
48 \makeatother
49 \newcommand*\samethanks[1][\value{footnote}]{\footnotemark[#1]}
50
51 % add bibliographic stuff 
52 \usepackage[american]{babel}
53 \usepackage{csquotes}
54 \usepackage[natbib=true, style=apa, backend=biber]{biblatex}
55 \addbibresource{refs.bib}
56 \DeclareLanguageMapping{american}{american-apa}
57
58 \defbibheading{secbib}[\bibname]{%
59   \section*{#1}%
60   \markboth{#1}{#1}%
61   \baselineskip 14.2pt%
62   \prebibhook}
63
64 \def\citepos#1{\citeauthor{#1}'s (\citeyear{#1})}
65 \def\citespos#1{\citeauthor{#1}' (\citeyear{#1})}
66
67 % memoir function to take out of the space out of the whitespace lists
68 \firmlists
69
70 % LATEX NOTE: these lines will import vc stuff after running `make vc` which
71 % will add version control information to the bottom of each page. This can be
72 % useful for keeping track of which version of a document somebody has:
73 % \input{vc}
74 % \pagestyle{cdsc-page-git}
75
76 % LATEX NOTE: this alternative line will just input a timestamp at the
77 % build process, useful for sharelatex
78 % \pagestyle{cdsc-page-sharelatex}
79
80 \begin{document}
81
82 \setlength{\parskip}{4.5pt}
83 % LATEX NOTE: Ideal linespacing is usually said to be between 120-140% the
84 % typeface size. So, for 12pt (default in this document, we're looking for
85 % somewhere between a 14.4-17.4pt \baselineskip.  Single; 1.5 lines; and Double
86 % in MSWord are equivalent to ~117%, 175%, and 233%.
87
88 \baselineskip 16pt
89
90 \title{Title}
91 \author{Your Name\\
92         \href{mailto:youremail@uw.edu}{youremail@uw.edu}}
93 \date{}
94
95 \published{\textsc{\textcolor{BrickRed}{This document is an
96   unpublished draft.\\ Please do not distribute or cite without
97   permission.}}}
98
99 \maketitle
100
101 \begin{abstract}
102 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
103 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
104 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
105 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
106 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
107 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
108 fox jumps over the lazy dog.
109 \end{abstract}
110
111 \section{Section}
112
113 % LATEX NOTE: This alphabet below is here so we can measure the line-length of
114 % different layouts.  Typesetters suggest that an average line-length of
115 % between 45-90 characters and a rule of thumb for typesetting is that you
116 % should be able to fit between 2-3 alphabets on one line.  Generally speaking,
117 % the shorter the line length, the better -- and the smaller the linespacing
118 % can become.  The following line is 3 alphabets (73 characters). 
119
120 abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
121
122 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
123 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
124 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
125 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
126 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
127 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
128 fox jumps over the lazy dog \citep{989866}.
129
130 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
131 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
132 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
133 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
134 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
135 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
136 fox jumps over the lazy dog \citep{989866}.
137
138 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
139 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
140 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
141 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
142 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
143 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
144 fox jumps over the lazy dog \citep{989866}.
145
146 \begin{table}
147   \centering
148 <<test_table, echo=FALSE>>=
149 kable(form.copy, format="latex")
150 @
151 \caption{This is a test table. There are \Sexpr{f(nrow(form.copy))} rows in the table.}
152 \label{tab:test}
153 \end{table}
154
155 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
156 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
157 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
158 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
159 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
160 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
161 fox jumps over the lazy dog \citep{989866}.
162
163 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
164 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
165 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
166 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
167 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
168 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
169 fox jumps over the lazy dog \citep{989866}.
170
171 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
172 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
173 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
174 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
175 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
176 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
177 fox jumps over the lazy dog \citep{989866}.
178
179 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
180 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
181 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
182 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
183 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
184 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
185 fox jumps over the lazy dog \citep{989866}.
186
187 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
188 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
189 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
190 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
191 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
192 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
193 fox jumps over the lazy dog \citep{989866}.
194
195 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
196 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
197 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over
198 the lazy dog.  The quick brown fox jumps over the lazy dog.  The quick
199 brown fox jumps over the lazy dog.  The quick brown fox jumps over the
200 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
201 fox jumps over the lazy dog \citep{989866}.
202
203 % bibliography here
204 \setcounter{biburlnumpenalty}{9001}
205 \printbibliography[title = {References}, heading=secbib]
206
207
208 \end{document}
209
210 %  LocalWords:  

Community Data Science Collective || Want to submit a patch?