Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RST: how to decrease font size in code blocks?

I would like to include a code block in a presentation I am preparing with Restructured Text. But the font used in the code block is huge and it can not fit inside resulting code box:

enter image description here

How can I reduce the font size used in code blocks?

like image 753
Luís de Sousa Avatar asked Jul 01 '26 14:07

Luís de Sousa


2 Answers

Set the fontSize property of the code style in your style file.

e.g.

code:
    parent: literal
    fontSize: 10
like image 172
Rob Allen Avatar answered Jul 03 '26 02:07

Rob Allen


Some of the builtin themes (alabaster) accept usage of custom.css.

Create _static/custom.css and add the following to adjust the code-block font-size:

_static/custom.css:

.highlight { background: #f8f8f8; font-size: x-small;}
like image 36
monkut Avatar answered Jul 03 '26 04:07

monkut



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!