# What is wrong with my packages?

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:

\usep­a­ck­age{list­ings}
\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 ­a­ck­age{list­ings} 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­ a­ck­age{list­ings} 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.

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}

• TeXmaker is an editor, you have to install packages through a LaTeX distribution. Have you installed mikTeX or TeXlive? (personally I would recommend TeXlive for new usersers) Nov 15, 2017 at 10:17
• I have mikTeX installed and it works perfectly with all other packages (babel, inputenc,fontenc...) Nov 15, 2017 at 10:19
• Welcome to TeX SX! LaunchMiKTeX Package Manager (admin) , right-click listings and matlab-prettifierand select install. Nov 15, 2017 at 10:19
• I think it's already installed, when I right-click the options are "uninstall" and "properties". Nov 15, 2017 at 10:21
• Please show the error message you got (all the lines in the log file from ! to ? in a code section ({} button) so line endings are preserved) \usepackage is 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 Nov 15, 2017 at 10:32

There's something weird going on with the syntax higlighting of \usep­a­ck­age{list­ings} in your question. It almost looks like there are extra invisible characters in the command, between \usep and ackage. You might have accidentally copied them from somewhere.