Pandoc内联.class和.id元素 [英] Pandoc inline .class and .id elements

查看:99
本文介绍了Pandoc内联.class和.id元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题:Panddoc markdown中是否有一种方法可以标记内联类(或id),然后可以将其输出到LaTeX和html,如果可以,怎么办?

My Question: Is there a way in Pandoc markdown to mark inline class (or id) elements that could then be output to LaTeX and html and if so, how?

我正在寻找一种一输入多输出"发布解决方案,该解决方案具有所需的LaTeX和epub输出,但具有所需的.docx输出.在LaTeX中,我定义了\mytag{foo},它对应于html中的<span class="myclass">foo</span>,用于某些单词级别的标记. (在MSWord,Libreoffice和Adobe Indesign中,可以为此设置字符样式.)

I am looking for a "one input many outputs" publication solution with needed output of LaTeX and epub, but with desired output of .docx. In LaTeX I have defined \mytag{foo} which would correspond to <span class="myclass">foo</span> in html for certain word level mark up. (In MSWord, Libreoffice and Adobe Indesign it is possible to set character styles for this purpose.)

我能找到的最接近答案的是Pandoc文档中的以下简约陈述和示例:

The closest thing I can find to an answer is this minimalistic statement and example from the Pandoc documenation:

可以使用以下语法在标头末尾为标头分配属性 包含标题文本的行:

Headers can be assigned attributes using this syntax at the end of the line containing the header text:

{#identifier .class .class key=value key=value}

推荐答案

pandoc最近更新了,现在您可以这样做:

pandoc got updated recently, now you can do:

`code with class`{.class}

[Span with class]{.class}

这篇关于Pandoc内联.class和.id元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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