Preserve Line Breaks in Pandoc Markdown -> LaTeX Conversion

后端 未结 3 1028
一向
一向 2021-01-01 16:34

I want to convert the following *.md converted into proper LaTeX *.tex.

Lorem *ipsum* something.
Does anyone know lorem by heart?

         


        
3条回答
  •  有刺的猬
    2021-01-01 16:46

    Update

    Since pandoc 1.16, this is possible:

    pandoc --wrap=preserve
    

    Old answer

    Since Pandoc converts the Markdown to an AST-like internal representation, your non-semantic linebreaks are lost. So what you're looking for is not possible without some custom scripting (like using --no-wrap and then processing the output by inserting a line-break wherever there is a dot followed by a space).

    However, you can use the --columns NUMBER options to specify the number of characters on each line. So you won't have a sentence per line, but NUMBER of characters per line.

提交回复
热议问题