如何在 Markdown 中为 Pandoc Beamer 幻灯片指定 YAML 元数据? [英] How to specify YAML metadata in Markdown for Pandoc Beamer slides?

查看:50
本文介绍了如何在 Markdown 中为 Pandoc Beamer 幻灯片指定 YAML 元数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 YAML 元数据块在我要转换为 LaTeX Beamer 的 Pandoc 的 Markdown 文档中指定一些文档属性.我在这里阅读了描述:http://johnmacfarlane.net/pandoc/README.html#extension-yaml_metadata_block 并尝试以下文档:

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.

我使用 pandoc -t beamer file.md -V theme:SomeTheme -o file.pdf 将文件转换为 PDF.它似乎与主题等一起正常工作,除了文档开头的 YAML 块被转换为第一张幻灯片中的表格,其中包含顶部和底部规则以及文本标题:某些标题".我做错了什么?

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?

推荐答案

不确定为什么您的元数据无法正常工作,而我的工作正常.

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

尝试做(标题后有一个空格):

---
title: Some title

---

# This is a test slideshow.

## This should turn into a slide...

...with some content.

或(带句号):

---
title: Some title

...

# This is a test slideshow.

## This should turn into a slide...

...with some content.

或(带引号):

---
title: "Some title"

---

# This is a test slideshow.

## This should turn into a slide...

...with some content.

这些都有效吗?

这篇关于如何在 Markdown 中为 Pandoc Beamer 幻灯片指定 YAML 元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆