# Error in displaying plot while using LaTeX in plot title

**URL:** <https://community.plotly.com/t/error-in-displaying-plot-while-using-latex-in-plot-title/83707>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [April 11, 2024, 11:58am UTC](https://community.plotly.com/t/error-in-displaying-plot-while-using-latex-in-plot-title/83707 "2024-04-11T11:58:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Puspendu](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@Puspendu](https://community.plotly.com/u/Puspendu)\
**Post date:** [April 11, 2024, 11:58am UTC](https://community.plotly.com/t/error-in-displaying-plot-while-using-latex-in-plot-title/83707/1 "2024-04-11T11:58:25Z")

</div>

I am having trouble adding LaTeX commands to the plot title. Whenever I include them, the plot does not appear. However, when I don’t add any LaTeX commands, the plot appears as expected. Can you please help me fix this issue?  
I have attached the relevant code and the error message that I received.

```auto
fig.update_layout(
    title= dict(text = f"Reflectance Spectra for TE and TM Modes<br>$n_1$ = {n1}, $n_2$ = {n2}, Number of Layers = {num_layers}, $\theta$ = {th1}"),
    xaxis_title='Wavelength (nm)',
    yaxis_title='Reflectance (%)',
    hovermode='closest',
    showlegend=True,
    height=500,
    width=800,
            )

```

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/3/6/36b6cd1e85a98992e3656fb5f10ccc7856d88564.png)

```auto
Javascript Error: Cannot read properties of undefined (reading 'output')

```

The plot will appear if I don’t write any latex commands.

```auto
title= dict(text = f"Reflectance Spectra for TE and TM Modes<br>n1 = {n1}, n2 = {n2}, Number of Layers = {num_layers}, angle = {th1}"),

```

 ![newplot (10)](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/8/7/8784a414a788fd836b659272bf5a466915fba71e.png)

I am using the following Jupyter Notebook and Plotly versions:

```auto
notebook : 7.0.8

```

```auto
plotly. __version__'5.20.0'

```
