0

I am using matlab-prettifier to write matlab codes inside my LaTeX files. The block codes work fine, but the inline codes gives the error Package Listings Error: Couldn't Load Requested Style. How can I fix this error?

\documentclass{article}
\usepackage[framed,numbered]{matlab-prettifier}
\begin{document}
% This is not working
This is an inline code \lstinline[style=Matlab-style]!break!

% This is working \begin{lstlisting} i = 1; for i < 10 i = i + 1; end \end{lstlisting} \end{document}

1 Answers1

0

The matlab-prettifier manual mentions the available styles in the section 4 "Styles provided by matlab-prettifier" on page 6:

The package defines three listings styles for Matlab code: Matlab-editor, Matlab-bw, and Matlab-Pyglike. Those styles differ in terms of color scheme

[...]

Here is a comparison of the three styles defined by matlab-prettifier.

Matlab-editor This style mimics the default style of the Matlab editor.

Matlab-bw This style is mainly for black & white printing.

Matlab-Pyglike The minted, verbments, and pythontex packages all use Pygments lexers for syntax highlighting of listings. This matlab-prettifier style closely mimics the default style associated with Pygments’ MatlabLexer.

MWE:

\documentclass{article}
\usepackage[framed,numbered]{matlab-prettifier}
\begin{document}
% This is not working
This is an inline code \lstinline[style=Matlab-editor]!break!

% This is working \begin{lstlisting}[style=Matlab-pyglike] i = 1; for i < 10 i = i + 1; end \end{lstlisting} \end{document}

enter image description here

Marijn
  • 37,699