Search code examples
pdfterminalmarkdownpandocfile-conversion

Pandoc convert md with image to pdf


My md file contains a list of images like:

"! [image-9H7092HQ.jpg] (Beginners_Russian_with_Interactive_Online_Workbook/image-9H7092HQ.jpg)"

"! [image-EVZX3ID8.jpg] (Beginners_Russian_with_Interactive_Online_Workbook/image-EVZX3ID8.jpg)"

(There is no space between "!" and "[", and "]" and "(") The images are in the another file that is in the same file as md file.

I ran

pandoc -f markdown -t pdf Beginners_Russian_with_Interactive_Online_Workbook.md

on terminal, but it gives me error:

Error producing PDF.
! LaTeX Error: Too many unprocessed floats.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.378 \centering

Then I ran

H <return> 

it returns zsh: parse error near `\n'

I am not sure what went wrong. And how I can turn this md file with images to pdf. I will be very appreciated if anyone can help me. Thanks.


The main problem is fixed, but there is a dimension problem with the output file(see below) enter image description here


Solution

  • The likely issue is that pandoc converts images without surrounding text into figures. Try

    pandoc -f markdown-implicit_figures -t latex -o OUTFILE.pdf YOUR-FILE.md
    

    That should disable this feature and solve the issue.