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.

  • Welcome to TeX.SE. Please post a minimal document that has this issue. According to the class file the thebibliography environment is defined – user31729 Feb 26 '17 at 1:18
  • 2
    Oh my, the uclathes.cls file apparently dates back to 1995... And the link to other question concerns a totally different class ;-) – user31729 Feb 26 '17 at 1: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 1:26
  • Your minimal code works for me -- there's no error message – user31729 Feb 26 '17 at 1: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 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.