markdown three ways to export a PDF with a table of contents

@

The document is exported PDF, content once more, if there is no table of contents to jump, then find them particularly strenuous, the following is the solution

The first use of CSDN

1. Click the Export good article after editing, select Export to HTML

Here Insert Picture Description

2. Select a template to export

Here Insert Picture Description

3. HTML to PDF format conversion tool

软件下载链接:https://wkhtmltopdf.org/downloads.html
Instructions:
wkhtmltopdf --disable-smart-shrinking html文件路径 导出的pdf文件路径 //html路径可使用网络路径

4. If you find it troublesome to download the software, you can use the browser directly exported

Here Insert Picture Description

The second tool use i5ting_toc

This method requires nodejs environment

Instructions:

The first step in mounting i5ting_toc

npm install i5ting_toc -g

The second step uses first conversion instruction md turn into html

 i5ting_toc -f [需要转换文件名].md
 

The third step is to preview the file after conversion

i5ting_toc -o //默认在同级目录生成preview文件夹

The fourth step browser or HTML can be converted into PDF
results are as follows:
Here Insert Picture Description

A third use vscode plugin Markdown Preview Enhanced

Instructions:

Step 1: Install the plug-
Here Insert Picture Description
Step two: Open the .md file you want to convert, right click and choose Open Preview synchronous
Here Insert Picture Description
output location Right Step Place the cursor want to generate a directory open a command panel and enter Markdown Preview Enhanced: Create Toc
Here Insert Picture Description
Here Insert Picture Description
the fourth step click will automatically save the document build directory
Here Insert Picture Description
step five export format you need, then make the appropriate recommendations to export HTML conversion to
Here Insert Picture Description
the final results are as follows:
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/songjianzaina/p/12222272.html
Recommended