R for
Authoring!!

OOH Session #67…
…code annotation!!!

Open Office Hours
(March 04, 2025)

  • Recap session #66         ↔︎️
  • Focal issue(s):
    • code annotation!!!
  • Shared problem-solving

Recap of Session
#66:

🧐🥳 emojis & icons!!!

---
title: "Emojis and Icons"
format: html
---

``{css}

.bigger{
  font-size: 5em; 
}

``


# allo peeps `r emo::ji("airplane")`

## Quantas `r emo::ji("airplane")`

![](https://www.wwf.org.uk/sites/default/files/styles/max_650x650/public/2022-05/_WW236934.jpg?itok=JlG-1l9V)

Here's a nice looking koala `r emo::ji("koala")`

Is this one even bigger? [`r emo::ji("koala")`]{.bigger}


::: {.bigger}
`r fontawesome::fa("clapperboard", fill="#4287f5", fill_opacity = .3)`

`r fontawesome::fa("route", fill="#e241e8")`

`r fontawesome::fa("apple", fill="#e8a041")`
:::
---
title: "Emojis and Icons"
format: 
  pdf:
    pdf-engine: lualatex
    include-in-header: 
      - text:
          \usepackage{emoji}
engine: knitr
---

``{r emoji}
#| echo: false
#| warning: false
#| message: false

## https://ctan.math.washington.edu/tex-archive/macros/luatex/latex/emoji/emoji-doc.pdf

library(stringr)

emoji <- function(x) {
  if (knitr::is_latex_output()) {
 stringr::str_c("\\emoji{", str_replace_all(x, "_", "-"), "}")
  } else if (knitr::is_html_output()) {
 stringr::str_c(":", x, ":")
  } else x
}
``

# allo peeps `r emoji("airplane")`

## Quantas `r emoji("airplane")`

![](https://www.wwf.org.uk/sites/default/files/styles/max_650x650/public/2022-05/_WW236934.jpg?itok=JlG-1l9V)

Here's a nice looking koala `r emoji("koala")`

Is this one even bigger? \Huge `r emoji("koala")`


`r fontawesome::fa("clapperboard", fill="#4287f5", fill_opacity = .3)`

`r fontawesome::fa("route", fill="#e241e8")`

`r fontawesome::fa("apple", fill="#e8a041")`
1
The \Huge specification is a LaTeX command with similar effect as the .css .bigger

Today…

code annotation!!!


yabba <- c(1,2,3)

dabba <- c(4,5,6) 

doo   <- c("A","B","C")

wilma <- as.data.frame(
        cbind(yabba,dabba,
        doo))

plot(wilma)
1
…or dew not 💧⛔, that is the question 🤨🤔

Session Info (March 04, 2025) Rendering:

R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] fontawesome_0.5.2

loaded via a namespace (and not attached):
 [1] lubridate_1.9.3   emo_0.0.0.9000    digest_0.6.31     crayon_1.5.2     
 [5] assertthat_0.2.1  lifecycle_1.0.4   jsonlite_1.8.9    magrittr_2.0.3   
 [9] evaluate_1.0.0    stringi_1.7.12    rlang_1.1.3       cli_3.6.0        
[13] rstudioapi_0.15.0 vctrs_0.6.5       generics_0.1.3    rmarkdown_2.28   
[17] tools_4.2.2       stringr_1.5.1     glue_1.6.2        purrr_1.0.1      
[21] xfun_0.42         yaml_2.3.10       fastmap_1.1.1     compiler_4.2.2   
[25] timechange_0.3.0  htmltools_0.5.7   knitr_1.45