ram
November 4, 2022, 7:45pm
1
Hi,
I want to use a double square bracket in my plots. For that purpose, I use \llbracket in my latex. Does matplotlib also support \llbracket? I tried using
ax.set_ylabel(r"$\llbracket p \rrbracket$ [N/m$^2$] "
But I got the error saying
! Undefined control sequence.
\llbracket
l.29 {\rmfamily \llbracket
p [N/m$^2$]}%
Does anyone have any suggestions?
Thanks,
Ram
You need to tell matplotlib to load the latex package that defines your \llbracket
command eg:
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage{<latex_package_name_here>}')
If this is a custom latex command, just paste your definition in the preamble string.
ram
November 8, 2022, 7:44pm
3
Thank you. I was trying to load a latex package. But my syntax was wrong. Now I can add labels with double square brackets.