mkdir ~/.MyTeX
TEXMFHOME=~/.MyTeX
echo $TEXMFHOME
ls $TEXMFHOME
TEXMFHOME=$TEXMFHOME tlmgr init-usertree
ls $TEXMFHOME
TEXMFHOME=$TEXMFHOME tlmgr --usermode install caption
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Use R in a lua filter" | |
output: | |
html_document: | |
pandoc_args: !expr rmarkdown::pandoc_lua_filter_args("my.lua") | |
--- | |
This document will have uppercase header using R function `toupper()` | |
```{cat, engine.opts = list(file = "my.lua")} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(magrittr) | |
library(usethis) | |
# We want to keep question and not rename it to reprex so | |
# 1. Add question label with color and description | |
# 2. Remove renaming of question to reprex | |
labels <- c(tidy_labels(), "question") | |
rename <- tidy_labels_rename() %>% {.[names(.) != "question"]} | |
colors <- c(tidy_label_colours(), "FBCA04") | |
description <- c(tidy_label_descriptions(), "questions not answered anywhere else") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> rmarkdown::render_site(output_format = 'bookdown::gitbook', encoding = 'UTF-8') | |
|......................................................................| 100% | |
inline R code fragments | |
processing file: index.Rmd | |
output file: index.knit.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_pandoc_metadata <- function(file, to = "html") { | |
template <- tempfile(fileext = ".json") | |
json_out <- tempfile(fileext = ".json") | |
xfun::write_utf8("$meta-json$", template) | |
template_arg <- sprintf("--template=%s", template) | |
rmarkdown::pandoc_convert(file, from = "markdown", to = to, | |
options = c(template_arg), | |
output = json_out) | |
jsonlite::fromJSON(json_out) | |
} |
# installed by winget
winget install PowerShell-Preview
winget install git
git config --global user.name "Christophe Dervieux"
git config --global user.email christophe.dervieux@gmail.com
winget install rstudio
winget install vscode
winget install -e R
winget install Github.GithubDesktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test file | |
sample_chunk <- " | |
```{r hello, testing=as.logical(1), another=1 + 1} | |
1 + 1 | |
```" | |
file = "sample.Rmd" | |
writeLines(sample_chunk, con = file) | |
foo_hook = function(before, options, envir) { | |
# only run after the chunk | |
if (before) return() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# one graphic | |
```{r, fig.cap = "This is a caption for unique figure"} | |
knitr::include_graphics("test-1.png") | |
``` | |
# Three graphics in the same chunk | |
Using three times `include_graphics` |
- https://blog.joaograssi.com/windows-subsystem-for-linux-with-oh-my-zsh-conemu/
- https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet
- https://medium.com/@slmeng/how-to-install-powerline-fonts-in-windows-b2eedecace58
- https://github.com/zsh-users/zsh-autosuggestions
- https://gist.github.com/kevin-smets/8568070
- https://code.tutsplus.com/tutorials/how-to-customize-your-command-prompt--net-24083
- https://medium.com/@jrcharney/bash-on-ubuntu-on-windows-the-almost-complete-set-up-1dd3cb89b794
- https://github.com/romkatv/powerlevel10k#recommended-meslo-nerd-font-patched-for-powerlevel10k
- https://twasa.ml/post/wsl/
- https://evdokimovm.github.io/windows/zsh/shell/syntax/highlighting/ohmyzsh/hyper/terminal/2017/02/24/how-to-install-zsh-and-oh-my-zsh-on-windows-10.html