I want to have the text shown in the image 1 in a plot (this is taken from Rubidium 87 D Line Data - Daniel A. Steck, page 23). It's a simple equation involving an uppercase letter, in bold italics, with font Computer Modern. So far I've tried
import matplotlib.pyplot as plt
plt.rcParams["text.usetex"] = True
plt.rcParams["text.latex.preamble"].join([
r"\usepackage{bm}",
r"\usepackage{amsmath}"])
fig, ax = plt.subplots()
# Not bold
ax.text(0, 0.5, r"$F=0$", fontsize=18)
# Not italic
ax.text(0.2, 0.5, r"$\mathbf{F=0}$", fontsize=18)
# Not italic, not the correct font
ax.text(0.4, 0.5, r"\textit{\textbf{F}}=0", fontsize=18)
# Returns an error from LaTeX
ax.text(0.6, 0.5, r"$\bm{F}=0$", fontsize=18)
# Returns an error from LaTeX
ax.text(0.8, 0.5, r"$\boldsymbol{F}=0$", fontsize=18)
I'm using pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021/W32TeX) to display the equations.