My matplotlib.__version__ is 3.10.1. I'm trying to underline some text and can not get it to work. As far as I can tell, Latex is installed and accessible in my system: import subprocess result = subprocess.run( ["pdflatex", "--version"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) print(result.stdout) results in: b'pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023/Debian)\nkpathsea version 6.3.5\nCopyright 2023 Han The Thanh (pdfTeX) et al.\nThere is NO warranty. Redistribution of this software is\ncovered by the terms of both the pdfTeX copyright and\nthe Lesser GNU General Public License.\nFor more information about these matters, see the file\nnamed COPYING and the pdfTeX source.\nPrimary author of pdfTeX: Han The Thanh (pdfTeX) et al.\nCompiled with libpng 1.6.43; using libpng 1.6.43\nCompiled with zlib 1.3; using zlib 1.3\nCompiled with xpdf version 4.04\n' Also the simple code: import matplotlib.pyplot as plt plt.text(0.5, 0.5, r'$\frac{a}{b}$') plt.show() works as expected. Similar questions from 2012 (Underlining Text in Python/Matplotlib) and 2017 (matplotlib text underline) have accepted answers that fail with RuntimeError: Failed to process string with tex because dvipng could not be found A similar question from 2019 (Underlining not working in matplotlib graphs for the following code using tex) has no answer and it is my exact same issue, i.e.: import matplotlib.pyplot as plt plt.text(.5, .5, r'Some $\underline{underlined}$ text') plt.show() fails with: ValueError: \underline{underlined} text ^ ParseFatalException: Unknown symbol: \underline, found '\' (at char 0), (line:1, col:1) The 2017 question has a deleted answer that points to a closed PR in matplotlib's Github repo which points to another PR called Support \underline in Mathtext which is marked as a draft. Does my matplotlib version not support the underline Latex command? Continue reading...