[Tex/LaTex] pdfpages does not correctly scale inserted pdf pages

pandocpdfpages

I use the following code :

\usepackage{pdfpages}
...
\includepdf[pages=-]{article.pdf}

I also tried many pdfpages options such as fitpaper, templatesize, noautoscale, scale and so forth.

I also tried with other pdf files.

The result is always the same, I have the correct amount of page inserted in my final pdf but each of them and incredibly small.

enter image description here

Best Answer

This is actually a known pandoc issue : https://github.com/jgm/pandoc-templates/issues/72

To resolve it you need to use your own template. Use pandoc -D latex > template.tex to generate it. Then find the following line :

\setkeys{Gin}{width=\ScaleWidthIfNeeded,height=\ScaleHeightIfNeeded,keepaspectratio}%

and comment it.

Next, call pandoc with this argument : --template=template.tex

Works like a charm for me.

Related Question