【问题标题】:How do I continue list indentation in Pandoc Markdown when converting to PDF?转换为 PDF 时如何在 Pandoc Markdown 中继续列表缩进?
【发布时间】:2018-09-05 01:18:42
【问题描述】:

我在使用 Pandoc Markdown 时遇到问题。我希望我的 pdf 文档如下所示(请注意添加图像后列表项的缩进如何继续)

  1. 点一个

    此处为点 a 的图像。

    a 点的延续。

  2. 点b

    此处为点 b 的图像。

    继续点b

但是,无论我尝试什么,我都无法让缩进看起来正确。插入图像后,缩进丢失(=4 个空格)。

当我想在其中插入图形时如何缩进列表项?

编辑#1

我正在使用的 Markdown:

a. Point a starts here.\
[image for point a](image1.png)\
Point a continued.

b. Point b starts here.\
[image for point b](image2.png)\

    i. sub point 1 in point b.
    ii. sub point 2 in point b

continue point b here.

外观:

编辑#2

按照@mb21 的建议,(完全复制格式+ 添加我的图像),我得到以下输出:

图像后点的延续没有正确缩进。

更新降价:

## Problem 1 ##

a. Point a starts here.

   ![Frequency of fires in a given year](wildfires.png){height=50px}

   Point a continued.

b. Point b starts here.

   ![Frequency of fires in a given year](wildfires.png){height=50px}

   i. sub point 1 in point b.
   ii. sub point 2 in point b

   continue point b here.

【问题讨论】:

  • 我发现我可以在“Point a”之后添加“\”,然后在“Image for point a here”之后再添加一个“\”。正确缩进行。但是,图像和文本之间的空间变得太窄,看起来不太好。我不知道如何添加图像来表达我的意思。对不起:(
  • 你所描述的似乎应该可以工作,所以我怀疑你遇到了一个相当微妙的问题,如果没有看到你的 Markdown,这个问题并不明显。请编辑您的问题以将您正在使用的实际 Markdown 包含在代码块中(或至少是它的简化版本)。
  • @Waylan 谢谢。我已经添加了我的降价结构的结构。我还添加了最终生成的 pdf 的屏幕截图。

标签: markdown pandoc


【解决方案1】:

你想要的正确缩进是:

## Problem 1

a. Point a starts here.

   ![image for point a](http://cdn.northlight-images.co.uk/downloadable_2/media_check.jpg){width=5cm}

   Point a continued.

b. Point b starts here.

   ![image for point b](http://cdn.northlight-images.co.uk/downloadable_2/media_check.jpg){width=5cm}

   i. sub point 1 in point b.
   ii. sub point 2 in point b

   continue point b here.

见http://pandoc.org/MANUAL.html#block-content-in-list-items

以上结果:

【讨论】:

  • 谢谢,但它似乎不起作用。我已根据使用您的建议得到的结果更新了我的问题。
  • @AkshayGaur 为我工作...查看更新。您确定在复制粘贴时没有破坏一些空格吗?还要确保您使用的是最新的 pandoc 版本...
  • 我有 pandoc 版本 1.19.2.4(使用 apt 存储库安装)我会尝试将其更新到 2.2.3.2 并报告。
  • 我更新到了最新的 pandoc,现在可以使用了。我浪费了 3-4 个小时试图让它发挥作用,而我本可以用来完成任务。在这里,我试图在凌晨 4:30 完成任务。 :(谢谢@mb21
猜你喜欢
  • 2013-07-27
  • 2018-08-08
  • 2013-05-13
  • 2020-05-04
  • 2012-11-11
  • 2021-07-15
相关资源
最近更新 更多