I've used Matlab-Prettifier in the past to format my Matlab code, but having moved out of ShareLaTeX and into a local environment, I can't seem to get the Bera Mono font. E.g., the code ...
\documentclass[11pt]{article}
% Matlab-Prettifier Setup
\usepackage{listings}
\usepackage{xcolor}
\usepackage[T1]{fontenc}
\usepackage[numbered,framed]{matlab-prettifier}
\let\ph\mlplaceholder % shorter macro
\lstMakeShortInline"
\lstset{
style = Matlab-editor,
basicstyle = \mlttfamily,
mlshowsectionrules = true
}
\begin{document}
\begin{lstlisting}[
style=Matlab-editor,
basicstyle=\mlttfamily,
escapechar=`,
caption={For educational purposes},
]
if a == b
a
end
\end{lstlisting}
\end{document}
... produces the output without the Bera font:
