使用 Rmarkdown 在 Beamer 演示文稿中插入导航栏
Insert navigation bar in Beamer presentation with Rmarkdown
我正在尝试在 R Markdown 中制作 Beamer 演示文稿,您可以在下面看到代码是如何开始的:
---
title: "Test presentation"
author:
- Loana
institute:
- Supervised by
- University
date: Academic year 2017-2018
output:
beamer_presentation:
incremental: false
theme: "Frankfurt"
colortheme: "beaver"
toc: true
slide_level: 5
keep_tex: true
header-includes:
- \AtBeginSubsection{}
---
此代码给出如下图所示的输出
但是我的意图是在幻灯片的右上角有导航栏,所以有人可以帮我怎么做吗?
以下是您想要的输出吗?
如果是这样,创建一个文件 header.tex
包含以下内容(取自 https://tex.stackexchange.com/a/35637/181010)
\setbeamertemplate{navigation symbols}{}
\makeatletter
\setbeamertemplate{footline}
{%
\pgfuseshading{beamer@barshade}%
\ifbeamer@sb@subsection%
\vskip-9.75ex%
\else%
\vskip-7ex%
\fi%
\begin{beamercolorbox}[ignorebg,ht=2.25ex,dp=3.75ex]{section in head/foot}
\insertnavigation{\paperwidth}
\end{beamercolorbox}%
\ifbeamer@sb@subsection%
\begin{beamercolorbox}[ignorebg,ht=2.125ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}\insertsubsectionhead
\end{beamercolorbox}%
\fi%
}%
\setbeamertemplate{headline}{%
\hskip1em\usebeamercolor[fg]{navigation symbols dimmed}%
}
\makeatother
然后将 header 添加到 .Rmd
的 yaml 中:
---
title: "Test presentation"
author:
- Loana
institute:
- Supervised by
- University
date: Academic year 2017-2018
output:
beamer_presentation:
incremental: false
theme: "Frankfurt"
colortheme: "beaver"
toc: true
slide_level: 5
keep_tex: true
header-includes:
- \AtBeginSubsection{}
- \input{header.tex}
---
我正在尝试在 R Markdown 中制作 Beamer 演示文稿,您可以在下面看到代码是如何开始的:
---
title: "Test presentation"
author:
- Loana
institute:
- Supervised by
- University
date: Academic year 2017-2018
output:
beamer_presentation:
incremental: false
theme: "Frankfurt"
colortheme: "beaver"
toc: true
slide_level: 5
keep_tex: true
header-includes:
- \AtBeginSubsection{}
---
此代码给出如下图所示的输出
但是我的意图是在幻灯片的右上角有导航栏,所以有人可以帮我怎么做吗?
以下是您想要的输出吗?
如果是这样,创建一个文件 header.tex
包含以下内容(取自 https://tex.stackexchange.com/a/35637/181010)
\setbeamertemplate{navigation symbols}{}
\makeatletter
\setbeamertemplate{footline}
{%
\pgfuseshading{beamer@barshade}%
\ifbeamer@sb@subsection%
\vskip-9.75ex%
\else%
\vskip-7ex%
\fi%
\begin{beamercolorbox}[ignorebg,ht=2.25ex,dp=3.75ex]{section in head/foot}
\insertnavigation{\paperwidth}
\end{beamercolorbox}%
\ifbeamer@sb@subsection%
\begin{beamercolorbox}[ignorebg,ht=2.125ex,dp=1.125ex,%
leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
\usebeamerfont{subsection in head/foot}\insertsubsectionhead
\end{beamercolorbox}%
\fi%
}%
\setbeamertemplate{headline}{%
\hskip1em\usebeamercolor[fg]{navigation symbols dimmed}%
}
\makeatother
然后将 header 添加到 .Rmd
的 yaml 中:
---
title: "Test presentation"
author:
- Loana
institute:
- Supervised by
- University
date: Academic year 2017-2018
output:
beamer_presentation:
incremental: false
theme: "Frankfurt"
colortheme: "beaver"
toc: true
slide_level: 5
keep_tex: true
header-includes:
- \AtBeginSubsection{}
- \input{header.tex}
---