I would like to know how to go about adding a title bar to a minted block of python code? This is an example of a title bar I would like to use:
I tried using the code from this solution but I could not get the code posted in that solution to compile using WinEdt with the pdftex -shell-escape. When I run the code from the posted solution, I get this error:
Error: cannot read infile: [Errno 2] No such file or directory: 'codeboxes_1.pyg'
! Package minted Error: Missing Pygments output; \inputminted was probably given a file that does not exist--otherwise, you may need the outputdir package option, or may be using an incompatible build tool, or may be using frozencache with a missing file.
Here is my code thus far:
CODE
\documentclass[letter, 12pt]{report}
%########################### FOR PYTHON ####################################
% https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted
\usepackage{minted}
\usepackage{xcolor} % to access the named colour LightGray
\definecolor{LightGray}{gray}{0.9}
\begin{document}
\begin{minted}
[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
firstnumber = 41,
linenos
]
{python}
fig = plt.subplots(figsize=(12,2))
ax = plt.subplot(1,1,1)
ax.plot(times, x)
ax.grid(True)
plt.ylabel('amplitude [in A.U.]', fontsize=14)
plt.xlabel('time [in sec]', fontsize=14)
plt.xticks(fontsize=13)
plt.yticks(fontsize=13)
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
plt.show()
\end{minted}
\end{document}


\RequirePackage[cache=false]{minted}, however, for the output generated, I just the boxed header with no python code in there. Let me try ifpygmentizeworks from the command line.\ – Joe Oct 10 '22 at 21:41Error: cannot read infile: [Errno 2] No such file or directory:with I run thepygmentizefrom the command line. Is that why my compilation is failing? – Joe Oct 10 '22 at 21:55