1

I am using the ociamthesis.cls (https://www.maths.ox.ac.uk/system/files/legacy/2894/ociamthesis.cls) to write my thesis. The ociamthesismain.tex code reads something like this:

\documentclass[12pt]{ociamthesis} 
\let\olddegree\degree  % Store \degree in \olddegree
\let\degree\relax      % Remove definition of \degree
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{subfigure}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{algpseudocode} 
\usepackage{textcomp}
\usepackage{gensymb}
\let\degreesymb\degree % Store new \degree in \degreesymb
\let\degree\olddegree  % Restore \degree to its old definition \olddegree
\usepackage{caption}
\usepackage[ruled,linesnumbered]{algorithm2e}
\newenvironment{program}[1][htb]
{\renewcommand{\algorithmcfname}{Program}% Update algorithm name
    \begin{algorithm}[#1]%
    }{\end{algorithm}}
\usepackage{commath}
\usepackage{fourier} 
\usepackage{array}
\usepackage{makecell}
\usepackage{tikz} % this package is for tick marks
\def\checkmark{\tikz\fill[scale=0.4](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;}
\def\scalecheck{\resizebox{\widthof{\checkmark}*\ratio{\widthof{x}}{\widthof{\normalsize x}}}{!}{\checkmark}}% definition for bigger checkmark
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}% % check 
\newcommand{\xmark}{\ding{55}}% % cross
%for fixed width table-->
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
%<-- for fixed width table array
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}
\hyphenation{op-tical net-works semi-conduc-tor}
\usepackage{xr}
\usepackage{hyperref}
%\externaldocument{chapter1}

\title{Thesis title goes here} \author{Somdip Dey} %your name \college{School of Computer Science and Electronic Engineering} %your college %\renewcommand{\submittedtext}{change the default text here if needed} \degree{Doctor of Philosophy} %the degree \degreedate{December, 2020} %the degree date

%end the preamble and start the document \begin{document}

%this baselineskip gives sufficient line spacing for an examiner to easily %markup the thesis with comments \baselineskip=18pt plus1pt

%set the number of sectioning levels that get number and appear in the contents \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3}

\maketitle % create a title page from the preamble info %\include{dedication} % include a dedication.tex file % Commented by SOmdip Dey %\include{acknowlegements} % include an acknowledgements.tex file % Commented by SOmdip Dey

\include{abstract} % include the abstract

\begin{romanpages} % start roman page numbering \tableofcontents % generate and include a table of contents \listoffigures % generate and include a list of figures \end{romanpages} % end roman page numbering

%now include the files of latex for each of the chapters etc \include{intro} \include{background} \include{prologue1} \include{chapter1} \include{prologue2} \include{chapter2} \include{prologue3} \include{chapter3} \include{chapter4} %\include{conclusions}

%now enable appendix numbering format and include any appendices%Commented by SOmdip %\appendix %\include{appendix1} %\include{appendix2}

%next line adds the Bibliography to the contents page \addcontentsline{toc}{chapter}{Bibliography} %uncomment next line to change bibliography name to references %\renewcommand{\bibname}{References} \bibliography{research} %use a bibtex bibliography file refs.bib \bibliographystyle{plain} %use the plain bibliography style

\end{document}

When I am trying to build the Latex using TexStudio I am getting the following errors:

File, Type, Line, Error

ociamthesismain.tex, error, line 301, Undefined control sequence. \removelatexerror

ociamthesismain.tex, error, line 319, Undefined control sequence. \removelatexerror

ociamthesismain.tex, error, line 347, Undefined control sequence. \removelatexerror

ociamthesismain.tex, error, line 374, Undefined control sequence. \removelatexerror

In the Log File of TeXstudio the specific error is as follows:

[40] ! Undefined control sequence. l.301 \removelatexerror The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

Usually when you double click on the error it takes you to the error in the file. Howeverover, for the aforementioned errors when I am clicking on it, it doesn't direct me to where the exact error is. Moreover, the ociamthesismain.tex file doesn't have so many lines of code and hence errors happening in lines 301, 319, 347, 374 are not in the actual ociamthesismain.tex file. Additionally, because of these errors (I guess) the bibliography will also not regenerate and in all citations only [?] is showing.

So, my questions are as follows:

  1. How to debug the error to find out where the issue is happening?
  2. How to fix the error?
  3. How to build the bibliography (after the errors are resolved, I guess)?
  • 1
    \degreedate{December, 2020} --> Good luck with that! :) (just a silly joke) – Dr. Manuel Kuehner Nov 28 '20 at 00:42
  • 1
    Hi. I suggest searching all your files for the string "removelatexerror". It might be part of TeXstudio, or it may have been inserted into your files by some part of your file processing. I'm not familiar with it, but see an instance on pastebin. – Donald Arseneau Nov 28 '20 at 00:59
  • @Dr.ManuelKuehner yeah, I definitely need that! :D – Somdip Dey Nov 28 '20 at 01:16
  • \removelatexerror got superseded by \getridofexpl3. ;-) (Just kidding. ;-) –  Nov 28 '20 at 01:18
  • @DonaldArseneau what do u mean by pastebin (or instance of pastebin)? My apologies, i don't really have an in-depth knowledge of Latex that much. – Somdip Dey Nov 28 '20 at 01:20
  • I did a web search as well as a file search, and only found https://pastebin.com/Y7RjAV9h (pastbin is a file-sharing system). – Donald Arseneau Nov 28 '20 at 02:27
  • Your thesis is loading many files. Find out by looking in the log, which one is meant when the line numbers are given. – Ulrike Fischer Nov 28 '20 at 08:28
  • 1
    The origin of \removelatexerror seems to be this question!? https://tex.stackexchange.com/questions/82271/multiple-algorithm2e-algorithms-in-two-column-documents/132284 –  Nov 28 '20 at 10:11
  • @UlrikeFischer in the log file this is the specific error: The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), typeI' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. – Somdip Dey Nov 28 '20 at 16:04
  • Your code runs without problems for me, except for the missing oxlogo. – campa Nov 28 '20 at 16:26

1 Answers1

1

Steps I took to debug and resolve the issue:

  1. Open up each chapter/tex file within the main tex file (ociamthesismain.tex) in an editor that shows line numbers. Since, TeXstudio doesn't show line number, I used Atom text editor since it shows line numbers within each .tex file.
  2. Go to the line numbers where the error is happening, as shown in the log/Log File while building the tex file in TeXstudio. For me the line numbers with errors were: 301, 319, 347, 374.
  3. Try to find out what's wrong/different in these line numbers and rectify the error.

For me the issue was, one of the chapters (.tex) was majorly copied from one of my published articles, which was using a command, \removelatexerror. However, in this thesis tex I didn't need that command to get rid/suppress the errors if there's any. Once I removed \removelatexerror from the aforementioned lines and compiled everything was building properly along with the bibliography.