1

I need to put tables of contents on the beginning of the document and also at the last page. When I am using \tableofcontents second time it appears empty.

I want to achieve:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Arial}

\begin{document}

%first toc
\tableofcontents

\section{Test}
test test

\section{Test 2}
test test

\newpage

%second toc - generates empty
\tableofcontents

\end{document}

How can I achieve the same toc on the last page?

KersouMan
  • 1,850
  • 3
  • 13
  • 15
Zar
  • 13

2 Answers2

0

You could for example use the shorttoc package as follows:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Arial}

\usepackage{shorttoc}
\begin{document}

%first toc
\shorttoc{Contents}{2}

\section{Test}
test test

\section{Test 2}
test test

\newpage

%second toc
\tableofcontents

\end{document}
leandriis
  • 62,593
0

With the memoir class's article option.

\documentclass[article]{memoir}

\usepackage{fontspec}
\setmainfont{Arial}

\begin{document}

%first toc
\tableofcontents

%\section{Test}
\chapter{Test} Use \chapter instead of \section
test test

%\section{Test 2}
\chapter{Test 2}
test test

\newpage

%second toc
\tableofcontents

\end{document}
Peter Wilson
  • 28,066