PDF code block font size

138 views
Skip to first unread message

Warren Block

unread,
Dec 14, 2016, 6:25:46 PM12/14/16
to sphinx...@googlegroups.com
I would like to reduce the font size used in code blocks in latex PDF
output to minimize wrapping.

Some web searching found a Stack Overflow article:
http://stackoverflow.com/questions/9745854/sphinx-pdf-themes

But it's incomplete and the links are broken. Is there an easy way to
reduce the font used only in latex code blocks, or maybe choose a
narrower monospaced font? Currently, my preamble is just this:

# Additional stuff for the LaTeX preamble.
# Add table formatting package.
'preamble': r'''\usepackage{array,ragged2e}''',

E. Kelly

unread,
Dec 28, 2016, 5:41:38 PM12/28/16
to sphinx-users
Unfortunately you might need a LaTeX expert to help with this. 

I looked at log files from a recent PDF build in my project and it seems that latexpdf is already using the "listings" format by default. My guess is that you need to modify a setting in the "listings" package by using some sort of \patchcmd{ statement in your LaTeX preamble. 

Reply all
Reply to author
Forward
0 new messages