]> code.communitydata.science - cdsc_tex.git/blobdiff - paper_template/text.Rnw
Merge branch 'master' into knitr
[cdsc_tex.git] / paper_template / text.Rnw
similarity index 94%
rename from paper_template/text.tex
rename to paper_template/text.Rnw
index 1a316cdca414f14f76caf424394da9b0c46f02c8..faf5f9c80567f8f1d805e591bafc7def448a0e69 100644 (file)
@@ -9,6 +9,17 @@
 
 \usepackage[utf8]{inputenc}
 \usepackage{wrapfig}
+
+<<init, echo=FALSE>>=
+knit_hooks$set(document = function(x) {
+  sub('\\usepackage[]{color}',
+'\\usepackage[usenames,dvipsnames]{color}', x, fixed = TRUE)
+})
+opts_chunk$set(fig.path="figures/knitr-")
+
+source("resources/preamble.R")
+@
+
 \usepackage[T1]{fontenc}
 \usepackage{textcomp}
 \usepackage[garamond]{mathdesign}
@@ -25,9 +36,7 @@
 % \usepackage{endfloat}
 
 % import and customize urls
-\usepackage[usenames,dvipsnames]{color}
 \usepackage[breaklinks]{hyperref}
-
 \hypersetup{colorlinks=true, linkcolor=Black, citecolor=Black, filecolor=Blue,
     urlcolor=Blue, unicode=true}
 
@@ -134,6 +143,15 @@ brown fox jumps over the lazy dog.  The quick brown fox jumps over the
 lazy dog.  The quick brown fox jumps over the lazy dog.  The quick brown
 fox jumps over the lazy dog \citep{989866}.
 
+\begin{table}
+  \centering
+<<test_table, echo=FALSE>>=
+kable(form.copy, format="latex")
+@
+\caption{This is a test table. There are \Sexpr{f(nrow(form.copy))} rows in the table.}
+\label{tab:test}
+\end{table}
+
 The quick brown fox jumps over the lazy dog.  The quick brown fox jumps
 over the lazy dog.  The quick brown fox jumps over the lazy dog.  The
 quick brown fox jumps over the lazy dog.  The quick brown fox jumps over

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