0

According to the requirements of my school, the List of Tables and List of Figures must have an underlined Table and Page headings right above the columns of table of contents

A “Page” column heading that appears below the major heading, is aligned flush with the right margin, is underlined, and appears between the major heading and the first entry. Page numbers must appear under this column heading.

My code works and yields the desired output

enter image description here

However, I get the error 'Something's wrong--perhaps a missing \item. \addvspace {10\p@ }'.

\documentclass[11pt]{book}

\usepackage[TS1]{fontenc}
\usepackage{fontspec}
\setmainfont{Georgia}

\usepackage{hyperref}
\hypersetup{colorlinks=true}

\usepackage{gensymb}

\usepackage{caption}

\usepackage{ulem}
\usepackage{tocloft}

\begin{document}

\frontmatter
\pagestyle{plain}

\clearpage
\listoffigures

\clearpage
\listoftables

\clearpage
\tableofcontents

\mainmatter
\addtocontents{lot}{\protect \uline{Table} \hspace{\fill} \uline{Page}}
\addtocontents{lof}{\protect \uline{Figure} \hspace{\fill} \uline{Page}}


\chapter{Introduction}

\begin{figure}

    \caption{A Caption of a Figure}

\end{figure}

\begin{table}

    \caption{A Caption of a Table}

\end{table}

\end{document}
0

Move \addtocontents after the start of the first \chapter and load hyperref as last package

\documentclass[11pt]{book}

\usepackage[TS1]{fontenc}
\usepackage{fontspec}
\setmainfont{Georgia}




\usepackage{gensymb}

\usepackage{caption}

\usepackage{ulem}
\usepackage{tocloft}

\usepackage{hyperref}
\hypersetup{colorlinks=true}
\begin{document}

\frontmatter
\pagestyle{plain}

\clearpage
\listoffigures

\clearpage
\listoftables

\clearpage
\tableofcontents

\mainmatter






\chapter{Introduction}


\addtocontents{lot}{\protect \uline{Table} \hspace{\fill} \uline{Page}}
\addtocontents{lof}{\protect \uline{Figure} \hspace{\fill} \uline{Page}}
\begin{figure}

    \caption{A Caption of a Figure}

\end{figure}

\begin{table}

    \caption{A Caption of a Table}

\end{table}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.