0

I have a paper I am writing and have to use a specific template from my university. I have been able to get it to a format closer to what I am used to but I am having trouble where I cannot add the bibliography, and get a number of errors. I have been searching online on how to fix it and am yet to find a way so I am hoping someone can shed some light on the issue here.

I have added a condensed version of my tex file below to show what I am doing. I have tried adding the bibliography normally as is shown and tried beginning (\begin{thebibliography}) and ending (\end{thebibliography}) style also with both giving errors. For the normal implementation shown below of just adding a .bib file, I get various errors like.

+Package inputenc Error: Invalid UTF-8 byte "8E. \begin{thebibliography}{}
+Undefined control sequence. \bibitem{lee2019}
+Missing \endcsname inserted.

Can anyone help to fix this issue and add a bibliography. Thanks in advance

\documentclass[12pt]{report}
\usepackage{jgraduate2012}

\usepackage{graphicx} . . . \usepackage{natbib}

\begin{document} \maketitle

\begin{abstract} abstract \end{abstract}

\tableofcontents \listoffigures \listoftables

\include{section1}

\bibliographystyle{plain} \bibliography{reference.bib}

\end{document}

moewe
  • 175,683
  • You won't need to manually insert any \begin{thebibliography} or \end{thebibliography} with this setup. BibTeX automatically generates this environment in a temporary file you should normally not edit. Remove any such commands you may have manually added to your files. – moewe Nov 26 '20 at 07:01
  • The error message Invalid UTF-8 byte "8E. could be caused by a wrong file encoding in your .bib file (as shown your document expects UTF-8) or by using Unicode characters where BibTeX tries to apply certain string operations (cf. e.g. https://tex.stackexchange.com/q/571189/35864). We would be able to say more if you could isolate the problematic .bib entry and share it with us. – moewe Nov 26 '20 at 07:05
  • Similar things apply for the other errors: You need to identify which entry causes the trouble. Note that the error messages shown in the question are not the complete error messages that LaTeX would produce on a normal run. Those messages look like they might have been parsed by your editor. It is definitely worth a try to look at the raw .log file for more hints. Sometimes editors hide important bits of the error message. – moewe Nov 26 '20 at 07:07
  • Only tangentially related (and it definitely will not solve the problem), but the correct syntax for \bibliography{<bibliography file name>} is to give <bibliography file name> without the .bib file extension. So *\bibliography{reference.bib} should be \bibliography{reference}. Some older systems will not find the file correctly if you erroneously include the .bib file extension in your call to \bibliography. – moewe Nov 26 '20 at 07:09
  • I though that it may have to do with encoding in single entries previously so I tried removing all entries in the .bib file and adding single entries one at a time and it still gives the same errors. I have also tried using bibliography command with and without the .bib extension without any change. – user1365234 Nov 26 '20 at 07:25
  • If you add or remove .bib entries to create an MWE delete the .aux and .bbl file and recompile with a full LaTeX, BibTeX, LaTeX, LaTeX cycle. Otherwise old data may remain in the temporary files and still cause troubles. (As I said, dropping the .bib file extension is not the solution to your problem, but it should still be done.) – moewe Nov 26 '20 at 07:29

0 Answers0