在 rmarkdown::beamer_presentation 中使用幻灯片注释时,框架内容消失

问题描述

我用 LaTex beamer presentation 生成一个 rmarkdown::beamer_presentation
当我通过向 YAML 标头添加 header-includes: \setbeameroption{show notes on second screen} 来使用幻灯片注释时,演示文稿的很多内容都消失了: LaTex 数学、单词、表格、

请看下面的图片。从第二张截图可以看出,内容“仍然存在”,只是以某种方式打印成白色(原因不明,请参阅下面的简单 MWE)。

带和不带幻灯片注释的框架

MWE_noSlideNotes-withSlideNotes

带有幻灯片注释的框架:显示内容“在那里”(隐藏/白色)的屏幕截图

withSlideNotes and highlight

MWE

---
title: "Slide notes in an rmarkdown::beamer_presentation"
output:
  bookdown::pdf_book:
    base_format: rmarkdown::beamer_presentation
    latex_engine: xelatex
    toc: false
    slide_level: 2
header-includes:
  - \usepackage{hyperref}
  - \setbeameroption{show notes on second screen}
---

## table
<!-- ======================================================== -->
\label{FRAME-table-cars}

```{r table,cars,echo = FALSE}
library(kableExtra)
knitr::kable(head(mtcars[,1:3]),caption = "Table caption")
```
<!-- LaTex label: -->
\captionof{table}{foo}
\label{foo}

\begin{center}
\begin{tiny} 
($\Rightarrow$ See also: \hyperlink{FRAME-plot-pressure}{pressure plot} \hyperlink{FRAME-other-1}{other 1})\linebreak
($\Rightarrow$ and further: \hyperlink{FRAME-other-2}{other 2} \hyperlink{FRAME-other-3}{other 3})
\end{tiny} 
\end{center}

\note{
\textbf{Note frame 1}\\
1 XXXXXXXXXXXXXXXXXXXXXXXXXXX\\
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXA\\
3 XXXXXXXXXXXXXXXXXXXXXXXXXXXAB\\
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXABC\\
}

## Plot
<!-- ======================================================== -->
\label{FRAME-plot-pressure}

```{r plot,echo=FALSE,out.width='66%'}
plot(pressure)
```
<!-- LaTex label: -->
\captionof{figure}{bar}
\label{bar}

\begin{center}
\begin{tiny} 
($\Rightarrow$ See also: \hyperlink{FRAME-table-cars}{table cars} \hyperlink{FRAME-other-1}{other 1})\linebreak
($\Rightarrow$ and further: \hyperlink{FRAME-other-2}{other 2} \hyperlink{FRAME-other-3}{other 3})
\end{tiny} 
\end{center}

\note{
\textbf{Note frame 2}\\
1 XXXXXXXXXXXXXXXXXXXXXXXXXXX\\
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXA\\
3 XXXXXXXXXXXXXXXXXXXXXXXXXXXAB\\
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXABC\\
}

## Other frame 1
<!-- ======================================================== -->
\label{FRAME-other-1}

## Other frame 2
<!-- ======================================================== -->
\label{FRAME-other-2}

## Other frame 3
<!-- ======================================================== -->
\label{FRAME-other-3}

取消注释 header-includes: \setbeameroption{show notes on second screen} 以包含幻灯片注释——表格、箭头和图形/表格下方的超级引用将消失。

解决方法

这是旧版 xelatex 的问题,换个引擎就可以避免这个问题了。

如果你因为某种原因确实需要xelatex,你可以升级到texlive 2021 pretest,问题就解决了。

---
title: "Slide notes in an rmarkdown::beamer_presentation"
output:
  bookdown::pdf_book:
    base_format: rmarkdown::beamer_presentation
    latex_engine: lualatex
    toc: false
    slide_level: 2
header-includes:
  - \setbeameroption{show notes on second screen}
---

## table
<!-- ======================================================== -->
\label{FRAME-table-cars}

```{r table,cars,echo = FALSE}
library(kableExtra)
knitr::kable(head(mtcars[,1:3]),caption = "Table caption")
```
<!-- LaTex label: -->
\captionof{table}{foo}
\label{foo}

\begin{center}
\begin{tiny} 
($\Rightarrow$ See also: \hyperlink{FRAME-plot-pressure}{pressure plot} \hyperlink{FRAME-other-1}{other 1})\linebreak
($\Rightarrow$ and further: \hyperlink{FRAME-other-2}{other 2} \hyperlink{FRAME-other-3}{other 3})
\end{tiny} 
\end{center}

\note{
\textbf{Note frame 1}\\
1 XXXXXXXXXXXXXXXXXXXXXXXXXXX\\
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXA\\
3 XXXXXXXXXXXXXXXXXXXXXXXXXXXAB\\
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXABC\\
}

## Plot
<!-- ======================================================== -->
\label{FRAME-plot-pressure}

```{r plot,echo=FALSE,out.width='66%'}
plot(pressure)
```
<!-- LaTex label: -->
\captionof{figure}{bar}
\label{bar}

\begin{center}
\begin{tiny} 
($\Rightarrow$ See also: \hyperlink{FRAME-table-cars}{table cars} \hyperlink{FRAME-other-1}{other 1})\linebreak
($\Rightarrow$ and further: \hyperlink{FRAME-other-2}{other 2} \hyperlink{FRAME-other-3}{other 3})
\end{tiny} 
\end{center}

\note{
\textbf{Note frame 2}\\
1 XXXXXXXXXXXXXXXXXXXXXXXXXXX\\
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXA\\
3 XXXXXXXXXXXXXXXXXXXXXXXXXXXAB\\
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXABC\\
}

## Other frame 1
<!-- ======================================================== -->
\label{FRAME-other-1}

## Other frame 2
<!-- ======================================================== -->
\label{FRAME-other-2}

## Other frame 3
<!-- ======================================================== -->
\label{FRAME-other-3}

enter image description here

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...