How to specify YAML metadata in Markdown for Pandoc Beamer slides?
Asked Answered
C

1

2

I am trying to use a YAML metadata block to specify some document properties in a Markdown document for Pandoc that I am going to convert to LaTeX Beamer. I read the description here: http://johnmacfarlane.net/pandoc/README.html#extension-yaml_metadata_block and attempted the following document:

---
title: Some title
---

# This is a test slideshow.

## This should turn into a slide...

...with some content.

I convert the file to PDF using pandoc -t beamer file.md -V theme:SomeTheme -o file.pdf. It seems to work correctly with the theme etc., except that the YAML block at the beginning of the document is converted into a table in the first slide containing a top and bottom rule and the text "title: Some title". What am I doing wrong?

Complex answered 8/9, 2014 at 10:53 Comment(0)
C
2

Not sure why your metadata doesn't work as mine works fine.

Try doing (with a space after the title):

---
title: Some title

---

# This is a test slideshow.

## This should turn into a slide...

...with some content.

Or (with periods):

---
title: Some title

...

# This is a test slideshow.

## This should turn into a slide...

...with some content.

Or (with quotes):

---
title: "Some title"

---

# This is a test slideshow.

## This should turn into a slide...

...with some content.

Do these all work?

Crenshaw answered 10/10, 2014 at 16:16 Comment(1)
Indeed, they all work. Strangely, my original example also works now. I was previously trying this with an earlier version of Pandoc (I do not remember which). It works now with version 1.12.2.1.Complex

© 2022 - 2024 — McMap. All rights reserved.