from sphinx.highlighting import PygmentsBridge
from pygments.formatters.latex import LatexFormatter


class CustomLatexFormatter(LatexFormatter):

    def __init__(self, **options):
        super(CustomLatexFormatter, self).__init__(**options)
self.verboptions = 'formatcom=\\footnotesize'
PygmentsBridge.latex_formatter = CustomLatexFormatter
How do you change the code example font size in LaTeX PDF output with sphinx?