Merge pull request #47 from brentthorne/PR-devs

Pr devs
diff --git a/DESCRIPTION b/DESCRIPTION
index 5bf0181..d391b08 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -17,6 +17,6 @@
 LazyData: true
 URL: https://github.com/brentthorne/posterdown
 BugReports: https://github.com/brentthorne/posterdown/issues
-Imports: rmarkdown, knitr, yaml, tinytex, ggplot2, rticles, kableExtra, Cairo
+Imports: rmarkdown, bookdown, knitr, yaml, tinytex, ggplot2, rticles, kableExtra, Cairo
 SystemRequirements: GNU make
 RoxygenNote: 6.1.1
diff --git a/Images/example_poster1.png b/Images/example_poster1.png
index cdc656f..a3c487a 100644
--- a/Images/example_poster1.png
+++ b/Images/example_poster1.png
Binary files differ
diff --git a/NAMESPACE b/NAMESPACE
index aa88438..de5bf6c 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,6 +1,7 @@
 # Generated by roxygen2: do not edit by hand
 
 export(posterdown_pdf)
+import(bookdown)
 import(ggplot2)
 import(knitr)
 import(rmarkdown)
diff --git a/R/posterdown.R b/R/posterdown.R
index fd1e995..ea111c6 100644
--- a/R/posterdown.R
+++ b/R/posterdown.R
@@ -9,6 +9,7 @@
 #' @docType package
 #' @name posterdown
 #' @import rmarkdown
+#' @import bookdown
 #' @import ggplot2
 #' @import knitr
 NULL
diff --git a/R/posterdown_pdf.R b/R/posterdown_pdf.R
index 06f5bd7..7890f49 100644
--- a/R/posterdown_pdf.R
+++ b/R/posterdown_pdf.R
@@ -1,4 +1,4 @@
-#' Posterdown PDF format (using 'memoir' document class)
+#' Posterdown PDF format (using Memoir LaTeX document class)
 #'
 #' @inheritParams rmarkdown::pdf_document
 #' @param ... Additional arguments to \code{rmarkdown::pdf_document}
@@ -10,9 +10,9 @@
 #'
 #' \dontrun{
 #' library(rmarkdown)
-#' draft("MyArticle.Rmd", template = "posterdown_generic", package = "posterdown")
+#' draft("MyArticle.Rmd", template = "posterdown_pdf", package = "posterdown")
 #' }
-#'
+#' @return
 #' @export
 posterdown_pdf <- function(..., keep_tex = TRUE) {
   inherit_pdf_document(...,
diff --git a/R/utils.R b/R/utils.R
index 2aa1fa3..fdf4d97 100644
--- a/R/utils.R
+++ b/R/utils.R
@@ -76,7 +76,3 @@
   # return format
   fmt
 }
-
-
-
-
diff --git a/README.md b/README.md
index df157b2..f3ff257 100644
--- a/README.md
+++ b/README.md
@@ -136,6 +136,7 @@
 | `column_numbers` | Number of columns you wish for the poster to have in the main section of the poster. |
 | `column_margins` | Spcaing between each column as well as the edge of the poster.|
 | `columnline_col` | Colour of the line which divides each column in the poster. |
+| `columnline_width` | Width of line between each column. |
 
 #### Section Title Styling
 
diff --git a/inst/rmarkdown/templates/posterdown_pdf/resources/template.tex b/inst/rmarkdown/templates/posterdown_pdf/resources/template.tex
index e3465f1..be5ec1f 100644
--- a/inst/rmarkdown/templates/posterdown_pdf/resources/template.tex
+++ b/inst/rmarkdown/templates/posterdown_pdf/resources/template.tex
@@ -85,7 +85,7 @@
 \captiontitlefont{\footnotesize\sffamily}
 
 %define column options
-\setlength{\columnseprule}{1pt}
+\setlength{\columnseprule}{$columnline_width$}
 \def\columnseprulecolor{\color{columnlinecol}}
 
 %define section title features
diff --git a/inst/rmarkdown/templates/posterdown_pdf/skeleton/Figures/figure1_map.pdf b/inst/rmarkdown/templates/posterdown_pdf/skeleton/Figures/figure1_map.pdf
deleted file mode 100644
index f282986..0000000
--- a/inst/rmarkdown/templates/posterdown_pdf/skeleton/Figures/figure1_map.pdf
+++ /dev/null
Binary files differ
diff --git a/inst/rmarkdown/templates/posterdown_pdf/skeleton/Figures/figure2.pdf b/inst/rmarkdown/templates/posterdown_pdf/skeleton/Figures/figure2.pdf
deleted file mode 100644
index b58a47e..0000000
--- a/inst/rmarkdown/templates/posterdown_pdf/skeleton/Figures/figure2.pdf
+++ /dev/null
Binary files differ
diff --git a/inst/rmarkdown/templates/posterdown_pdf/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/posterdown_pdf/skeleton/skeleton.Rmd
index 87f0a55..6e6dc6a 100644
--- a/inst/rmarkdown/templates/posterdown_pdf/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/posterdown_pdf/skeleton/skeleton.Rmd
@@ -1,4 +1,6 @@
 ---
+# PLEASE SEE THE README for in depth description github.com/brentthorne/posterdown
+#
 #---POSTER SIZE & DEFAULT FONT---#
 poster_height: "38in" # height in inches of poster
 poster_width: "45in" # width in inches of poster
@@ -38,6 +40,7 @@
 column_numbers: 4 # Number of columns that the poster has
 column_margins: "0.5in" # Margin spacing for columns
 columnline_col: "008080" #colour 
+columnline_width: "0pt" #width of line between each column
 #SECTION TITLE STYLING
 sectitle_textcol: "ffffff" # Colour of the poster section titles
 sectitle_bgcol: "0b4545" # Colour of the section title box
@@ -73,21 +76,29 @@
 
 # Study Site
 
-Here is a map made to show the study site using `ggplot2`, `ggspatial`, and `sf`. Lorem ipsum dolor sit amet, [@middleton_geological_nodate] consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Phasellus vestibulum lorem sed risus ultricies tristique nulla. Mauris vitae ultricies leo integer malesuada nunc vel risus commodo. Suspendisse potenti nullam ac tortor vitae. Enim nunc faucibus a pellentesque sit amet porttitor eget.
+Here is a map made to show the study site using `ggplot2`, `ggspatial`, and `sf` and you can even reference this with a hyperlink, this will take you to **Figure \ref{mymapfig}**. Lorem ipsum dolor sit amet, [@middleton_geological_nodate] consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
+\vspace{1cm}
 
-```{r, fig.width=4.5, out.width="80%", fig.cap='This is a map of Canada, the ggspatial package is great for GIS folks in R!', cache=TRUE}
+```{r, out.width="80%", fig.cap='This is a map of Canada, the ggspatial package is great for GIS folks in R! \\label{mymapfig}', cache=TRUE}
 library(ggplot2)
 library(ggspatial)
+library(tidyverse)
 library(ggthemes)
 library(sf)
 
 canada <- read_sf("data/Canada.geojson")
 
+yukon <- canada %>% 
+  filter(PROV == "YT")
+
 ggplot() +
-  ggspatial::layer_spatial(canada, fill = "grey") +
-  ggspatial::annotation_north_arrow(location = "br", which_north = "true", style = north_arrow_nautical()) +
+  ggspatial::layer_spatial(canada,fill = "grey80", colour = "grey60") +
+  ggspatial::layer_spatial(yukon,fill = "yellow", colour = "black") +
+  ggspatial::annotation_north_arrow(location = "br",pad_y = unit(1,"cm"),pad_x = unit(0.7,"cm"), which_north = "true", style = north_arrow_orienteering()) +
+  ggspatial::annotation_scale(location = "br",style = "ticks") +
   coord_sf() +
-  theme_solarized() +
+  theme_pander() +
+  theme(legend.position = "none") +
   NULL
 ```
 
@@ -98,7 +109,7 @@
 3. Easy transition from `posterdown` to `thesisdown` or `rticles`
 
 \lipsum[2]
-\lipsum[2]
+\lipsum[4]
 
 # Methods
 
@@ -108,6 +119,7 @@
 
 Usually you want to have a nice table displaying some important results that you have calcualated. In posterdown this is as easy as using the `kable` table formatting you are probably use to as per typical `RMarkdown` formatting. I suggesting checking out the `kableExtra` package and its in depth documentation on customizing these tables found [here](https://haozhu233.github.io/kableExtra/awesome_table_in_pdf.pdf).
 
+\vspace{1cm}
 
 ```{r}
 library(kableExtra)
@@ -120,18 +132,27 @@
 
 ```
 
-\vspace{0.5in}
+\vspace{2cm}
 
-```{r, out.width='80%', fig.width=4, fig.height=5, fig.cap='A typical plot using ggplot using the classic iris dataset.'}
+```{r, out.width='100%', fig.height=4.5, fig.cap='Using ggplot and patchwork to generate a layout of multiple plots in one figure. The iris dataset was used to generate (a) a line graph, (b) a scatterplot, and (c) a boxplot all together!'}
 
-library(ggplot2)
+library(tidyverse)
+library(patchwork)
 library(ggthemes)
 
-ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) +
-  geom_point() +
-  theme_fivethirtyeight() +
-  labs(x = "Sepal Length", y = "Sepeal Width") +
-  NULL
+theme_set(theme_gray() + theme_tufte() + theme(legend.position = "none"))
+
+base <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species))
+  
+p_point <- base + geom_point()
+p_line  <- base + geom_line() 
+p_area  <- base + geom_area()
+p_box1  <- ggplot(iris) + geom_boxplot(aes(x = Species, y = Sepal.Length, fill = Species))
+p_box2  <- ggplot(iris) + geom_boxplot(aes(x = Species, y = Sepal.Width, fill = Species))
+
+p_line + 
+  {p_point + p_box1} +
+  plot_layout(ncol = 1) + plot_annotation(tag_levels = "a", tag_prefix = "(",tag_suffix = ")")
 
 ```
 
@@ -143,7 +164,7 @@
 
 ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width, colour = Species)) +
   geom_point() +
-  theme_hc() +
+  theme_tufte() +
   labs(x = "Sepal Length", y = "Sepeal Width") +
   NULL
 
@@ -162,7 +183,7 @@
            y = Sepal.Length,
            colour = Species)) +
   geom_point() +
-  theme_stata() +
+  theme_tufte() +
   NULL
 
 ```
diff --git a/man/posterdown_pdf.Rd b/man/posterdown_pdf.Rd
index add1004..a0e5906 100644
--- a/man/posterdown_pdf.Rd
+++ b/man/posterdown_pdf.Rd
@@ -2,7 +2,7 @@
 % Please edit documentation in R/posterdown_pdf.R
 \name{posterdown_pdf}
 \alias{posterdown_pdf}
-\title{Posterdown PDF format (using 'memoir' document class)}
+\title{Posterdown PDF format (using Memoir LaTeX document class)}
 \usage{
 posterdown_pdf(..., keep_tex = TRUE)
 }
@@ -16,13 +16,12 @@
   \code{\link[rmarkdown:render]{render}}
 }
 \description{
-Posterdown PDF format (using 'memoir' document class)
+Posterdown PDF format (using Memoir LaTeX document class)
 }
 \examples{
 
 \dontrun{
 library(rmarkdown)
-draft("MyArticle.Rmd", template = "posterdown_generic", package = "posterdown")
+draft("MyArticle.Rmd", template = "posterdown_pdf", package = "posterdown")
 }
-
 }