Pandoc 中带列的幻灯片 [英] Slides with Columns in Pandoc

查看:20
本文介绍了Pandoc 中带列的幻灯片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Beamer 幻灯片中并排显示代码和图像.

I would like to have code and an image side-by-side in a Beamer slide.

在 LaTeX 中,我会使用列来执行此操作.我想在列结构中使用降价.

In LaTeX I would do this with columns. I would like to use markdown within the column structure.

egin{columns}
column{.5	extwidth}

~~~~~~~~Python
>>> some python code
~~~~~~~

column{.5	extwidth}

![](A_generated_image.pdf)

end{columns}

不幸的是,Pandoc 不处理 egin{columns} 和 end{columns} 语句中的降价.有没有解决的办法?

Unfortunately Pandoc doesn't process the markdown within the egin{columns} and end{columns} statements. Is there a way around this?

  • 有没有办法在内联 LaTeX 中使用 markdown?
  • 有纯markdown解决方案吗?

推荐答案

当前版本的 pandoc(即 pandoc 2.0 及更高版本)支持 隔离 div.定位幻灯片格式时,特殊命名的 div 会转换为列:

Current versions of pandoc (i.e., pandoc 2.0 and later) supports fenced divs. Specially named divs are transformed into columns when targeting a slides format:

# This slide has columns

::: columns

:::: column
left
::::

:::: column
right
::::

:::

Pandoc 将其翻译成以下 LaTeX 投影仪代码:

Pandoc translates this into the following LaTeX beamer code:

egin{frame}{This slide has columns}
protecthypertarget{this-slide-has-columns}{}

egin{columns}[T]
egin{column}{0.48	extwidth}
left
end{column}

egin{column}{0.48	extwidth}
right
end{column}
end{columns}

end{frame}

这很简单,并且具有在针对其他演示格式(如reveal.js)时提供类似结果的额外优势.

This is simple and has the additional advantage of giving similar results when targeting other presentational formats like reveal.js.

对于 Beamer 输出,开箱即用的列不止两列.然而,Powerpoint 只支持两列.对于reveal.js,必须明确给出三列或更多列的宽度:

More than two columns work out of the box for Beamer output. Powerpoint, however, only supports two columns. For reveal.js, the widths of three or more columns must be given explicitly:

::: columns

:::: {.column width=30%}
left
::::

:::: {.column width=30%}
middle
::::

:::: {.column width=30%}
right
::::

:::

这篇关于Pandoc 中带列的幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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