1

I am using my university's template for my thesis available at: http://www.grad.ucalgary.ca/current/thesis/templates/latex-template (similar to http://www.github.com/markwgirard/ucalgarythesis). It shows the tables on the first run, but it hangs on the second run when I want to get the list of tables. Here is an example with only two tables.

\documentclass[12pt]{ucalgthes1}% similar to github.com/markwgirard/ucalgarythesis
\usepackage[letterpaper,top=1in, bottom= 1in, left= 1in, right= 1in]{geometry}
\usepackage{amsmath, tikz, comment, graphicx, float, tabularx}
\usepackage{booktabs, makecell, rotating, lipsum, setspace, mathptmx, hyperref, changepage}
\usepackage[flushleft]{threeparttable}
\usepackage[utf8]{inputenc}



\begin{document}


\begin{singlespace}
\newpage
\phantomsection
\renewcommand{\listtablename}{List of Tables}
  \cleardoublepage\phantomsection
  \addcontentsline{toc}{chapter}{\listtablename}  
\listoftables
\pagestyle{plain}
\newpage
\end{singlespace}



\begin{table}[H]
\centering
\footnotesize
\caption{ \centering Change in Yearly Average Pollution Because of the Progressive Income Tax (1980-2015) \label{fittedvalues}}
%\hspace*{1cm}
 \begin{tabular}{lccccc}
\multicolumn{6}{c}{\textbf{Non-Revenue Neutral Case}}
  \\
\midrule
\midrule
\textbf{Pollutant} &
  \textbf{$PM_{10}$} &
  \textbf{$VOC$} &
  \textbf{$SO_{2}$} &
  \textbf{$NO_{x}$} &
  \textbf{$CO$}
  \\
\midrule
\textbf{Change in pollution (pounds)} &
  -27,564 &
  -48,140&
  -218,721 &
  -137,049&
  -113,296
  \\
\multicolumn{6}{c}{\textbf{Using TAXSIM - Revenue Neutral Case}}
  \\
\midrule
\midrule
\textbf{Pollutant} &
  \textbf{$PM_{10}$} &
  \textbf{$VOC$} &
  \textbf{$SO_{2}$} &
  \textbf{$NO_{x}$} &
  \textbf{$CO$}
  \\
\midrule
\textbf{Change in pollution (pounds)} &
    113,244 &
  205,341 &
  989,995 &
  623,530 &
  521,821
  \\

\bottomrule
\end{tabular}%
\vspace{2mm}
 \raggedright \\

\end{table}


\begin{table}[H]
\caption{Estimation Results For $PM_{10}$-(1980-2015) \label{tab:traffic}}
\scriptsize
\addtolength{\tabcolsep}{0pt}
\hspace{-2in}
\begin{center}
\begin{threeparttable}
\begin{tabular}{l*{2}{cc}}
\hline
                &\multicolumn{2}{c}{OLS}          \\\cmidrule(lr){2-3}
                &(1)             &(2)             \\
                &\multicolumn{1}{c}{income after tax}&\multicolumn{1}{c}{income before tax}\\
\hline
Income before tax ($ 10000)&       0.3518***&                \\
                &     (0.0068)   &                \\

\hline
\end{tabular}

\end{threeparttable}
\end{center}
\addtolength{\tabcolsep}{-0pt}
\label{pm10}
\end{table}


\end{document}

I should have a list of tables for my thesis and I must useucalgthes1 . I really appreciate any help!

Thanks

5
  • By "hangs out" do you mean stops with errors? Your sample code doesn't compile for various reasons.
    – Alan Munn
    Commented Mar 26, 2018 at 14:27
  • Yes, I mean it does not compile after the first time.
    – Hossein
    Commented Mar 26, 2018 at 14:35
  • 1
    Unfortunately this class is a disaster.
    – Alan Munn
    Commented Mar 26, 2018 at 14:44
  • I would abandon this class completely and use the github linked version instead. You don't have to use the class, you just have to format your thesis according to the university guidelines (which seem fairly straightforward.) You will save yourself time fixing any small issues with the linked class than the major issues you will encounter using the "official" class.
    – Alan Munn
    Commented Mar 26, 2018 at 15:03
  • Thanks @Alan Munn, but I have the same problem when I change the document class toucalgarythesisin the above example.
    – Hossein
    Commented Mar 26, 2018 at 15:20

1 Answer 1

1

Here's a cleaned up version of your document using the linked class:

I've changed some things.

  • added the caption package to format captions. Don't put formatting commands directly into your \captions
  • replaced mathptmx with newtxtext and newtxmath (more up-to-date)
  • added \usepackage[T1]{fontenc} to get the font encoding correct
  • moved \usepackage{hyperref} to load last (usually a good idea)
  • removed setspace (loaded by the class)
  • added a \captionsetup command to centre captions

I've also put each package into its own \usepackage command. This allows you to add package options more easily, and generally makes it clearer what packages you are using.

I've also removed the [H] specification from your tables. Although there are sometimes uses for this, it's generally not required; TeX will place your tables and figures for you. If you need to place something at a specific place, don't use a table or figure environment, and use \captionof to add the caption.

You might also want to use the siunitx package for formatting tables with numerical data. It has numerous facilities to format numbers correctly in tables.

% !TEX TS-program = pdfLaTeX
\documentclass[12pt]{ucalgarythesis}% from to github.com/markwgirard/ucalgarythesis
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} % added
\usepackage{newtxtext,newtxmath} % replacing mathptmx
\usepackage{caption} % for formatting captions properly
\usepackage[flushleft]{threeparttable}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{comment}
\usepackage{graphicx}
\usepackage{float}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{rotating}
\usepackage{lipsum}
\usepackage{changepage}
\usepackage{hyperref} % should be loaded last usually

\captionsetup{justification=centering}


\begin{document}


\begin{singlespace}
\tableofcontents
\listoftables
\phantomsection
\addcontentsline{toc}{chapter}{\listtablename}
\end{singlespace}
\newpage

\begin{table}[htpb]
\centering
\footnotesize
\caption{ Change in Yearly Average Pollution Because of the Progressive Income Tax (1980-2015) \label{fittedvalues}}
%\hspace*{1cm}
 \begin{tabular}{lccccc}
\multicolumn{6}{c}{\textbf{Non-Revenue Neutral Case}}
  \\
\midrule
\midrule
\textbf{Pollutant} &
  \textbf{$PM_{10}$} &
  \textbf{$VOC$} &
  \textbf{$SO_{2}$} &
  \textbf{$NO_{x}$} &
  \textbf{$CO$}
  \\
\midrule
\textbf{Change in pollution (pounds)} &
  -27,564 &
  -48,140&
  -218,721 &
  -137,049&
  -113,296
  \\
\multicolumn{6}{c}{\textbf{Using TAXSIM - Revenue Neutral Case}}
  \\
\midrule
\midrule
\textbf{Pollutant} &
  \textbf{$PM_{10}$} &
  \textbf{$VOC$} &
  \textbf{$SO_{2}$} &
  \textbf{$NO_{x}$} &
  \textbf{$CO$}
  \\
\midrule
\textbf{Change in pollution (pounds)} &
    113,244 &
  205,341 &
  989,995 &
  623,530 &
  521,821
  \\
\bottomrule
\end{tabular}%
\end{table}

%\vspace{2mm}
%\raggedright

\begin{table}[htpb]
\caption{Estimation Results For $PM_{10}$-(1980-2015) \label{tab:traffic}}
\scriptsize
\addtolength{\tabcolsep}{0pt}
\hspace{-2in}
\begin{center}
\begin{threeparttable}
\begin{tabular}{l*{2}{cc}}
\hline
                &\multicolumn{2}{c}{OLS}          \\\cmidrule(lr){2-3}
                &(1)             &(2)             \\
                &\multicolumn{1}{c}{income after tax}&\multicolumn{1}{c}{income before tax}\\
\hline
Income before tax (\$ 10000)&       0.3518***&                \\
                &     (0.0068)   &                \\

\hline
\end{tabular}

\end{threeparttable}
\end{center}
\addtolength{\tabcolsep}{-0pt}
\label{pm10}
\end{table}


\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .