在rmarkdown::beamer_演示文稿中使用幻灯片注释时,帧内容将消失

在rmarkdown::beamer_演示文稿中使用幻灯片注释时,帧内容将消失,r,latex,r-markdown,markdown,beamer,R,Latex,R Markdown,Markdown,Beamer,我使用rmarkdown::beamer_演示文稿生成一个LaTex beamer演示文稿 当我通过向YAML标题添加标题includes:\setbeameroption{show notes on second screen}来使用幻灯片注释时,演示文稿的许多内容都消失了: 数学,单词,表格 请看下面的图片。从第二个屏幕截图可以看出,内容“仍然存在”,只是以某种方式以白色打印(没有直接的原因,请参见下面简单的MWE) 带幻灯片笔记的框架(&D) 带幻灯片说明的框架:显示内容“存在”的屏幕截

我使用
rmarkdown::beamer_演示文稿生成一个
LaTex beamer演示文稿

当我通过向YAML标题添加
标题includes:\setbeameroption{show notes on second screen}
来使用幻灯片注释时,演示文稿的许多内容都消失了: 数学,单词,表格

请看下面的图片。从第二个屏幕截图可以看出,内容“仍然存在”,只是以某种方式以白色打印(没有直接的原因,请参见下面简单的MWE)

带幻灯片笔记的框架(&D)

带幻灯片说明的框架:显示内容“存在”的屏幕截图(隐藏/白色)

MWE
---
标题:“rmarkdown::beamer_演示文稿中的幻灯片注释”
输出:
bookdown::pdf\U图书:
基本格式:rmarkdown::beamer\u演示文稿
乳胶引擎:Xeletex
toc:错误
幻灯片U级别:2
标题包括:
-\usepackage{hyperref}
-\setbeameroption{在第二个屏幕上显示注释}
---
##桌子
\标签{FRAME table cars}
```{r table,cars,echo=FALSE}
图书馆(kableExtra)
knitr::kable(头部(mtcars[,1:3]),标题=“表格标题”)
```
\{table}{foo}的字幕
\标签{foo}
\开始{center}
\开始{tiny}
($\Rightarrow$另请参见:\hyperlink{FRAME plot PRESSION}{PRESSION plot}\hyperlink{FRAME-other-1}{other 1})\linebreak
($\Rightarrow$和其他:\hyperlink{FRAME-other-2}{other 2}\hyperlink{FRAME-other-3}{other 3})
\结束{tiny}
\结束{中心}
\注{
\textbf{注释帧1}\\
1 XXXXXXXXXXXXXXXXXXXXXXXXXX\\
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX A\\
3 XXXXXXXXXXXXXXXXXXXXXXXXXX AB\\
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ABC\\
}
##密谋
\标签{帧打印压力}
```{r plot,echo=FALSE,out.width='66%'}
绘图(压力)
```
\{figure}{bar}字幕
\标签{bar}
\开始{center}
\开始{tiny}
($\Rightarrow$另请参见:\hyperlink{FRAME table cars}{table cars}\hyperlink{FRAME-other-1}{other 1})\linebreak
($\Rightarrow$和其他:\hyperlink{FRAME-other-2}{other 2}\hyperlink{FRAME-other-3}{other 3})
\结束{tiny}
\结束{中心}
\注{
\textbf{注释帧2}\\
1 XXXXXXXXXXXXXXXXXXXXXXXXXX\\
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX A\\
3 XXXXXXXXXXXXXXXXXXXXXXXXXX AB\\
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ABC\\
}
##其他第1帧
\标签{FRAME-other-1}
##其他第2帧
\标签{FRAME-other-2}
##其他第3帧
\标签{FRAME-other-3}

取消注释
标题包括:\setbeameroption{show notes on second screen}
以包含幻灯片注释,从而图表/表格下方的表格、箭头和Hyperref将消失。

这是旧Xeletex版本的问题,只需使用另一个引擎即可避免问题

如果出于某种原因确实需要Xeletex,可以升级到texlive 2021预测试,问题就解决了

---
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}
---
标题:“rmarkdown::beamer_演示文稿中的幻灯片注释”
输出:
bookdown::pdf\U图书:
基本格式:rmarkdown::beamer\u演示文稿
发动机:lualatex
toc:错误
幻灯片U级别:2
标题包括:
-\setbeameroption{在第二个屏幕上显示注释}
---
##桌子
\标签{FRAME table cars}
```{r table,cars,echo=FALSE}
图书馆(kableExtra)
knitr::kable(头部(mtcars[,1:3]),标题=“表格标题”)
```
\{table}{foo}的字幕
\标签{foo}
\开始{center}
\开始{tiny}
($\Rightarrow$另请参见:\hyperlink{FRAME plot PRESSION}{PRESSION plot}\hyperlink{FRAME-other-1}{other 1})\linebreak
($\Rightarrow$和其他:\hyperlink{FRAME-other-2}{other 2}\hyperlink{FRAME-other-3}{other 3})
\结束{tiny}
\结束{中心}
\注{
\textbf{注释帧1}\\
1 XXXXXXXXXXXXXXXXXXXXXXXXXX\\
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX A\\
3 XXXXXXXXXXXXXXXXXXXXXXXXXX AB\\
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ABC\\
}
##密谋
\标签{帧打印压力}
```{r plot,echo=FALSE,out.width='66%'}
绘图(压力)
```
\{figure}{bar}字幕
\标签{bar}
\开始{center}
\开始{tiny}
($\Rightarrow$另请参见:\hyperlink{FRAME table cars}{table cars}\hyperlink{FRAME-other-1}{other 1})\linebreak
($\Rightarrow$和其他:\hyperlink{FRAME-other-2}{other 2}\hyperlink{FRAME-other-3}{other 3})
\结束{tiny}
\结束{中心}
\注{
\textbf{注释帧2}\\
1 XXXXXXXXXXXXXXXXXXXXXXXXXX\\
2 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX A\\
3 XXXXXXXXXXXXXXXXXXXXXXXXXX AB\\
4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ABC\\
}
##其他第1帧
\标签{FRAME-other-1}
##其他第2帧
\标签{FRAME-other-2}
##其他第3帧
\标签{FRAME-other-3}

这是pgf/Xeletex的一个bug,请使用其他引擎来避免该问题。。。。不要加载
hyperref
包,beamer已经这样做了。非常感谢您提供的快速而优雅的解决方案!对于任何遇到类似问题却无法使用
lualatex
编译的人:我必须确保我的演示者笔记不包含任何特殊字符或引文。我不知道
LuaTex
希望我做什么<代码>程序包fontspec警告:LuaTeX中不支持输入映射。(fontspec)使用“ligations=TeX”而不是“Mapping=TeX text”。
@mavericks在没有看到a的情况下会尝试制作MWE
---
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}