## LaTeX forum ⇒ General ⇒ Compile error: ...requires listings.sty' version 1.7, but I have it Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
Ontic_Chimera
Posts: 4
Joined: Sat Dec 29, 2018 6:40 am

### Compile error: ...requires listings.sty' version 1.7, but I have it

Hi all,
I compile just fine until I try to include the listings package in my preamble. When I do I get the error below, suggesting that I am missing listings.sty version 1.7. However, I do have that file and that version. I tried uninstalling and reinstalling the listings package, but the problem persists. Any suggestions? Using MiKTeX 2.9. Thanks.

...texmf\tex\latex\listings\lstmisc.sty
File: lstmisc.sty 2018/09/02 1.7 (Carsten Heinz)
***
*** This file requires `listings.sty' version 1.7.
*** You have a serious problem, so I'm exiting ...
***
) ) )
(\end occurred inside a group at level 1)
### semi simple group (level 1) entered at line 1820 (\begingroup)
### bottom level
(\end occurred when \ifx on line 1820 was incomplete)...

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
Can you run a small document with just the listings package and show us the log file?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Ontic_Chimera
Posts: 4
Joined: Sat Dec 29, 2018 6:40 am
Running the following does not produce the error:

\documentclass{article}
\usepackage{listings}
\begin{document}
Some input text.
\end{document}

Here is the log file.
input.log

For comparison, the code that throws the error is:

\newcommand{\mydriver}{pdflatex} %Making a PDF directly using pdflatex.
\documentclass[12pt,\mydriver]{thesis}

\usepackage{titlesec}
\titleformat{\chapter}
{\normalfont\large}{Chapter \thechapter:}{1em}{}
\usepackage{graphicx}
\usepackage{cite}
\usepackage{lscape}
\usepackage{indentfirst}
\usepackage{latexsym}
\usepackage{multirow}
\usepackage{epstopdf}
\usepackage{tabls}
\usepackage{wrapfig}
\usepackage{slashbox}
\usepackage{longtable}
\usepackage{supertabular}
\usepackage{subeqn}
\usepackage{subfigure}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{listings}

\usepackage{color, soul}
\usepackage{spverbatim}
% For use with Tables:
\usepackage{booktabs}
% For units
\usepackage{siunitx}

\newcommand{\tbsp}{\rule{0pt}{18pt}} %used to get a vertical distance after \hline
\renewcommand{\baselinestretch}{2}
\setlength{\textwidth}{5.9in}
\setlength{\textheight}{9in}
\setlength{\topmargin}{-.50in}
\setlength{\oddsidemargin}{.55in}
\setlength{\parindent}{.4in}
\pagestyle{empty}

\begin{document}

\pagestyle{empty}
\include{Abstract} %(must be first, required, non-numbered)
\include{Titlepage} %(must follow Abstract, required, non-numbered)

%Pages from this point start at lower-case Roman number ii)
\pagestyle{plain} \pagenumbering{roman} \setcounter{page}{2}
\include{Acknowledgments} %(if present, lower-case Roman)

\renewcommand{\baselinestretch}{1}
\small\normalsize
\tableofcontents %(required, lower-case Roman)
\newpage
\listoftables %(if present, lower-case Roman)
\newpage
\listoffigures %(if present, lower-case Roman)
\newpage

% Nomeclature
\include{Nomenclature-supertabular}

\newpage
\setlength{\parskip}{0em}
\renewcommand{\baselinestretch}{2}
\small\normalsize

%Pages from this point start at Arabic numeral 1
\setcounter{page}{1}
\pagenumbering{arabic}
\include{Chapter1}
\include{Chapter2}
\include{Chapter3}
\include{Chapter4}
%\include{Chapter5}
\titleformat{\chapter}
{\normalfont\large}{Appendix \thechapter:}{1em}{}
\include{AppendixA}
%\include{AppendixB}
%\include{AppendixC}
%\include{AppendixD}

\renewcommand{\baselinestretch}{1}
\small\normalsize

\newpage
\bibliographystyle{unsrt}
\bibliography{MyReferences}

\end{document}

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
I suspect you are using a very old thesis template that has gone obsolete years ago. It was shipped with an unneeded version of the listings package.
Can you attach the log file of the example that fails?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Ontic_Chimera
Posts: 4
Joined: Sat Dec 29, 2018 6:40 am
Here is the log file of the example that fails to compile. Indeed, it does contain the line:
Package: listings 2002/04/01 1.0 (Carsten Heinz)
Which I'm guessing is the unneeded version you are referring to, however, I have no idea where this is coming from. Also, how could you tell the template shipped with the an older listings package?
Thanks
mainthesis.log

Stefan Kottwitz
Posts: 9445
Joined: Mon Mar 10, 2008 9:44 pm
I can see in the log file that a very old thesis class is used that has not been updated since 12 years:

Document Class: thesis 2006/04/26 v0.1

Is this one required (or recommended) by your university (of Maryland?) or institute? If not, you may change to a newer class and template.

It looks similar to Benjamin Bengfort's template folder that contains an outdated version of the listings package.

Stefan