2

as the title states, my question is about pandocs md to pdf.

When I convert a markdown like

# Title

...... text that is about a 3/4 page

![image that is too large to fit page](image.png)

Some more text

then the text after the image "some more text" is displayed on the first page and the image gets pushed to the second page, which changes the order of my content.

What i can do is something like

# Title

...... text that is about a 3/4 page

\newpage
![image that is too large to fit page](image.png)

Some more text

But that is very annoying to maintain, because when i want to add content to the start afterwards i have to check if the \newpage is still neccessary there of if i have to add another one somewhere else.

Is there any real solution for this? Maybe a setting in the YAML header?

I have googled alot about this but didnt come across a solution.

Thanks :)

ValeKnappich
  • 162
  • 1
  • 8
  • this might help you: https://stackoverflow.com/questions/49040322/how-to-force-image-to-text-when-converting-markdown-to-pdf-using-pandoc – mb21 Feb 01 '20 at 10:13

1 Answers1

5

Try rendering with pandoc from the command line and deactivating the implicit_figures option, as in:

pandoc my_markdown.md -f markdown-implicit_figures -o rendered_md.pdf

This comes with the downside that it removes captions from figures. Including the following tex in the header works perfectly for me (copied from here as well):

\usepackage{float}
\let\origfigure\figure
\let\endorigfigure\endfigure
\renewenvironment{figure}[1][2] {
    \expandafter\origfigure\expandafter[H]
} {
    \endorigfigure
}
ValeKnappich
  • 162
  • 1
  • 8
Luise
  • 482
  • 1
  • 6
  • 21