2

I'm trying to add a line under "Contents" that says "CHAPTER" and suppress the page number associated with the line (additionally with List of Figures). That is, the page should look like:

Contents

CHAPTER

  1. First Chapter...1

  2. Second Chapter....2

List of Figures

FIGURE

  1. fig x....1

  2. fig y....2

I've tried the following. I realize that using the section formatting will provide the page numbers as default. Is there a way to turn them off individually? Or, is there someway to have the Contents span two lines where the first is Contents and the second is CHAPTER? Or is there a way to add content to the toc and specify the format inline?

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\begin{document}
This is a test...

\tableofcontents{}

\addcontentsline{toc}{section}{CHAPTER}

\listoffigures


\addcontentsline{lof}{section}{FIGURE}

and this is after the table of contents

\section{This is a section}

One two three

\section{this is the second section}
\end{document}

1 Answer 1

1

You are on the right track, need to modify the addcontentsline to addtocontents as provided below.

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{lipsum}

\begin{document}

\tableofcontents{}

\addtocontents{toc}{\contentsline{section}{CHAPTER}{}}

\listoffigures

\addtocontents{lof}{\contentsline{section}{FIGURE}{}}

\section{First Section}

\lipsum

\begin{figure}
\caption{First Figure}
\end{figure}

\lipsum

\section{Second Section}

\lipsum

\begin{figure}
\caption{Second Figure}
\end{figure}

\lipsum

\end{document}

enter image description here


You must log in to answer this question.

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