GeneralCompile error: ...requires `listings.sty' version 1.7, but I have it

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

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

Post by Ontic_Chimera »

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)...

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

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

Post by Johannes_B »

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

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

Post by Ontic_Chimera »

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
(3.25 KiB) Downloaded 1253 times
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[colorlinks=true,urlcolor=black,linkcolor=blue,citecolor=blue]{hyperref}
\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)
\include{Copyright} %(highly recommended, non-numbered)

%Pages from this point start at lower-case Roman number ii)
\pagestyle{plain} \pagenumbering{roman} \setcounter{page}{2}
\addcontentsline{toc}{chapter}{Acknowledgments}
\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
\addcontentsline{toc}{chapter}{Nomenclature}
\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}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

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

Post by Johannes_B »

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

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

Post by Ontic_Chimera »

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
(18.57 KiB) Downloaded 1008 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10281
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

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
LaTeX.org admin
Ontic_Chimera
Posts: 4
Joined: Sat Dec 29, 2018 6:40 am

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

Post by Ontic_Chimera »

Thanks Stefan. Yes, the thesis template you linked to is the one I was directed to use. Now I get what's going on, and it was simply a matter of removing the old listings.sty which got copied along when I downloaded all the template files without me realizing it. I doubt using the old version is a strict requirement, but I suppose I'll find out :) Thanks all for your help.
pseudoinverse
Posts: 1
Joined: Mon Aug 05, 2024 10:03 pm

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

Post by pseudoinverse »

Thank you. Your answer helped me a lot when I had the same problem with a LaTeX template I had just downloaded from a Wiley journal's page.
nketiah edward
Posts: 1
Joined: Sun Jan 19, 2025 6:52 am

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

Post by nketiah edward »

Hi everyone,
I am having same issue as Ontic_Chimera with using the new template from Wiley journals (WileyNJDv5_Template), the error indicates that
*** This file requires `listings.sty' version 1.10c.
*** You have a serious problem, so I'm exiting...
Please I need help. Thank You
User avatar
Stefan Kottwitz
Site Admin
Posts: 10281
Joined: Mon Mar 10, 2008 9:44 pm

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

Post by Stefan Kottwitz »

Welcome to the forum!

I tested with that Wiley New Journal Design version 5 (NJD-v5) template on Overleaf, with a listings environment and the listings package, there was no error.

Probably the error is in your local LaTeX installation, I guess you need to update it. Perhaps post your .log file as attachment here. The "Attachments" link is below the text edit field, when writing a post.

Stefan
LaTeX.org admin
Post Reply