未定义控制序列 \tabhead

未定义控制序列 \tabhead

我正在使用来自https://www.latextemplates.com。我遇到了一个非常简单的问题,即未定义控制序列 \tabhead!有人能帮我解决这个问题吗?

我会非常高兴。

最好的,Pouya

\documentclass[11pt, oneside, english, singlespacing,liststotoc, toctotoc,headsepline,]{MastersDoctoralThesis}

\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 

\usepackage{mathpazo} 

\usepackage[backend=biber,style=authoryear,natbib=true]{biblatex}

\addbibresource{example.bib}

\usepackage[autostyle=true]{csquotes}
\geometry{
    paper=a4paper,
    inner=2.5cm,
    outer=3.8cm,
    bindingoffset=.5cm, 
    top=1.5cm,
    bottom=1.5cm, 
    %showframe,}

\begin{table}
\caption[Environmental sustainability constraints]{Four set of constraints as environmental sustainability which scale the human economic.}
\label{tab:activities}
\centering
\begin{tabular}{p{0.2\linewidth}p{0.7\linewidth}}
\toprule
\tabhead{Number} & \tabhead{Activity}\\
\midrule
1 \& 2 & The use of renewable and non-renewable resources on the source side\\
3 \& 4 & Pollution and Waste assimilation on the sink side\\
\bottomrule\\
\end{tabular}
\end{table}
\printbibliography[heading=bibintoc]


\end{document}  

答案1

从您提到的网站下载并解压thesis_1.zip。在文件Chapters/Chapter1.tex顶部附近,你会发现以下几行:

% Define some commands to keep the formatting separated from the content 
\newcommand{\keyword}[1]{\textbf{#1}}
\newcommand{\tabhead}[1]{\textbf{#1}}
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\file}[1]{\texttt{\bfseries#1}}
\newcommand{\option}[1]{\texttt{\itshape#1}}

这意味着:如果您想\tabhead在文档中使用该命令,请在序言中添加类似上面的一行:

\documentclass[...]{...}
...
\newcommand{\tabhead}[1]{\textbf{#1}}
...
\begin{document}

相关内容