# Use computer modern (cm) font in math mode in text (Solved)

**URL:** https://discourse.paraview.org/t/use-computer-modern-cm-font-in-math-mode-in-text-solved/6406
**Category:** ParaView Support
**Created:** [February 6, 2021, 5:40pm UTC](https://discourse.paraview.org/t/use-computer-modern-cm-font-in-math-mode-in-text-solved/6406 "2021-02-06T17:40:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![liangwang0734](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/3ab097/32.png) [@liangwang0734](https://discourse.paraview.org/u/liangwang0734)
#### Post date: [February 6, 2021, 5:40pm UTC](https://discourse.paraview.org/t/use-computer-modern-cm-font-in-math-mode-in-text-solved/6406/1 "2021-02-06T17:40:29Z")

</div>

#### Problem:

- In Sources-\>Text, or any Colorbar legend title, using a latex math expression like J\_z gives a sans-font-like result, instead of latex default computer modern that is shown in some official [references](https://www.paraview.org/Wiki/ParaView/Equation_Rendering). Switch the font to “Times” does not make a difference.

#### Result:

![paraview-math](https://discourse.paraview.org/uploads/default/original/2X/3/3d5117f2adcde77a46e49ca95e06b531661db031.png)

#### Desired result:

![latex-default-itatic-serif](https://discourse.paraview.org/uploads/default/original/2X/c/cda8678255abd697915fda277dd03c406af04783.png)

#### Version:

ParaView-5.8.1-MPI-Linux-Python3.7-64bit  
ParaView-5.9.0-MPI-Linux-Python3.8-64bit

#### Thoughts

According to matplotlib [document](https://matplotlib.org/3.3.0/users/dflt_style_changes.html#math-text), to revert to the old behavior set the:

```
mpl.rcParams['mathtext.fontset'] = 'cm' 
mpl.rcParams['mathtext.rm'] = 'serif'

```

or set:

```
mathtext.fontset: cm
mathtext.rm : serif

```

in your `matplotlibrc` file.

#### Update (solved):

- I modified the file ParaView-5.9.0-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc to uncomment and modify the following options:

Now the text in Paraview uses the classic latex computer modern fonts.  
 ![paraview-math-cm](https://discourse.paraview.org/uploads/default/original/2X/a/a59d9b762f1606e278061b5f79046cb01a2d516c.png)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 8, 2021, 9:39am UTC](https://discourse.paraview.org/t/use-computer-modern-cm-font-in-math-mode-in-text-solved/6406/2 "2021-02-08T09:39:53Z")

</div>

@LfxPaul: FYI
