latex - How can I tell Pandoc to preserve and convert begin{...} to Markdown or HTML? - Stack Overflow

I have LaTeX code which looks like this:begin{answer}Lorem ipsumend{answer}I'd like Pandoc to

I have LaTeX code which looks like this:

\begin{answer}
Lorem ipsum
\end{answer}

I'd like Pandoc to convert it to Markdown with inline HTML, like this:

<span style='color:red'>
Lorem ipsum
</span>

or something similar. Is there any way to do that? At the least, to include some indicator in the Markdown, even if just text ANSWER: .

Does this require a Lua filter? How would that work?

Note: I originally asked this question on tex.stackexchange, but was advised to move it here, since it's not about LaTeX primarily.

I have LaTeX code which looks like this:

\begin{answer}
Lorem ipsum
\end{answer}

I'd like Pandoc to convert it to Markdown with inline HTML, like this:

<span style='color:red'>
Lorem ipsum
</span>

or something similar. Is there any way to do that? At the least, to include some indicator in the Markdown, even if just text ANSWER: .

Does this require a Lua filter? How would that work?

Note: I originally asked this question on tex.stackexchange, but was advised to move it here, since it's not about LaTeX primarily.

Share Improve this question asked Jan 29 at 11:04 SRobertJamesSRobertJames 9,23516 gold badges70 silver badges123 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Your input converts to

<div class="answer">
<p>Lorem ipsum</p>
</div>

in pandoc 3.5, which you can style with CSS, like:

.answer::before {
  content: 'Answer ';
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745303064a4621553.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信