diff --git a/R/tex.R b/R/tex.R index 14757f55..5564e1ef 100644 --- a/R/tex.R +++ b/R/tex.R @@ -213,11 +213,13 @@ validLatexFont <- function(theme_font) { # Make sure the theme font is valid; provide a fallback rather than erroring poss_fonts <- c("bookman","charter","courier","fourier","helvet","lmodern", "lmr","palatino","tgadventor","tgbonum","tgcursor","tgheros","tgpagella", - "tgschola","tgtermes","times","utopia") + "tgschola","tgtermes","times","utopia", "raleway") + + # Raleway is Rawline, YouGov's default font. if (is.null(theme_font) || !tolower(theme_font) %in% poss_fonts) { - theme_font <- "helvet" + theme_font <- "raleway" warning("theme$font must be in ", paste0(poss_fonts, collapse = ", "), - ". It has been set to `helvet`.", call. = FALSE) + ". It has been set to `raleway`.", call. = FALSE) } return(theme_font) } diff --git a/R/theme.R b/R/theme.R index e75c992a..ac12b3da 100644 --- a/R/theme.R +++ b/R/theme.R @@ -219,13 +219,13 @@ themeDefaultExcel <- function(font = getOption("font", default = "Calibri"), #' #' \code{themeDefaultLatex} is the default theme. Users can change base options #' -#' @param font the font to use (default: `"helvet"` for Helvetica) +#' @param font the font to use (default: `"raleway"` for Raleway) #' @param font_size the font size to use (default: 12) #' #' @return A set of theme defaults for use in `writeLatex` #' #' @export -themeDefaultLatex <- function(font = getOption("font", default = "helvet"), +themeDefaultLatex <- function(font = getOption("font", default = "raleway"), font_size = getOption("font_size", default = 12)){ norm <- list(font = font, font_size = NULL) diff --git a/R/writeLatex.R b/R/writeLatex.R index 44179d7d..68b05ac9 100644 --- a/R/writeLatex.R +++ b/R/writeLatex.R @@ -253,6 +253,7 @@ latexDocHead <- function(theme, title, subtitle, banner = NULL) { paste0("\\fancyhead[L]{{", applyLatexStyle(title, theme$format_title), "}", applyLatexStyle(subtitle, theme$format_subtitle), "}"), logo, + "\\setlength{\\headheight}{16pt}", # Issue 47 "\\newcolumntype{d}{D{.}{.}{3.2}}", #!topline "\\newcolumntype{g}{D{\\%}{\\%}{3.0}}", #!topline #changed 20190907 from 5.0 to 3.0 usepackage("float"), #topline diff --git a/man/themeDefaultLatex.Rd b/man/themeDefaultLatex.Rd index c5d973ab..bab33251 100644 --- a/man/themeDefaultLatex.Rd +++ b/man/themeDefaultLatex.Rd @@ -5,12 +5,12 @@ \title{Generate default Theme for `writeLatex`} \usage{ themeDefaultLatex( - font = getOption("font", default = "helvet"), + font = getOption("font", default = "raleway"), font_size = getOption("font_size", default = 12) ) } \arguments{ -\item{font}{the font to use (default: `"helvet"` for Helvetica)} +\item{font}{the font to use (default: `"raleway"` for Raleway)} \item{font_size}{the font size to use (default: 12)} }