1

I have a university thesis class file at https://github.com/uclathes/uclathes

When I'm trying to use the natbib package, compiling error with pdflatex shows

LaTeX Error: Environment thebibliography undefined.
l.1063 \renewenvironment{thebibliography}[1]{%

Minimum code:

\documentclass[PhD]{uclathes}
\usepackage{natbib}
\begin{document}
Test 1-2-3 \citet{austin2002simplescalar}
\bibliography{bib_references}
\bibliographystyle {plainnat}
\end{document}

bib_references.bib file

@article{austin2002simplescalar,
  title={SimpleScalar: An infrastructure for computer system modeling},
  author={Austin, Todd and Larson, Eric and Ernst, Dan},
  journal={Computer},
  volume={35},
  number={2},
  pages={59--67},
  year={2002},
  publisher={IEEE}
}

I found a similar question here Conflict between TikZ and university thesis class file

I tried to change the variable name thebibliography defined in the thesis class file to be a different one, but the error still shows.

Ruizhi
  • 11
  • Welcome to TeX.SE. Please post a minimal document that has this issue. According to the class file the thebibliography environment is defined –  Feb 26 '17 at 01:18
  • 2
    Oh my, the uclathes.cls file apparently dates back to 1995... And the link to other question concerns a totally different class ;-) –  Feb 26 '17 at 01:22
  • @ChristianHupfer Unfortunately it is... If I'm not using natbib, but the most common \cite, everything works fine. It is even good when I'm using biblatex, but not natbib – Ruizhi Feb 26 '17 at 01:26
  • Your minimal code works for me -- there's no error message –  Feb 26 '17 at 01:30
  • @ChristianHupfer I should include a little more. Now when I compile with pdflatex+bibtex+pdflatex+pdflatex, the error shows at the second 'pdflatex' – Ruizhi Feb 26 '17 at 01:43
  • Yes, it throws an error \newblock being undefined. –  Feb 26 '17 at 01:44
  • @ChristianHupfer I'm compiling with Texlive, so maybe the error message is a little different from yours. I noticed that \newblock is defined both in natbib.sty and uclathes.cls. – Ruizhi Feb 26 '17 at 01:48
  • I am using TL 2016 on Linux, with daily updates –  Feb 26 '17 at 01:50

0 Answers0