表列表在第二次运行时挂起

表列表在第二次运行时挂起

我正在使用我所在大学的模板撰写论文,该模板位于:http://www.grad.ucalgary.ca/current/thesis/templates/latex-template(如同http://www.github.com/markwgirard/ucalgarythesis)。它在第一次运行时显示表格,但当我想获取表格列表时,它在第二次运行时挂起了。这是一个只有两个表格的示例。

\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}

我应该为我的论文准备一份表格清单,而且我必须这样做useucalgthes1。我非常感谢任何帮助!

谢谢

答案1

这是使用链接类的文档的清理版本:

我改变了一些事情。

  • 添加了caption格式化字幕的包。不要将格式化命令直接放入您的\captions
  • 替换mathptmxnewtxtextnewtxmath(更新)
  • 添加\usepackage[T1]{fontenc}以获得正确的字体编码
  • 移至\usepackage{hyperref}最后加载(通常是个好主意)
  • 已移除setspace(由类加载)
  • 添加了\captionsetup使字幕居中的命令

我还将每个包放入其自己的\usepackage命令中。这可让您更轻松地添加包选项,并且通常可让您更清楚地了解您正在使用的包。

我还从表格中删除了[H]规范。虽然有时会用到,但通常不需要;TeX 会为您放置表格和图形。如果您需要将某些东西放在特定位置,请不要使用tablefigure环境,而是使用\captionof添加标题。

您可能还想使用该siunitx包来格式化包含数字数据的表格。它有许多工具可以正确格式化表格中的数字。

% !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}

相关内容