# Set mathtext font (computer modern, latex)

**URL:** https://discourse.paraview.org/t/set-mathtext-font-computer-modern-latex/16677
**Category:** ParaView Support
**Created:** [May 21, 2025, 7:38am UTC](https://discourse.paraview.org/t/set-mathtext-font-computer-modern-latex/16677 "2025-05-21T07:38:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jluebke](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@jluebke](https://discourse.paraview.org/u/jluebke)
#### Post date: [May 21, 2025, 7:38am UTC](https://discourse.paraview.org/t/set-mathtext-font-computer-modern-latex/16677/1 "2025-05-21T07:38:49Z")

</div>

I would like to use the Computer Modern (cm) font in Paraview for Latex math rendering, but this [solution](https://discourse.paraview.org/t/use-computer-modern-cm-font-in-math-mode-in-text-solved/6406), i.e. editing the matplotlibrc file, does not work for me.

Troubleshooting:

- edit `C:\Users\user\.matplotlib\matplotlibrc` and `C:\Program Files\ParaView 5.13.1\bin\Lib\site-packages\matplotlib\mpl-data\matplotlibrc`
- add `mathtext.fontset: cm` and `mathtext.rm: serif` (the rest remains unchanged)
- in Paraview, add Programmable Source and run

```auto
import matplotlib as mpl
print(mpl.get_configdir())
print(mpl.rcParams["mathtext.fontset"])
print(mpl.rcParamsOrig["mathtext.fontset"])
print(mpl.rcParams["mathtext.rm"])

```

- this confirms the changes and prints `C:\Users\user\.matplotlib`, `cm`, `cm`, `serif`
- add Text Source with `$\mathrm{Text}$ $\phi$`, which produces the following output  
 ![grafik](https://discourse.paraview.org/uploads/default/original/3X/2/0/207c6f5189703be4fa8b4479d759c8656de6c55c.png)
- for reference, this is expected  
 ![grafik](https://discourse.paraview.org/uploads/default/original/3X/6/1/61e9fa82be9025398ce64db08be140d4b3373236.png)
- re-running the Programmable Source now outputs `C:\Users\user\.matplotlib`, `dejavusans`, `cm`, `serif`

This suggests to me, that Paraview sets the mathtext font to Dejavu Sans somewhere during the text rendering process.

I’m on Windows 11 with Paraview 5.13.1
