问题描述
我用 LaTex beamer presentation
生成一个 rmarkdown::beamer_presentation
。
当我通过向 YAML 标头添加 header-includes: \setbeameroption{show notes on second screen}
来使用幻灯片注释时,演示文稿的很多内容都消失了:
LaTex 数学、单词、表格、
请看下面的图片。从第二张截图可以看出,内容“仍然存在”,只是以某种方式打印成白色(原因不明,请参阅下面的简单 MWE)。
带和不带幻灯片注释的框架
带有幻灯片注释的框架:显示内容“在那里”(隐藏/白色)的屏幕截图
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}