Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I use a custom LaTex beamer theme in an rmarkdown::beamer_presentation.

The custom theme contains a title frame. As per this SO post markdown can be tricked to use the new title frame using header-includes: - AtBeginDocument{itleframe}.

My title contains a colon and ideally a linebreak: First line of title: second line of title. However, if I include the colon, the compilation of the presentation fails.

How can I escape the colon and, if feasible, force a linebreak right after it?

MWE (YAML header)

---
# do not add title here, else markdown generates a second title page
# ==> add title manually below with header-includes
subtitle: "Beamer presentation with R-markdown"
institute: "some place"
date: "`r format(Sys.time(), '%B %d, %Y')`"
author: "Donald Duck"
output:
  bookdown::pdf_book:
    base_format: rmarkdown::beamer_presentation
    theme: "THEMENAME"
    latex_engine: xelatex
    toc: false
    slide_level: 2
    keep_tex: true 
header-includes:
  - itle{First line of the title: second line of the title}
  - AtBeginDocument{itleframe}   
---

For remainder of MWE, i.e. the beamertheme*.sty files, see the mentioned SO post.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

You can hide the title from markdown in a .tex file:

---
# do not add title here, else markdown generates a second title page
# ==> add title manually below with header-includes
subtitle: "Beamer presentation with R-markdown"
institute: "some place"
date: "`r format(Sys.time(), '%B %d, %Y')`"
author: "Donald Duck"
output:
  bookdown::pdf_book:
    base_format: rmarkdown::beamer_presentation
    theme: "THEMENAME"
    latex_engine: xelatex
    toc: false
    slide_level: 2
    keep_tex: true 
header-includes:
  - input{preamble}
  - AfterBeginDocument{itleframe}   
---

test

preamble.tex:

itle[short version]{First line of the title: second line of the title}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...