#' start_ltx_options
#'
#' Initialiser certaines options LTX au départ.
#'
#' @return Commandes LTX.
#' @keywords internal
#' @export
start_ltx_options <- function(){
catx(sections_color("astral", c(87,146,204)),
tocdepth(5))
}
#' sections_color
#'
#' Applique une couleur ayant un code RGB aux sections d'un document RMarkdown.
#'
#' @param x Nom de la variable contenant le code RGB.
#' @param rgb Code RGB. c(R, G, B)
#'
#' @return Code LaTeX à insérer dans un RMarkdown.
#' @keywords internal
#' @export
#' @examples
#' rmd_sections_color("astral", c(87,146,204))
sections_color <- function(x, rgb){
paste0(
"\\definecolor{",x,"}{RGB}{",paste(rgb, collapse = ","),"}\n",
"\\allsectionsfont{\\color{",x,"}}"
)
}
#' Sections table des matières
#'
#' Détermine jusqu'à quel niveau les sections sont affichées dans les vignettes du fichier PDF.
#'
#' @param x level maximal à afficher.
#'
#' @keywords internal
#' @export
tocdepth <- function(x){
return(paste0("\\setcounter{tocdepth}{",x,"}"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.