knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
here::i_am("CV-Test-Hyndman/CV-Test-Hyndman.Rmd")
library(here)
library(readr)
library(vitae)
library(tibble)

# source(here("R/table.R"))
cv <- read_rds(here("data/cv_raw.Rds"))

Thai Not work yet

H1

H2

H3

H4

Basic detailed_entries

tibble(what = rep("What field", 2),
       when = rep("Start - End", 2),
       with = rep("With field", 2),
       where = rep("Where field", 2),
       why = c("Why 1", "Why 2")
       ) %>%    
  detailed_entries(what = what, 
                   when = when, 
                   with = with, 
                   where = where, 
                   why = why)

Basic brief_entries

tibble(what = rep("What field", 2),
       when = rep("Start - End", 2),
       with = rep("With field", 2),
       where = rep("Where field", 2),
       why = c("Why 1", "Why 2")
       ) %>% 
  brief_entries(what = what, 
                when = when, 
                with = with)

Tricks

Bold

\textbf{greatest}

latex_bold <- function(text) {

  glue::glue("\\textbf{<text>}",
             .open = "<", .close = ">")
}

tibble(
  color = latex_bold("Bold Text")
       ) %>%
  detailed_entries(what = color, .protect = F)

Color

latex_color <- function(text, color = "red") {

  glue::glue("\\textcolor{<color>}{<text>}",
             .open = "<", .close = ">")
}

latex_color("text")
tibble(
  color = latex_color("TextColor", color = "red")
       ) %>% 
  detailed_entries(what = color, .protect = F)

Link to Webpage

link

\textcolor{blue}{link}

\href{http://www.latex-tutorial.com}{\textcolor{blue}{link}}

latex_hyperlink <- function(text, url, color = "blue") {

  glue::glue("\\href{<url>}{\\textcolor{<color>}{<text>}}",
             .open = "<", .close = ">")

}

latex_hyperlink("Link", "http://www.latex-tutorial.com")
tibble(
  link = latex_hyperlink("LinkParse", 
                               "http://www.latex-tutorial.com", color = "red")
       ) %>% 
  detailed_entries(what = link, .protect = F)
link_test <- latex_hyperlink(latex_bold("LinkTest"), "http://www.latex-tutorial.com")

r link_test

Bold Colored Link

New line in tibble

tibble(text = "Some text \\\\ Now, new line") %>% 
  detailed_entries(what = text, .protect = F)

Footer

hi <- "hey"

\rfoot{r hi}

latex_foot not working

latex_foot <- function(text, side = c("right", "left", "center")) {

  side <- match.arg(side)

  s <- switch (side,
    "right" = { "r" },
    "left" = { "l" },
    "center" = { "c" },
  )

  glue::glue("\\<s>foot{<text>}",
    .open = "<", .close = ">"
    )
}


tibble(foot = latex_foot("To Foot")) %>% 
    detailed_entries(with = foot, .protect = F)

Education

tribble(
  ~ Degree, ~ Year, ~ Institution, ~ Where,
  "Informal studies", "1889-91", "Flying University", "Warsaw, Poland",
  "Master of Physics", "1893", "Sorbonne Université", "Paris, France",
  "Master of Mathematics", "1894", "Sorbonne Université", "Paris, France"
) %>% 
  detailed_entries(Degree, Year, Institution, Where)

Nobel Prizes

tribble(
  ~Year, ~Type, ~Desc,
  1903, "Physics", "Awarded for her work on radioactivity with Pierre Curie and Henri Becquerel",
  1911, "Chemistry", "Awarded for the discovery of radium and polonium"
  ) %>% 
  brief_entries(
    glue::glue("Nobel Prize in {Type}"),
    Year, 
    Desc
  )

Publications

library(dplyr)
knitr::write_bib(c("vitae", "tibble"), "packages.bib")

bibliography_entries("packages.bib") %>%
  arrange(desc(author$family), issued)


Lightbridge-KS/CV documentation built on Dec. 17, 2021, 12:05 a.m.