[英]Pandoc conversion to latex not complete
I have been writing a paper in Markdown and successfully converting to a pdf using pandoc.我一直在 Markdown 中写一篇论文,并使用 pandoc 成功转换为 pdf。 Now I need to output to a latex file.
现在我需要 output 到 latex 文件。 When I do pandoc does not output a full latex file.
当我做 pandoc 时,没有 output 完整的 Z25F7E525B5C0641E1EB1FB3BDEBEB15B5Z 文件。
I have recreated the problem in a smaller document.我在一个较小的文档中重新创建了这个问题。
---
title: Test Document
author: Rusty
date: 2022 Jul 26
---
# Body #
This is the body.
Using the command pandoc --read=markdown --write=latex --output=testdoc.pdf testdoc.md
creates the following document which is perfect.使用命令
pandoc --read=markdown --write=latex --output=testdoc.pdf testdoc.md
创建以下完美的文档。
However, when I try to output to latex without converting to pdf a lot of the document is missing.但是,当我尝试将 output 转换为 latex 而不转换为 pdf 时,很多文档都丢失了。 I use a similar command
pandoc --read=markdown --write=latex --output=testdoc.tex testdoc.md
我使用类似的命令
pandoc --read=markdown --write=latex --output=testdoc.tex testdoc.md
This is the entire document.这是整个文件。
\hypertarget{body}{%
\section{Body}\label{body}}
This is the body.
How can I get the latex output to include everything and act as a full latex document?如何获得 latex output 以包含所有内容并充当完整的 latex 文档?
You can add the --standalone
option:您可以添加
--standalone
选项:
pandoc --read=markdown --write=latex --output=testdoc.tex --standalone test.md
(but beware that this will just dump every package but the kitchen sink into your document - many of these package are unnecessary and cause a trillion "funny" problems) (但请注意,这只会转储每个 package 但厨房沉入您的文档 - 其中许多 package 是不必要的,并导致一万亿个“有趣”问题)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.