I wanted to use these two packages:
- listings
- matlab-prettifier
to write code and highlight it like in Matlab and insert it in my pdf. I added the packages like this:
\usepackage{listings}
\usepackage[numbered,framed]{matlab-prettifier}
I am having trouble using them since when I try to compile I get this error:
! Undefined control sequence.
<recently read> \usep
l.46 \usep
ackage{listings}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., \hobx), type I and the correct
spelling (e.g., I\hbox). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.46 \usep
ackage{listings}
You're in trouble here. Try typing <return> to proceed.
The document has a begin{document} line and it works fine until I try to add the new package.
I followed this to install packages on the fly for miktex but it doesn't seem to help.
I don't undestand how to make it work, can someone please help me?
EDIT: The listings package seems to work in an example document such as this:
\documentclass{article}
\usepackage{listings}
\begin{document}
\lstset{language=Python}
% Insert Pyhon examples here.
\end{document}
MiKTeX Package Manager (admin), right-clicklistingsandmatlab-prettifierand selectinstall. – Bernard Nov 15 '17 at 10:19!to?in a code section ({}button) so line endings are preserved)\usepackageis not undefined so you have presumably a wrong command somewhere that is not defined but you have not shown your input or the error message so it is hard to help – David Carlisle Nov 15 '17 at 10:32