获取带有彩色变量的 xaringan 高亮代码样式

问题描述 投票:0回答:0

我创建了 xaringan 幻灯片,我希望代码突出显示可以像这样更改变量的颜色:

当我在没有保存的情况下进行修改时,有时会使用

xaringan::inf_mr()
出现在视图面板中。

但是我保存幻灯片的最后结果是这样的:

保存后如何获得第一个高亮样式?

---
title: "Test"
subtitle: "1"
author:
- LAS
date: "`r Sys.Date()`"
output:
  xaringan::moon_reader:
    css:
      - default-fonts
      - css/leo.css
    lib_dir: libs
    nature:
      ratio: '16:9'
      highlightStyle: github
      highlightLines: true     
      countIncrementalSlides: true
editor_options: 
  chunk_output_type: console
---

```{r include=FALSE}
knitr::opts_chunk$set(comment = NA)
options(digits = 2)
require(rethinking)
```

---
# More slides

---

# Code slide
.pull-left[
```{r}
data(Howell1)
d <- Howell1
d <- d[ d$age>=18 , ]

dat <- list(
  P = d$weight,
  S = d$male + 1 ) # S=1 Mujer, S=2 Hombre

m_SW <- quap(
  alist(
    P ~ dnorm(mu,sigma),
    mu <- a[S],
    a[S] ~ dnorm(60,10),
    sigma ~ dunif(0,10)
  ), data=dat )
```
]
r highlight xaringan
© www.soinside.com 2019 - 2024. All rights reserved.