I solved this problem for me by writing a few LaTeX snippets into additional files that I save:
cat make-code-footnotesize.tex \renewenvironment{Shaded} {\begin{snugshade}\footnotesize} {\end{snugshade}}
I have such fragments for all different sizes: huge , LARGE , LARGE , LARGE , normalsize , small , footnotesize , scriptsize , tiny .
To apply them when starting pandoc , simply include the corresponding LaTeX snippet with the -H option:
pandoc -o block-code.pdf block-code.txt \ -H make-code-scriptsize.tex --highlight-style=espresso
Result:

Note , this controls the font sizes for all blocks of code in the PDF. It does not allow resizing from block to block. Of course, it also does not work for HTML, ODT, EPUB or other output - only for LaTeX and PDF output.
Kurt pfeifle
source share