使用Pandoc从Markdown转换为PDF时设置双倍行距和行号 [英] Set double spacing and line numbers when converting from Markdown to PDF with pandoc

查看:362
本文介绍了使用Pandoc从Markdown转换为PDF时设置双倍行距和行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用markdown& Pandoc用于科学写作,我知道我可以使用

I am using markdown & pandoc for scientific writing, I know I can change margins of the final pdf using

从Markdown转换时设置边距大小使用pandoc转换为PDF

但是期刊经常在提交的稿件中要求使用双行和行号,问题是如何更改它们,我对LaTex知之甚少,所以我迷失在那片丛林中.

but very often the journals require double lines and line numbers in submitted manuscripts, the question is how to change these, I don't know much about LaTex so I am lost in that jungle.

谢谢!

推荐答案

也许有一种简单的方法:使用所需的软件包生成文件

There is maybe an easy way: generate a file with the packages we need

 \usepackage{setspace}
 \doublespacing
 \usepackage[vmargin=1in,hmargin=1in]{geometry}
 \usepackage{lineno}
 \linenumbers

我将其命名为options.sty.并使用-H FILE选项,该选项在前导末尾包含FILE的内容. (如 https://github.com/karthikram/smb_git 中所使用)

I named it options.sty. And use the -H FILE option that includes the content of the FILE at the end of the preamble. (as used in https://github.com/karthikram/smb_git)

 pandoc -H options.sty --bibliography mypaper.bib mypaper.md -o mypaper.pdf 

优点是我们不需要编辑模板.要添加行号,更改边距并设置间距,它可以工作.

The advantage is that we don't need to edit the template. To add linenumbers, change margins, and set spacing it works.

这篇关于使用Pandoc从Markdown转换为PDF时设置双倍行距和行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆