# Toc, Lof and Lot with roman number in headline

II.   List of figures ..................... 3
III.  List of tables ...................... 4
1.    Section ............................. 5
1.1     Subsection ........................ 6
2.    Section ............................. 7
2.1     Subsection ........................ 8
IV.   Bibliography ........................ 9


All my section should have an arabic number and toc, lof, lot and bibliography should have an roman number in the headline. And I want although that the numbers in the headline appear in the table of contents.

MWE:

\documentclass[12pt, a4paper]{article}
\usepackage{tocloft}
\let \savenumberline \numberline
\def \numberline#1{\savenumberline{#1.}}¬

\begin{document}
\tableofcontents
\newpage

\listoffigures
\newpage

\listoftables
\newpage

\section{Section}
\subsection{Subsection}
\newpage

\section{Section}
\subsection{Subsection}
\newpage

\bibliography{sources}
\end{document}

• Welcome to TeX.SX! This is related: tex.stackexchange.com/questions/83628/… – egreg Aug 15 '15 at 15:27
• The answer from the linked question doesn't work for me. It's throws no error when compiling. But it doesn't change the headlines. Maybe cause its using KOMA? – Bene Aug 15 '15 at 15:39
• Of course it doesn't work; I was just suggesting a related question, that could help in solving your problem. Do you plan to have some usage for \section*? – egreg Aug 15 '15 at 15:42

Patch the commands producing the lists and the bibliography; I add also better ways for adding periods to the sectional numbers, both in the text and in the TOC.

\documentclass[12pt, a4paper]{article}
\usepackage[titles]{tocloft}
\usepackage{etoolbox}

\patchcmd{\listoffigures}
{\section*}
{\specialsection}
{}{}
\patchcmd{\listoftables}
{\section*}
{\specialsection}
{}{}
\patchcmd{\thebibliography}
{\section*}
{\specialsection}
{}{}
\newcounter{specialsection}
\setcounter{specialsection}{1}
\renewcommand{\thespecialsection}{\Roman{specialsection}}

\makeatletter
\renewcommand{\@seccntformat}[1]{%
}
\makeatother

\newcommand{\specialsection}[1]{%
\refstepcounter{specialsection}
}
\renewcommand{\cftsecaftersnum}{.}
\renewcommand{\cftsubsecaftersnum}{.}
\setlength{\cftsubsecindent}{0pt}
\AtBeginDocument{%
\setlength{\cftsecnumwidth}{2.5em}%
\setlength{\cftsubsecnumwidth}{2.5em}%
}

\begin{document}
\tableofcontents
\newpage

\listoffigures
\newpage

\listoftables
\newpage

\section{Section}
\subsection{Subsection}
\newpage

\section{Section}
\subsection{Subsection}
\newpage

\begin{thebibliography}{1}

\bibitem{X} Y

\end{thebibliography}

\end{document}


Note: the image has been produced using A5 paper, just for better showing the results.