• 欢迎订阅我的Youtube频道
  • 欢迎加入我的电报群

Use markdown with latex using pandoc

网络技术 fennng 4个月前 (10-09) 179次浏览 0个评论

Recently, I am writing a paper. I have written a few paragraphs with markdown. And I save my markdown files as Azure Devops wiki pages. To avoid converting all these markdown files into latex files, I am looking for a solution to reuse all these markdown files in latex. I still would like to use latex because I don’t know how to manage IEEE double columns format and bibliography with markdown. Then I found that pandoc may fit my purpose.

The template I used is from here

https://github.com/lauritzsh/pandoc-markdown-template

I don’t want to install pandoc on my computer, so I chose to use a docker version. Run the following command inside the folder with your template files.

Note that, if you are using docker toolbox on windows, you have to run the command in Docker Quickstart Terminal. Also the template files must be under a folder or sub-folder of %userprofile%. Otherwise, the volume mapping will not work.

docker run -v `pwd`:/data --rm -it --entrypoint sh pandoc/latex

Once you enter the shell, you can install bash by apk add bash

you can then use whatever terminal tool to run the following command to enter the bash shell

#eloquent_lichterman is the container name
docker exec -it eloquent_lichterman bash

You can run apk add make to install make. But the Makefile is not working in my case. And I also tried a bash file, same issue.

So I end up with run the command directly in the shell.

pandoc --from markdown --to latex --template template.tex --out report-bib.pdf --pdf-engine xelatex --bibliography biblio.bib --csl style.csl dynamic/ruby.md dynamic/python.md dynamic/javascript.md static/java.md static/csharp.md functional/haskell.md functional/fsharp.md bibliography.md

This works.


峰享技术 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Use markdown with latex using pandoc
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址