We can use Cascading Style Sheets (CSS) to achieve this.
If you are new to CSS and want some help/tutorial, see this Stack Overflow question:
Also refer to the ReText Wiki for Configuration File:
Follow these steps to create and modify the CSS File:
ReText stores its configuration files at
~/.config/ReText project/ReText.conf. Open your File Manager (Nautilus if you are using Ubuntu). Press Ctrl + H to show all the hidden files. Now, navigate to the directory
ReText project. Here you would find
ReText.conf. We would need to edit it to point to our
css file. But let's first create the
In this same directory create a file called
myconfig.css (you can name it whatever you want). Now open it in a Text Editor.
Edit the file as below:
font-family: Ubuntu Mono, DejaVu Sans Mono;
Obviously, what you want is to only set the
font-family property to
code tag. However, I recommend to set
background-color property as well to both
pre tags. I have set the
LightGrey (its Hex Value is
#D3D3D3). You may modify the color to your tastes and preferences. The following link should help you in this regard.
Now modify ReText's Configuration file to point it to the newly created stylesheet. Open
~/.config/ReText project/ReText.conf in your Text Editor and add the
styleSheet setting at the end and point it to its location. For me it is:
- Ensure that you provide the full path to the file. It cannot expand
~ as your
- Furthermore, if you named your css file as something other than
myconfig.css or placed it in some other directory, ensure that you provide the correct file name and path.
If you already had ReText running, close and restart it again for changes to take effect.
How to know what HTML
<tag> to modify
If you are unsure about the tag names, you can view the HTML code of your markdown and then make your preferred changes to CSS.
Edit Menu → View HTML code would show the markup of your markdown text.