这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
others:markdown [2019/08/28 14:49] jinlong [生成的pdf文件] |
others:markdown [2020/07/12 12:07] (当前版本) |
||
---|---|---|---|
行 50: | 行 50: | ||
latex工具,在windows下建议安装miktex,Linux和MacOS下建议安装texlive | latex工具,在windows下建议安装miktex,Linux和MacOS下建议安装texlive | ||
- | * windows环境:下载安装[[https://miktex.org/download|miktex]] | + | * windows环境:下载安装[[https://miktex.org/download|miktex]],注意安装后需要再安装cjk,cjk-fonts等相关package |
* Linux环境:使用apt/dnf/yum/pacman等安装工具安装texlive、texlive-latex等相关软件包即 | * Linux环境:使用apt/dnf/yum/pacman等安装工具安装texlive、texlive-latex等相关软件包即 | ||
* MacOS:使用HomeBrew安装texlive即可 | * MacOS:使用HomeBrew安装texlive即可 | ||
行 70: | 行 70: | ||
配置完成后即可在通过pandoc命令生成pdf文件: | 配置完成后即可在通过pandoc命令生成pdf文件: | ||
- | * windows: pandoc -N -s --toc --pdf-engine=xelatex -V CJKmainfont='WenQuanYi Micro Hei' -V mainfont='WenQuanYi Micro Hei' -V geometry:margin=1in --template eisvogel --listings a.md -o a.pdf | + | * windows: pandoc -N -s %%--%%toc %%--%%pdf-engine=xelatex -V CJKmainfont=NSimSun -V geometry:margin=1in %%--%%template eisvogel %%--%%listings a.md -o a.pdf |
- | * Linux/MacOS: pandoc -N -s --toc --pdf-engine=xelatex -V CJKmainfont='WenQuanYi Micro Hei' -V mainfont='WenQuanYi Micro Hei' -V geometry:margin=1in --template eisvogel --listings a.md -o a.pdf | + | * Linux/MacOS: pandoc -N -s %%--%%toc %%--%%pdf-engine=xelatex -V CJKmainfont='WenQuanYi Micro Hei' -V mainfont='WenQuanYi Micro Hei' -V geometry:margin=1in %%--%%template eisvogel %%--%%listings a.md -o a.pdf |
上述命令中各个参数的说明: | 上述命令中各个参数的说明: | ||
行 77: | 行 77: | ||
* -N 给各个章节编码 | * -N 给各个章节编码 | ||
* -s 添加页眉页脚 | * -s 添加页眉页脚 | ||
- | * --toc 包含目录 | + | * %%--%%toc 包含目录 |
- | * --pdf-engine=xelatex 指定处理pdf的latex引擎 | + | * %%--%%pdf-engine=xelatex 指定处理pdf的latex引擎 |
* -V CJKmainfont=“WenQuanYi Micro Hei” 指定亚洲字体为文泉驿微米黑 | * -V CJKmainfont=“WenQuanYi Micro Hei” 指定亚洲字体为文泉驿微米黑 | ||
* -V mainfont=“WenQuanYi Micro Hei” 指定主要字体为文泉驿微米黑 | * -V mainfont=“WenQuanYi Micro Hei” 指定主要字体为文泉驿微米黑 | ||
* -V geometry:margin=1in 指定页边距 | * -V geometry:margin=1in 指定页边距 | ||
- | * --listings 对于code增加增加行号 | + | * %%--%%listings 对于code增加增加行号 |
* a.md 指输入文档为a.md文件 | * a.md 指输入文档为a.md文件 | ||
* -o a.df 指输出文件为a.pdf | * -o a.df 指输出文件为a.pdf | ||
行 104: | 行 104: | ||
titlepage: true | titlepage: true | ||
toc-own-page: true | toc-own-page: true | ||
- | secnumberdepth: 5 | + | secnumdepth: 5 |
header-left: "示例文档子标题" | header-left: "示例文档子标题" | ||
... | ... | ||
行 117: | 行 117: | ||
* titlepage: 是否创建封面页 | * titlepage: 是否创建封面页 | ||
* toc-own-page: 目录是否单独分页 | * toc-own-page: 目录是否单独分页 | ||
- | * secnumberdepth:目录编号深度 | + | * secnumdepth:目录编号深度 |
* header-left:页眉左边显示内容,默认为title,此处设置为了修改为子标题 | * header-left:页眉左边显示内容,默认为title,此处设置为了修改为子标题 | ||
行 137: | 行 137: | ||
==== markdown源文件 ==== | ==== markdown源文件 ==== | ||
- | <code> | + | <file markdown sample.md> |
--- | --- | ||
title: "示例文档" | title: "示例文档" | ||
行 145: | 行 145: | ||
titlepage: true | titlepage: true | ||
toc-own-page: true | toc-own-page: true | ||
- | secnumberdepth: 5 | + | secnumdepth: 5 |
... | ... | ||
行 178: | 行 178: | ||
**加粗字体** | **加粗字体** | ||
- | //斜体// | + | *斜体* |
~~删除线~~ | ~~删除线~~ | ||
行 191: | 行 191: | ||
[百度](http://www.baidu.com) | [百度](http://www.baidu.com) | ||
- | |||
- | |||
## 列表 | ## 列表 | ||
行 212: | 行 210: | ||
* 编号 | * 编号 | ||
* 编号 | * 编号 | ||
- | |||
- | |||
## 表格 | ## 表格 | ||
行 231: | 行 227: | ||
~~~ | ~~~ | ||
- | </code> | + | </file> |