html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/5681#issuecomment-894613319,https://api.github.com/repos/pydata/xarray/issues/5681,894613319,IC_kwDOAMm_X841UrdH,14371165,2021-08-07T06:29:19Z,2021-08-07T06:29:19Z,MEMBER,"It's the newline join that's the problem. You can get the latex working as textwrap intends by using `""$\n$"".join` ```python import numpy as np from matplotlib import pyplot as plt import xarray as xr da = xr.DataArray(range(5), dims=""x"", coords = dict(x=range(5))) name = r""$Ra_s = \mathrm{mean}(\epsilon_k) / \mu M^2_\infty$"" name = ""$\n$"".join(textwrap.wrap(name, 30)) da.x.attrs = dict(long_name = name) da.plot() plt.figure() plt.plot(range(5)) plt.xlabel(name) ``` But that looks worse than the original, checking if the string is latex-able seems a good idea.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,963089887