Merge pull request #36 from brentthorne/daily-dev
Daily dev
diff --git a/Images/example_poster1.png b/Images/example_poster1.png
index e772399..cdc656f 100644
--- a/Images/example_poster1.png
+++ b/Images/example_poster1.png
Binary files differ
diff --git a/README.md b/README.md
index 94b8e39..7b35669 100644
--- a/README.md
+++ b/README.md
@@ -77,45 +77,91 @@
Posterdown uses Latex to generate the PDF poster but more specifically it uses the [Memoir Latex](http://texdoc.net/texmf-dist/doc/latex/memoir/memman.pdf) class. Memoir was chosen for its flexibility in page sizing as well as its thorough documentation. I am fairly new to the world of Latex, and found this class to have a reasonable amount of customization available, at least for my skill level. If there are any users who think there may be better options for down the road I am more than willing to listen!
-### YAML Options
-
YAML header options have been created to provide more freedom in design (i.e. colours, number of columns, and sizing) to fit a wide variety of requirements. Here are the default YAML options found in the `.Rmd` file:
+### Poster Size & Default Font
+
+| Option | Description |
+|---------------|-------------|
+| `poster_height` | Height of the final poster output. Units can be: "in", "mm", "cm" |
+| `poster_width` | Width of the final poster output. Units can be: "in", "mm", "cm" |
+| `font_family` | Selects the font family to be used on the poster. In the future I will try to implement multiple font families for various components of the poster (such as different fonts for the title versus the main body text). For now, only standard Latex fonts are available, see [here](https://www.overleaf.com/learn/latex/Font_typefaces) for a list of possible options.|
+| `font_size` | Represents the point value for `\normaltextsize` in latex. All other font sizes are adjusted from this baseline. For example, if the title in the skeleton document is given the Latex command `\Huge`, meaning that the title text will be "huge" relative to the `font_size` chosen. See [Here](https://www.overleaf.com/learn/latex/Font_sizes,_families,_and_styles) for a useful resource for a better understanding of the Latex text sizing options.|
+
+### Title Box Options
+
+#### Essential Information
+
| Option | Description |
|---------------|-------------|
| `title` | Poster title, acts as you would expect from RMarkdown. You can add line breaks in your title with \\break. |
| `author` | List of authors which (as of now) only has true support for a single author, however I have provided a hacky way to have many authors until I can find the time to figure out how to implement something like the [rticles](https://github.com/rstudio/rticles/blob/master/inst/rmarkdown/templates/mdpi_article/skeleton/skeleton.Rmd) packages does|
| `affiliation` | Author affiliations, which just as the `author` section is currently a hacky version of what I would ultimately like to produce. |
-| `title_textsize`| Title font size. Sizes can be one of: "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large", "Large", "LARGE", "huge" or "Huge", see `font_size` below for more information.
+
+#### Style & Formatting
+
+| Option | Description |
+|---------------|-------------|
+| `titlebox_bgcol` | Colour of the background for the Title Box area of the poster.|
+| `titlebox_bordercol` | Colour of the border for the Title Box area of the poster.|
+| `titlebox_shape` | Shape of the corners for the Title box (Options include: `south` or `uphill`. For all corners to be sharp use the option `"all"`. For more options please see the **[tcolorbox manual](https://mirror.hmc.edu/ctan/macros/latex/contrib/tcolorbox/tcolorbox.pdf)** and search for "sharp corners", **HINT** there are LOTS of options there :smile: . |
+| `titlebox_borderwidth` | Width of the Top Title Box border. |
+| `title_textcol` | Colour of the titlebox title text (AKA your title). |
+| `author_textcol` | Colour of the author text. |
+| `affiliation_textcol` | Colour of the affiliation text. |
+| `title_textsize`| Title font size. Sizes can be one of: "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large", "Large", "LARGE", "huge" or "Huge", see `font_size` above for more information.
| `author_textsize`| Author list font size
| `affiliation_textsize`| Affiliations list font size
-| `body_textsize`| Font size of the poster's main body
-| `bibliography_textsize`| Bibliography font size
-| `font_size` | Represents the point value for `\normaltextsize` in latex. All other font sizes are adjusted from this baseline. For example, if the title in the skeleton document is given the Latex command `\Huge`, meaning that the title text will be "huge" relative to the `font_size` chosen. See [Here](https://www.overleaf.com/learn/latex/Font_sizes,_families,_and_styles) for a useful resource for a better understanding of the Latex text sizing options.|
-| `font_family` | Selects the font family to be used on the poster. In the future I will try to implement multiple font families for various components of the poster (such as different fonts for the title versus the main body text). For now, only standard Latex fonts are available, see [here](https://www.overleaf.com/learn/latex/Font_typefaces) for a list of possible options.|
-| `title_bgcol` | The background colour for the title section of the poster (currently using hex values to define this colour) |
-| `poster_bgcol`| Background colour of the poster's main body section. |
-| `title_textcol` | Colour of the main title text. |
-| `header_textcol` | Colour of the Section Header Text. |
-| `header_bgcol` | Colour of the header title box. |
-| `header_bordercol` | Colour of the border around the header text box. |
-| `header_borderwidth` | Thickness of the header title box border. |
-| `header_boxshape` | Shape of the corners for the header title box (Options include: `sharp corners` or `rounded corners`. For more options please see the [tcolorbox manual]() and search for "sharp corners", **HINT** there are LOTS of options there :smile: . |
-| `cite_col` | Colour of the citation link elements when using `biblatex`. |
-| `url_col` | Colour of URL links specifically |
-| `link_col` | Colour of in-document links (example would be referencing a Figure or a Table) |
-| `columnline_col` | Colour of the line which divides each column in the poster |
-| `poster_height` | Height of the final poster output. Units can be: "in", "mm", "cm" |
-| `poster_width` | Width of the final poster output. Units can be: "in", "mm", "cm" |
+
+#### Adding Logos
+
+| `logoleft_name` | Name of the image file you want to use for the logo to the **left**. |
+| `logoleft_width` | Width of the image you chose (**Note**: The height will adjust automatically based on the width to avoid distortion :smile:) |
+| `logoleft_xshift` | Value to move the image along the x-axis based on the anchor being the **left** bottom corner. |
+| `logoleft_yshift` | Value to move the image along the y-axis based on the anchor being the **left** bottom corner. |
+| `logoright_name` | Name of the image file you want to use for the logo to the **right**. |
+| `logoright_width` | Width of the image you chose (**Note**: The height will adjust automatically based on the width to avoid distortion :smile:) |
+| `logoright_xshift` | Value to move the image along the x-axis based on the anchor being the **right** bottom corner. |
+| `logoright_yshift` | Value to move the image along the y-axis based on the anchor being the **right** bottom corner. |
+
+### Poster Body Options
+
+| `body_bgcol`| Background colour of the poster's main body. |
+| `body_textsize`| Font size of the poster's main paragraphs from the body. |
+| `body_textcol` | Colour of the main body text. |
| `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. |
+
+#### Section Title Styling
+
+| Option | Description |
+|---------------|-------------|
+| `sectitle_textcol` | Colour of the Section Title Text. |
+| `sectitle_bgcol` | Colour of the section title box. |
+| `sectitle_bordercol` | Colour of the border around the section text box. |
+| `sectitle_borderwidth` | Thickness of the section title box border. |
+| `sectitle_boxshape` | Shape of the corners for the section title box (Options include: `south` or `uphill`. For all corners to be sharp use the option `"all"`. For more options please see the **[tcolorbox manual](https://mirror.hmc.edu/ctan/macros/latex/contrib/tcolorbox/tcolorbox.pdf)** and search for "sharp corners", **HINT** there are LOTS of options there :smile: . |
+
+### Bibliography Options
+
+| Option | Description |
+|---------------|-------------|
| `bibliography` | Name of the `.bib`. file which you are using to source material. As of right now only `biblatex` is working but I intend to add support of `natbib` which is my preference.
| `bibliography_spacing` | Sets the mutiplier for line spacing between bibliography entries, default value is `0.8`. Useful if you need to squeeze more space from somewhere.
+| `bibliography_textsize`| Bibliography font size |
+
+### Other
+
+| `cite_col` | Colour of the citation link elements when using `biblatex`. |
+| `url_col` | Colour of URL links specifically. |
+| `link_col` | Colour of in-document links (example would be referencing a Figure or a Table). |
+| `footnote_textcol` | Colour of the footnote text. |
| `output` | For generating `posterdown_pdf`, in the future other poster designs or templates may be made for this package and thus this option in the YAML will be more flexible. For now this is the only option. |
+## Markdown Customization
-### Markdown Customization
-
-As you add content to your RMarkdown file, you will notice that the output pdf will fill in columns from left to right, and from top to bottom within columns. If you have more content for your poster than space is available on the default poster, it will spill onto a second page. If this occurs, you can try adding more columns and decreasing the font size (both in the YAML header) to make it work. Or, of course, edit the content to make it shorter. :smile:
+As you add content to your RMarkdown file, you will notice that the output pdf will fill in columns from left to right, and from top to bottom within columns. If you have more content for your poster than available space on the default poster, it will spill onto a second page. If this occurs, you can try adding more columns and decreasing the font size (both in the YAML header) to make it work. Or, of course, edit the content to make it shorter. :smile:
## Using posterdown outside of RStudio
@@ -138,10 +184,10 @@
- [x] ~~Support for changing the size of the poster~~
- [ ] Support for Natbib
- [ ] Support for nbib from PubMed
-- [ ] Support for logo placement in the title bar section of poster
+- [x] ~~Support for logo placement in the title bar section of poster~~ :tada:
- [ ] Gradient colour options
- [ ] True YAML multi-author/ multi-affiliation support
-- [ ] Toggle citation section on/off as per user's choice
+- [x] Toggle citation section on/off as per user's choice (**KIND OF DONE BUT NEEDS WORK**)
- [x] ~~Make colour options standardized (probably hex colours if possible)~~
- [ ] Allow users to choose colour options from a palette??
- [x] ~~Fill/style Section headings if user wishes~~
diff --git a/inst/rmarkdown/templates/posterdown_pdf/resources/template.tex b/inst/rmarkdown/templates/posterdown_pdf/resources/template.tex
index 962fa02..7e255c5 100644
--- a/inst/rmarkdown/templates/posterdown_pdf/resources/template.tex
+++ b/inst/rmarkdown/templates/posterdown_pdf/resources/template.tex
@@ -47,17 +47,18 @@
%%%%%%%%% COLOURS %%%%%%%%
%Fill/ Line Colours
-\definecolor{titlebgcol}{HTML}{$title_bgcol$}
+\definecolor{titleboxbgcol}{HTML}{$titlebox_bgcol$}
+\definecolor{titleboxbordercol}{HTML}{$titlebox_bordercol$}
\definecolor{columnlinecol}{HTML}{$columnline_col$}
-\definecolor{posterbgcol}{HTML}{$poster_bgcol$}
-\definecolor{headerbgcol}{HTML}{$header_bgcol$}
-\definecolor{headerbordercol}{HTML}{$header_bordercol$}
+\definecolor{posterbgcol}{HTML}{$body_bgcol$}
+\definecolor{sectitlebgcol}{HTML}{$sectitle_bgcol$}
+\definecolor{sectitlebordercol}{HTML}{$sectitle_bordercol$}
% Text Colours
\definecolor{titletextcol}{HTML}{$title_textcol$}
\definecolor{authortextcol}{HTML}{$author_textcol$}
\definecolor{affiliationtextcol}{HTML}{$affiliation_textcol$}
-\definecolor{headertextcol}{HTML}{$header_textcol$}
+\definecolor{sectitletextcol}{HTML}{$sectitle_textcol$}
\definecolor{bodytextcol}{HTML}{$body_textcol$}
\definecolor{footnotetextcol}{HTML}{$footnote_textcol$}
\definecolor{citecol}{HTML}{$cite_col$}
@@ -69,7 +70,7 @@
colorlinks=true,
linkcolor=linkcol,
citecolor=citecol,
- filecolor=magenta,
+ filecolor=linkcol,
urlcolor=urlcol,
}
@@ -88,14 +89,14 @@
\setlength{\columnseprule}{1pt}
\def\columnseprulecolor{\color{columnlinecol}}
-%define section header title features
-\setsubsubsecheadstyle{\small\color{headertextcol}\textbf}% Set \section style
+%define section title features
+\setsubsubsecheadstyle{\small\color{sectitletextcol}\textbf}% Set \section style
\setsecnumformat{}
\def\sectionmark#1{\markboth{#1}{#1}}
%tcolorbox magic from my stack exchange question
-\newtcolorbox{myboxstuff}[1][]{code={\parindent=0em},colframe=headerbordercol,left skip=0pt,valign=center,halign=center,fontupper=\Large\bfseries,colupper=headertextcol,boxrule=$header_borderwidth$,$header_boxshape$,colback=headerbgcol, #1}
+\newtcolorbox{myboxstuff}[1][]{code={\parindent=0em},colframe=sectitlebordercol,nobeforeafter,left skip=0pt,valign=center,halign=center,fontupper=\Large\bfseries,colupper=sectitletextcol,boxrule=$sectitle_borderwidth$,colback=sectitlebgcol,sharp corners=$sectitle_boxshape$, #1}
\newcommand{\mybox}[1]{%
\begin{myboxstuff}
\strut #1
@@ -140,18 +141,18 @@
\chapterstyle{mydefault}
%define column spacing
-\setlength\columnsep{1in}
+\setlength\columnsep{$column_margins$}
-\setlength\parindent{1em}
-\setlength\parskip{1em}
+\setlength\parindent{0em}
+\setlength\parskip{0em}
\setlength\hangparas{0}
%spacing after section head title
-\setaftersecskip{0.3in}
-\setbeforesecskip{1in}
-\setlength\textfloatsep{0.3in}
-\setlength\floatsep{0.3in}
-\setlength\intextsep{0.3in}
+\setaftersecskip{0em}
+\setbeforesecskip{1.5em}
+\setlength\textfloatsep{0in}
+\setlength\floatsep{0in}
+\setlength\intextsep{0in}
\setstocksize{$poster_height$}{$poster_width$}
\settrimmedsize{\stockheight}{\stockwidth}{*}
@@ -168,14 +169,6 @@
\setlength{\uppermargin}{0pt}
\checkandfixthelayout
-\mdfdefinestyle{brentsmdfstyle}{%
- backgroundcolor=titlebgcol,
- linecolor=columnlinecol,
- topline=false,
- leftline=false,
- rightline=false,
- linewidth=2mm}
-
%Footnote to white
\RequirePackage{footmisc}
\def\footnotelayout{\centering\color{footnotetextcol}}
@@ -190,32 +183,49 @@
\newpagecolor{posterbgcol}
-%begin the document
-\begin{document}
-
-\begin{mdframed}[style=brentsmdfstyle]
-
%sets footnote to be white hopefully
\renewcommand\footnoterule{}
\renewcommand{\thempfootnote}{\footnotesize\color{footnotetextcol}{\arabic{mpfootnote}}}
-% group which adds title author and other infor
-% Used instead of \maketitle for better spacing options
-\begingroup
- \centering
+
+%top title box
+\newtcolorbox{topbox}{
+enhanced,
+colback=titleboxbgcol,
+colframe=titleboxbordercol,
+halign=center,
+boxrule=$titlebox_borderwidth$,
+sharp corners=$titlebox_shape$,
+ overlay={
+ \node[anchor=south west]
+ at ([xshift=$logoleft_xshift$,yshift=$logoleft_yshift$]frame.south west)
+ {\includegraphics[width=$logoleft_width$]{$logoleft_name$}};
+ \node[anchor=south east]
+ at ([xshift=$logoright_xshift$,yshift=$logoright_yshift$]frame.south east)
+ {\includegraphics[width=$logoright_width$]{$logoright_name$}};}
+
+}
+
+% -------------- begin the document ----------------- %
+\begin{document}
+
+% -------------- Top Section Start ------------------ %
+
+%tcolorbox allows for pictures hopefully
+\begin{topbox}
\color{titletextcol}
-\vspace{0.5in}
+ \vspace{0.5in}
\$title_textsize${$title$} \\[0.3in] %% SC
\color{authortextcol} \$author_textsize${$author$} \\[0.2in] %% SC
\color{affiliationtextcol} \$affiliation_textsize${$affiliation$} %% SC
- \vspace{0.2in}
+ \vspace{1cm}
+\end{topbox}
-% end title section -------------------
- \endgroup
-\end{mdframed}
+% ---------------- Top Section End ------------------%
-% Brgin body of poster
-\begin{adjmulticols*}{$column_numbers$}{10mm}{10mm}
+
+% Begin body of poster
+\begin{adjmulticols*}{$column_numbers$}{$column_margins$}{$column_margins$}
\$body_textsize${ %% SC
\color{bodytextcol}
$body$
diff --git a/inst/rmarkdown/templates/posterdown_pdf/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/posterdown_pdf/skeleton/skeleton.Rmd
index 7e8d11d..27f1b18 100644
--- a/inst/rmarkdown/templates/posterdown_pdf/skeleton/skeleton.Rmd
+++ b/inst/rmarkdown/templates/posterdown_pdf/skeleton/skeleton.Rmd
@@ -1,55 +1,61 @@
---
-#----ESSENTIALS----#
+#---POSTER SIZE & DEFAULT FONT---#
+poster_height: "38in" # height in inches of poster
+poster_width: "45in" # width in inches of poster
+font_family: "palatino" # choose from typical latex fonts (example: "palatino")
+font_size: "30pt" #please see github.com/brentthorne/posterdown for compatible options.
+
+#---TITLE BOX OPTIONS---#
+#ESSENTIALS
title: '\fontfamily{phv}\selectfont Using posterdown to generate reproducible conference posters via RMarkdown > Knitr > Markdown > Pandoc > Latex > PDF workflow'
author: "Author One^1^ Author Two^2^"
affiliation: "^1^Department of Poster Layouts, University of Markdown; ^2^Deparment of Another Institution, Institution University"
-
-#----FONT STYLE & SIZE----#
-font_family: "palatino" # choose from typical latex fonts (example: "palatino")
-font_size: "30pt" #sets '\normalsize' (sizes of the title and sections headings will adjust based on it, not recommended as memoir has limited options)
-
-# Sizes are standard LaTeX options (tiny, scriptsize, footnotesize, small, normalsize, large, Large, LARGE, huge and Huge)
+#STYLE & FORMATTING
+titlebox_bgcol: "008080" #Colour of the Title Box background
+titlebox_bordercol: "0b4545" #Colour of the title Box border.
+titlebox_shape: "all"
+titlebox_borderwidth: "1cm"
+title_textcol: "ffffff" #colour of title text
+author_textcol: "0b4545" # Colour of author text
+affiliation_textcol: "FFFFFF" # Colour of affiliation text
title_textsize: "Huge" # Poster title fontsize
author_textsize: "Large" # Author list font size
affiliation_textsize: "large" # Affiliation font size
+#ADDING LOGOS
+logoleft_name: 'Figures/posterdownlogo'
+logoleft_width: '3in'
+logoleft_xshift: '1in'
+logoleft_yshift: '1in'
+logoright_name: 'Figures/posterdownlogo'
+logoright_width: '3in'
+logoright_xshift: '-1in'
+logoright_yshift: '1in'
+
+#---POSTER BODY OPTIONS---#
+body_bgcol: "ffffff" #colour of the poster main background
body_textsize: "normalsize" # Size of the main poster body text
-bibliography_textsize: "tiny" # size of the bibliography text size (handy for one too many references!)
+body_textcol: "000000" # Colour of main text in the body of poster
+column_numbers: 4 # Number of columns that the poster has
+column_margins: "0.5in" # Margin spacing for columns
+columnline_col: "008080" #colour
+#SECTION TITLE STYLING
+sectitle_textcol: "ffffff" # Colour of the poster section titles
+sectitle_bgcol: "0b4545" # Colour of the section title box
+sectitle_bordercol: "0b4545" # Colour of the border around the section title box.
+sectitle_borderwidth: "2mm" # Thicknes of the section title box border
+sectitle_boxshape: "south" # Changes the shape of the section title box.
-#----COLOURS----#
+#---BIBLIOGRAPHY OPTIONS---#
+bibliography: MyLibrary # name of the .bib file used for referencing
+bibliography_spacing: 0.8 # sets the multiplier for line spacing of bibliography spacing (between 0 and 1)
+bibliography_textsize: "small" # size of the bibliography text size (handy for one too many references!)
-#Background/ Line Colours
-title_bgcol: "0b4545" #Hex colour for background of poster title section (default is blue)
-poster_bgcol: "ffffff" #colour of the poster main background
+#---OTHER---#
cite_col: "CC0000" #colour of ciation elements
url_col: "008080" #colour of url links
link_col: "008080" #colour of other links within the poster
-columnline_col: "ffffff" #colour
-
-#Text Colours
-title_textcol: "ffffff" #colour of title text
-author_textcol: "008080" # Colour of author text
-affiliation_textcol: "FFFFFF" # Colour of affiliation text
-body_textcol: "000000" # Colour of main text in the body of poster
footnote_textcol: "ffffff" # Colour of footnote text if used
-
-#----POSTER SIZE & COLUMN FORMATTING----#
-poster_height: "39in" # height in inches of poster
-poster_width: "45in" # width in inches of poster
-column_numbers: 4 # Number of columns that the poster has
-column_margins: "5mm" # Margin spacing for columns
-
-#---- Section Titles Styling ----#
-header_textcol: "ffffff" # Colour of the poster header titles
-header_bgcol: "0b4545" # Colour of the header title box
-header_bordercol: "0b4545" # Colour of the border around the box (if you dont want one then set border size to 0)
-header_borderwidth: "6pt" # Thicknes of the header box border
-header_boxshape: "sharp corners" # Lots of options can be used for this. Another example is "rounded corners". I will make a list soon!
-
-#----OTHER----#
-bibliography: MyLibrary # name of the .bib file used for referencing
-bibliography_spacing: 0.8 # sets the multiplier for line spacing of bibliography spacing (between 0 and 1)
output: posterdown::posterdown_pdf
-
---
```{r, include=FALSE}
@@ -57,8 +63,7 @@
```
<!--
-Bellow you will find typical RMarkdown syntax which should fill in the columns for the poster from top to bottom left to right. The more information you have the more will be filled. Please let me know if you have feedback at brentthorne18@gmail.com or at github.com/brentthorne/posterdown
-
+Bellow you will find typical RMarkdown syntax which should fill in the columns for the poster from top to bottom left to right. The more information you have the more will be filled. Please let me know if you have feedback at brentthorne18@gmail.com or at github.com/brentthorne/posterdown.
ENJOY! XD
-->
@@ -89,25 +94,21 @@
# Objectives
-\large
-
1. Easy to use reproducible poster design.
2. Integration with `RMarkdown`.
3. Easy transition from `posterdown` to `thesisdown` or `rticles`
-\small
+\lipsum[2]
+\lipsum[2]
# Methods
-This package uses the same workflow approach as the `RMarkdown` you know and love. Basically it goes from RMarkdown > Knitr > Markdown > Pandoc > Latex > PDF
-
-\lipsum[1-3]
+This package uses the same workflow approach as the `RMarkdown` you know and love. Basically it goes from RMarkdown > Knitr > Markdown > Pandoc > Latex > PDF.
# Results
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{1in}
```{r}
library(kableExtra)
@@ -120,7 +121,9 @@
```
-```{r, out.width='75%', fig.width=4, fig.height=3, fig.cap='A typical plot using ggplot using the classic iris dataset.'}
+\vspace{0.5in}
+
+```{r, out.width='80%', fig.width=4, fig.height=5, fig.cap='A typical plot using ggplot using the classic iris dataset.'}
library(ggplot2)
library(ggthemes)
@@ -166,7 +169,7 @@
```
-\lipsum[1-5]
+\lipsum[1-2]
# Next Steps