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

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

问题描述

我正在使用降价和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天全站免登陆