Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Pandoc conversion to latex not complete

I have been writing a paper in Markdown and successfully converting to a pdf using pandoc. Now I need to output to a latex file. When I do pandoc does not output a full latex file.

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

screenshot of pdf output

However, when I try to output to latex without converting to pdf a lot of the document is missing. I use a similar command 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?

>Solution :

You can add the --standalone option:

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)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading