I'm writing my thesis using Latex, in my thesis I don't have any table, however list of table title appears. How to exclude it? and suggestions?
In the file kfupm_thesis.cls
, search for the lines
\addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF TABLES}{\pageref{ListofTables}}}
\label{ListofTables}
\listoftables
\eject
and comment them out.
% \addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF TABLES}{\pageref{ListofTables}}}
% \label{ListofTables}
% \listoftables
% \eject
Don't forget to run latex twice for the changes to show their effect.
-
Thank you. It runs fine Since you work in it, can you solve an other problem? – Ahmed Oct 24 '16 at 8:55
-
-
@Ahmed Feel free to ask another question on this platform. I'm sure that someone here will help, maybe me, whoever has the time and expertise. But please don't ask follow-up questions in the comments. It is difficult to provide all the information for describing the problem. – gernot says Reinstate Monica Oct 24 '16 at 8:57
-
-
1@Ahmed Please ask a separate question and provide enough information. At the moment I don't know to which abbreviation you refer. In your new question, provide the source code of a complete small document (starting with
\documentclass
and ending with\end{document}
) that illustrates the problem, and describe what's wrong and how you expect it to behave. – gernot says Reinstate Monica Oct 24 '16 at 9:50
<rant>
The code in the definition of preamble
is hilariously horrible. The instructions are similarly absurd, suggesting \include
in the preamble for the macro files.
</rant>
You can avoid modifying the class file by doing
\documentclass[ms, 12pt]{kfupm_thesis}
%% For PhD Thesis enable the next line
%\documentclass[phd, 12pt]{kfupm_thesis}
\usepackage{etoolbox}
\patchcmd{\preamble}{\addtocontents}{\maybeaddtocontents}{}{}
\patchcmd{\preamble}{\addtocontents}{\maybeaddtocontents}{}{}
\long\def\maybeaddtocontents#1\label#2#3#4\eject{%
\ifx#3\listoftables
% suppress
\else
% list of figures is OK
\addtocontents#1\label{#2}#3#4\eject
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The following file defines margins and text width
\input{def} %%%% NOT \include
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The following file defines the settings for including List of Abbreviations
\input{set_loa} %%% NOT \include
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The following file defines the inclusion of packages and some other required commands
\input{setting} %%% NOT \include
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
After \documentclass[...]{kfupm_thesis}
add
\newenvironment{preamble}{%
\setstretch{1.5}
%\thispagestyle{plain}
%\pagenumbering{roman}
\eject
\tableofcontents
\eject
\addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF TABLES}{\pageref{ListofTables}}}
\label{ListofTables}
\listoftables
\eject
%\addtocontents{toc}{\contentsline {chapter}{\numberline {}LIST OF FIGURES}{\pageref{ListofFigures}}}
\label{ListofFigures}
\listoffigures
\eject
\setstretch{2}
}{%
\eject
\pagestyle{plain}
\pagenumbering{arabic}
\eject
}
Use:
\documentclass[ms, 12pt]{kfupm_thesis}
\let\listoftables\relax
[...]
-
Not sufficient. The
\addcontents
command still adds a line to the toc. – gernot says Reinstate Monica Oct 24 '16 at 8:48
\listoftables
in the document, if so delete it. If not then a minimal working example (MWE) for your problem may be needed. In particular, which class are you using (can you link to where it can be found online if it's non-standard/not on CTAN). – Dai Bowen Oct 24 '16 at 8:27