Pandoc markdown: Omit text in PDF version but include in HTML version

牧云@^-^@ 提交于 2019-12-01 06:09:42

问题


I'm trying to maintain two versions of my CV, one with lots of gloss and one that's more conventional. The glossy version will be HTML. I have it working with images (e.g. when I include an image using straight-up HTML code, Pandoc non-strict ignores the image and alt text in the PDF version but includes it in the HTML version.

However, for straight-up text, it's not working. I've tried wrapping it in <p>text</p> or <div>text</div>, but the PDF version seems to be ignoring the code while leaving the text content intact.

Reproducible example:

**My CV**

Content to appear in both

<img src='https://www.google.com/images/srpr/logo4w.png' alt='image to only appear in HTML'>

<p>Text to only appear in HTML</p>

How do I flag text content so that it only appears in the HTML version?


回答1:


With recent versions of pandoc, you can disable the extension markdown_in_html_blocks:

pandoc -f markdown-markdown_in_html_blocks

Then the contents of <div>...</div> tags will be ignored in LaTeX/PDF output, but will still appear in HTML.



来源:https://stackoverflow.com/questions/18812365/pandoc-markdown-omit-text-in-pdf-version-but-include-in-html-version

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!