Vertical alignment in beamer presentation generated with R markdown
Asked Answered
C

1

7

When I use R Markdown to create slides for a beamer presentation, the text is vertically centered, which really looks odd if you only want to use 1-2 lines a slide. Is there anyway to align the text to the top of the slide (under the slide caption)?

Looking for answer, I found this post and tried to use it in R Markdown, but nothing I tried worked.

You can change the horizontal text alignment and font size for instance by using these commands

\begin{flushright}
\begin{tiny}

bla..

\end{tiny}
\end{flushright}

is there something similar for vertical text alignment? So far I've tried this:

Attempt 1:

---
title: "Untitled"
author: "Author"
date: "25 Januar 2017"
output: beamer_presentation
---
\documentclass[t]{beamer}

## Caption 1
test

Attempt 2:

---
title: "Untitled"
author: "Author"
date: "25 Januar 2017"
output: beamer_presentation
---

## Caption 1
\begin{frame}[t]
test
\end{frame}

Attempt 3:

---
title: "Untitled"
author: "Author"
date: "25 Januar 2017"
output: beamer_presentation
---

## Caption 1
\begin{flushleft}[t]
test
\end{flushleft}
Cottrill answered 25/1, 2017 at 13:8 Comment(0)
S
13

Include classoption: t with the title, author, etc. For example:

title: "Title"
author: "Author"
date: "Date"
output: beamer_presentation
classoption: t
Snell answered 26/2, 2017 at 16:49 Comment(2)
In case anyone else stumbles across this with a similar query, this answer works and applies the class option across the entire slide deck. However, if you want to only apply this to a particular slide, you can use # New Slide {.t}. I can't believe how long I've used Rmd/Beamer and not realized this was so straightforward!Anguilla
@Anguilla Thank you so much for the very useful hint! If I would like a slide to be plain and its content top-aligned as well, how would this look alike? See my SO Q hereAdjacent

© 2022 - 2024 — McMap. All rights reserved.