将pandoc md定义为tex转换规则?

时间:2017-04-19 20:32:50

标签: latex markdown pandoc tex

是否可以定义标题如何从Markdown转换为LaTeX?

我想转换

# Heading 1

\chapter{Heading 1}

## Heading 2

\section{Heading 2}

等等。

1 个答案:

答案 0 :(得分:0)

我认为你必须写一个pandoc filter,将标题整数增加1,类似于:

#!/usr/bin/env runhaskell
import Text.Pandoc.JSON

main :: IO ()
main = toJSONFilter inchead
  where inchead (Header n attr xs) = Header (n+1) attr xs
        inchead x = x
相关问题