How to use latex equation environment in Pandoc Markdown?

后端 未结 2 1753
醉话见心
醉话见心 2021-01-31 11:08

In Pandoc markdown, I can use \'$$\' to start a display math environment. However, these equations are not numbered in latex so I hope to use the equation environment instead, l

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-31 11:28

    There is not good native support for proper equation numbering but there is a workaround.

    > pandoc -s -o math.html --mathjax 
    (@) $$y=5$$
    
    A paragraph here explaining 
    
    (@) $$y=6$$
    

    Output

    
    
    1. \[y=5\]

    A paragraph here explaining

    1. \[y=6\]

    Numbering example

    Obviously the output can be styled with css to suit. On the other hand, the tex output of this method also places the numbers to the left. Which compromise you choose is up to you.

提交回复
热议问题