较长的部分的短标题在Beamer演示文稿中标题R Markdown(Pandoc)
我正在研究由几个部分组成的beamer_presentation
。该部分标题太长了,无法适应剑桥标题。我已经尝试了来自相关乳胶来源的几个选项来使用本节的一些简短标题(例如“第1章”,而不是“第1章,具有非常非常every的长标题” \ atbeginSection。 {\ title [简短标题] {long title}}
),但无法弄清楚如何在R Markdown Yaml的标头中管理此问题。我通过#
在Markdown中设置截面标题
---
title: Title for the whole presentation
subtitle: 'Presentation'
author:
- Author
institute: "Institution"
date: " `r format(Sys.Date(), '%B %d, %Y')`"
output:
beamer_presentation:
latex_engine: xelatex
toc: true
highlight: tango
theme: "CambridgeUS"
colortheme: "lily"
fonttheme: "serif"
slide_level: 3
keep_tex: true
header-includes:
- \setbeamertemplate{navigation symbols}{}
- \AtBeginDocument{\title[Presentation]{Title for whole presentation}}
- \renewcommand{\raggedright}{\leftskip=0pt \rightskip=0pt plus 0cm}
- \def\sectionname{Chapter}
- \AtBeginSubsection{}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
```
# Chapter 1 with a very-very-very-very-very long title
## Intro
### The first page
I am working on a beamer_presentation
which consists of several sections. The section titles are too long to fit into the CambridgeUS headline. I have already tried several options from related latex sources to use some short title for the section (say just "Chapter 1" instead of "Chapter 1 with a very-very-very-very-very long title" by \AtBeginSection{\title[Short title]{Long title}}
) but yet can't figure out how to manage this in header-includes of R Markdown YAML. I set the section title through #
in Markdown
---
title: Title for the whole presentation
subtitle: 'Presentation'
author:
- Author
institute: "Institution"
date: " `r format(Sys.Date(), '%B %d, %Y')`"
output:
beamer_presentation:
latex_engine: xelatex
toc: true
highlight: tango
theme: "CambridgeUS"
colortheme: "lily"
fonttheme: "serif"
slide_level: 3
keep_tex: true
header-includes:
- \setbeamertemplate{navigation symbols}{}
- \AtBeginDocument{\title[Presentation]{Title for whole presentation}}
- \renewcommand{\raggedright}{\leftskip=0pt \rightskip=0pt plus 0cm}
- \def\sectionname{Chapter}
- \AtBeginSubsection{}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
```
# Chapter 1 with a very-very-very-very-very long title
## Intro
### The first page
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Beamer中,这是微不足道的,您可以使用
\ section [简短版本] {long version}
。但是Markdown使这项简单的工作非常困难。但是,您可以这样欺骗这样的标记:(
请小心放置此命令的位置,否则您可能最终会出现空的额外帧 - 这就是为什么我必须关闭自动TOC并手动插入它...)
In beamer, this is trivial, you can use
\section[short version]{long version}
. But Markdown makes such an easy job excruciatingly difficult.However you can trick markdown like this:
(be careful where you place this command, otherwise you might end up with empty extra frames - that's why I had to switch off the automatic toc and insert it manually...)