LaTeX forum ⇒ GeneralCompile 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

Postby Ontic_Chimera » Sat Dec 29, 2018 6:56 am

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

User avatar
Johannes_B
Site Moderator
Posts: 3970
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Dec 29, 2018 8:14 am

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

Postby Ontic_Chimera » Sat Dec 29, 2018 8:33 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
(3.25 KiB) Downloaded 40 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: 3970
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Dec 29, 2018 12:07 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

Postby Ontic_Chimera » Sat Dec 29, 2018 10:29 pm

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 28 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 9329
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Dec 30, 2018 3:35 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
Site admin

Ontic_Chimera
Posts: 4
Joined: Sat Dec 29, 2018 6:40 am

Postby Ontic_Chimera » Sun Dec 30, 2018 9:31 pm

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.


Return to “General”

Who is online

Users browsing this forum: No registered users and 5 guests