Pandoc markdown:省略PDF版本中的文本,但包含HTML版本中的文本 [英] Pandoc markdown: Omit text in PDF version but include in HTML version

查看:75
本文介绍了Pandoc markdown:省略PDF版本中的文本,但包含HTML版本中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试维护我的简历的两个版本,一个版本具有很多光泽,另一个版本更传统.有光泽的版本将是HTML.我可以在图片上使用它(例如,当我使用简单的HTML代码添加图片时,Pandoc非严格地会忽略PDF版本中的图片和替代文本,但会将其包含在HTML版本中.

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.

但是,对于纯文本,它不起作用.我曾尝试将其包装在<p>text</p><div>text</div>中,但是PDF版本似乎在忽略代码的同时保留了文本内容的完整性.

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.

可复制的示例:

**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>

如何标记文本内容,使其仅出现在HTML版本中?

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

推荐答案

使用最新版本的pandoc,您可以禁用扩展名markdown_in_html_blocks:

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

pandoc -f markdown-markdown_in_html_blocks

然后<div>...</div>标记的内容在LaTeX/PDF输出中将被忽略,但仍将显示在HTML中.

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

这篇关于Pandoc markdown:省略PDF版本中的文本,但包含HTML版本中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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