Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 Markdown 文件转换为 PDF 并保留代码块格式?
降价代码
JSON { "client_id": "string", "api_key": "string", "data": {
通过 Mkdocs 提供的服务看起来像:
EX_1
将 Markdown 文件转换为 PDF(或 docx 等)后,格式如下所示:
EX_2
我需要保留 EX_1 中所示的背景颜色和行号。
对于那些可能遇到类似问题的人,以下为我解决了这个问题;
\usepackage{longtable}\setlength{\LTleft}{0em}
pandoc test.md -o test.pdf -H preamble.tex