Suppose you would like to have a line break in the math mode text in plotly. The following solutions have been tried, but none of them is working in different reasons: import plotly.graph_objects as go fig = go.Figure() fig.add_trace(go.Box(y=[10, 14])) fig.update_layout(xaxis_title="$\alpha \\ \beta$") # causes to_image error # fig.update_layout(xaxis_title=r"$\alpha \\ \beta$") # no breaks between math shape of alpha and beta # fig.update_layout(xaxis_title="$\\alpha$<br>$\\beta$") # only shows math shape of alpha and no beta at all! # fig.update_layout(xaxis_title="$\\alpha \\\\ \\beta$") # # no breaks between math shape of alpha and beta # fig.update_layout(xaxis_title="$$\\alpha \\\\ \\beta$$") # no breaks between math shape of alpha and beta # fig.update_layout(xaxis_title="$$\\alpha$$ <br> $$\\beta$$") # # only shows math shape of alpha and no beta at all! fig.show() fig.write_image("this_image.pdf") So, the question is how to set a line break in a math mode text? Continue reading...