I want to use minted to display code in Latex in a customized font, e.g. Monaco. Here is my code.
\documentclass{article}
\usepackage{fontspec}
\usepackage{minted}
\newfontfamily\monaco{Monaco}
\setminted[matlab]{fontfamily=\monaco}
\begin{document}
\begin{minted}{matlab}
clear all;
syms k t f har;
left = -10; right = 10; down = -0.5; up = 1.5;
f = sinc(k/2)/2 * exp(1j*k*pi*t/2)
\end{minted}
\end{document}
However, when I build the code in vscode, the intepreter get stuck and takes 90% of the CPU. Meanwhile, it gives me the following error.
Missing \endcsname inserted.
If I do not use \newfontfamily command then I can only use the pre-defined fontfamily. How can I use a customized font in minted?
\setmonofontwould be easiest). If only for that, you should try using the NFSS name. – TeXnician Nov 09 '19 at 13:04