我想使用扩展名codefocus突出显示下面的代码行col_names = TRUE
,但是,当结合使用.fragments
和协散焦时,突出显示的代码就消失了,这不是我想要的.有没有人有 idea 或不同的方法?
MWE:
---
title: "Test Highlight"
format: revealjs
execute:
echo: true
revealjs-plugins:
- codefocus
---
## A multicolumn slide without highlighting
:::::: {.columns .fragment}
::::: {.column width="50%"}
Some text
Some text
Some text
Some text
::::{.fragment}
::: {.callout-note}
## Note
Some callout
:::
::::
:::::
::::: {.column width="50%"}
:::{.fragment}
### R Code
```{r}
library(readr)
# Import mtcars.csv with read_csv()
df <- read_csv("mtcars.csv",
col_names = TRUE)
```
:::
:::{.fragment}
### Result
```{r}
head(df[1:3,1:3])
```
:::
:::::
::::::
## A multicolumn slide with highlighting
:::::: {.columns .fragment}
::::: {.column width="50%"}
Some text
Some text
Some text
Some text
::::{.fragment}
::: {.callout-note}
## Note
Some callout
:::
::::
:::::
::::: {.column width="50%"}
::::{.fragment .current-only data-code-focus="5"}
### R Code
```{r}
library(readr)
# Import mtcars.csv with read_csv()
df <- read_csv("mtcars.csv",
col_names = TRUE)
```
::::
::::{.fragment}
### Result
```{r}
head(df[1:3,1:3])
```
::::
:::::
::::::