Document Classes ⇒ [Solved]Listings and eis_msc_thesis.cls
[Solved]Listings and eis_msc_thesis.cls
Hi,
I am using the eis_msc_thesis.cls template to write my thesis.
The problem is, that I cannot use lstlistings in my code;
\begin{lstlisting}
for(;;)
{
printf("hi there.");
}
\end{lstlisting}
Error output is:
1:
! Missing number. treated as zero.
<to be read again> \relax
1.9 \begin{lstlisting}
2:
! Illegal unit of measure (pt inserted).
<to be read again> \relax
1.9 \begin{lstlisting}
any ideas?
I am using the eis_msc_thesis.cls template to write my thesis.
The problem is, that I cannot use lstlistings in my code;
\begin{lstlisting}
for(;;)
{
printf("hi there.");
}
\end{lstlisting}
Error output is:
1:
! Missing number. treated as zero.
<to be read again> \relax
1.9 \begin{lstlisting}
2:
! Illegal unit of measure (pt inserted).
<to be read again> \relax
1.9 \begin{lstlisting}
any ideas?
Last edited by Kai on Thu Nov 20, 2008 6:19 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
[Solved]Listings and eis_msc_thesis.cls
Please provide a complete minimal working example (MWE) and attach the class file (*.cls) to your next post or give at least a link where to find it. Specify the programming language you want typeset. First approaches are listed in the documentation of the listings package.
Best regards
Thorsten¹
Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
[Solved]Listings and eis_msc_thesis.cls
The .cls file can be found here:
http://rafb.net/p/ev58qt34.html
A minimal Latex file is:
The highlight language is C.
http://rafb.net/p/ev58qt34.html
A minimal Latex file is:
Code: Select all
\documentclass{eis_msc_thesis} % English
\usepackage{listings}
\lstset{
language=C % choose the language of the code}
}
\begin{document}
\begin{lstlisting}
for(;;)
{
printf("hi there.");
}
\end{lstlisting}
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
[Solved]Listings and eis_msc_thesis.cls
After some research I also found the class file on the homepage of the author [1]. It seems that the version provided there is the more relevant one. Furthermore I found the same request in the forum of LEd without any solution [2]. I suggest to contact the author because the error may be caused by some internals of the class file. Any issues can best be clarified by him.
[1] Johan Carlson
[2] LaTeX Editor Forum :: View topic - use of package listings doesnt work
[1] Johan Carlson
[2] LaTeX Editor Forum :: View topic - use of package listings doesnt work
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
[Solved]Listings and eis_msc_thesis.cls
The file eis_msc_thesis.cls contains the line
which is the cause of the issue. There are two solutions:
Code: Select all
\renewcommand{\belowcaptionskip}{12pt}
- Edit eis_msc_thesis.cls and replace that line by
Code: Select all
\setlength{\belowcaptionskip}{12pt}
- Add to the preamble of your document the lines
Code: Select all
\let\belowcaptionskip\undefined \newlength{\belowcaptionskip} \setlength{\belowcaptionskip}{12pt}
- the loading of amsfonts is superfluous, since amssymb is also loaded,
- \sc should be replaced by \scshape
- Since inputenc is loaded with latin1 option, Mac and Linux users are forced to use that enconding if they want to avoid a package option clash.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Re: Listings
Hej guys,
OK, So I'm the author of the thesis template. It's been used by our students for some time since I made it available for download at my web page.
Generally, I do not have the time to provide support to anyone other than our own students. Nevertheless, I'm thankful for any bug reports.
It seems to me like the issue in this thread was resolved, and I'll try to incorporate the fix into the next release.
Glad you liked it!
/Johan Carlson
OK, So I'm the author of the thesis template. It's been used by our students for some time since I made it available for download at my web page.
Generally, I do not have the time to provide support to anyone other than our own students. Nevertheless, I'm thankful for any bug reports.
It seems to me like the issue in this thread was resolved, and I'll try to incorporate the fix into the next release.
Glad you liked it!
/Johan Carlson
Re: Listings
For your info... The template has now been updated.
Go here: http://www.ltu.se/csee/misc/staff/johanc?l=en
Click on the link named "Course material, LaTeX templates, etc."
Cheers,
/JC
Go here: http://www.ltu.se/csee/misc/staff/johanc?l=en
Click on the link named "Course material, LaTeX templates, etc."
Cheers,
/JC
[Solved]Listings and eis_msc_thesis.cls
If I'm right, the new version only fixes the issue with \belowcaptionskip. It's a pity not to have taken the opportunity of updating the template a bit more, since it was so simple to make, in addition, the first two changes I suggested. Concerning the inputenc package, I don't find a good idea to load it with a fixed option (latin1 in this case), at least if the class is adressed to a more or less wide audience. Those wanting UTF or applemac encondings must modify the class file.ceke wrote:For your info... The template has now been updated.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Re: [Solved]Listings and eis_msc_thesis.cls
Well,
The template was written for Swedish students writing reports in either Swedish or English, hence the choice of hard-coding the latin1 of inputenc, since the users then don't need to worry about how this works.
That said, if anyone has other ideas on improvements of the class, please list here and I'll do periodic checks when I find the time to update.
/JC
The template was written for Swedish students writing reports in either Swedish or English, hence the choice of hard-coding the latin1 of inputenc, since the users then don't need to worry about how this works.
That said, if anyone has other ideas on improvements of the class, please list here and I'll do periodic checks when I find the time to update.
/JC