gpt4 book ai didi

html - Pandoc Markdown : ignore text in PDF (but include in HTML) Updated?

转载 作者:搜寻专家 更新时间:2023-10-31 22:24:42 24 4
gpt4 key购买 nike

这个关于如何包含将出现在 html 而不是 pdf 中的文本的问题已经回答了两次( LaTeX multicolumn block in Pandoc markdownPandoc markdown: Omit text in PDF version but include in HTML version ),我应用了推荐的解决方案:

这是来源:

My text.

<div>
This will be ignored in non-HTML output
</div>

Other text

我使用的命令是: pandoc essai.md --from=markdown-markdown_in_html_blocks -o essai.pdf

然而 <div> 之间的文本标签仍然显示在pdf文件中。

我是否遗漏了一些明显的东西?或者自 2013/2014 年以来 pandoc 的行为发生了变化(我的版本是 2016 年的 1.19)?如果是,解决方案是什么?

最佳答案

我知道您要求的解决方案适用于 pandoc 1.19,但为了完整起见,这里有一个更简洁但仅适用于 pandoc 2.0 及更高版本的解决方案:

有一个新的 raw_attribute 扩展,它允许执行以下操作:

`text in html`{=html}
`text in pdf`{=latex}

它默认在 pandoc markdown 中启用。

关于html - Pandoc Markdown : ignore text in PDF (but include in HTML) Updated?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48083724/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com