[Tex/LaTex] Changing enumeration of divisions to roman numbers

numbering

Please consider the following MWE. By default some lists (list of figures, list of tables) are numbered with arabic numbers in scrbook and some not (bibliography, index). How can I make LaTeX to use for these lists roman numbers instead of arabic numbers and arabic numbering only for the divisions chapter, section etc.

Example

I List of figures

II List of tables

1.Chapter

1.1 Section

2.Chapter

2.1 Section

III Bibliography

IV Index

EIDT

I know that for the numbering of pages you can switch from \pagenumbering{roman} to \pagenumbering{arabic}. Maybe there is a similar approach to my problem.

MWE

\documentclass[liststotocnumbered]{scrbook}

\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{makeidx}
\makeindex

\begin{document}

\tableofcontents
\listoffigures
\listoftables

\chapter{First chapter}

\section{Section}

    \begin{figure}[htbp]
       \centering
       \includegraphics{example.png} 
       \caption{example caption}
       \label{fig:example1}
    \end{figure}
    \index{Figure!Example1}

\subsection{Subsection}

    \begin{table}[htbp]
       \centering
       \begin{tabular}{@{} lcr @{}} 
          \toprule
          \multicolumn{2}{c}{Item} \\
          \cmidrule(r){1-2} 
          Animal    & Description & Price (\$)\\
          \midrule
          Gnat      & per gram & 13.65 \\
                    & each     &  0.01 \\
          Gnu       & stuffed  & 92.50 \\
          Emu       & stuffed  & 33.33 \\
          Armadillo & frozen   &  8.99 \\
          \bottomrule
       \end{tabular}
       \caption{Tab. 1}
       \label{tab:booktabs1}
    \end{table}
    \index{Table!Example1}

\chapter{Second chapter}
\section{Section}

    \begin{figure}[htbp]
       \centering
       \includegraphics{example.png} 
       \caption{example caption}
       \label{fig:example2}
    \end{figure}
    \index{Figure!Example2}

\subsection{Subsection}

    \begin{table}[htbp]
       \centering
       \begin{tabular}{@{} lcr @{}} 
          \toprule
          \multicolumn{2}{c}{Item} \\
          \cmidrule(r){1-2} 
          Animal    & Description & Price (\$)\\
          \midrule
          Gnat      & per gram & 13.65 \\
                    & each     &  0.01 \\
          Gnu       & stuffed  & 92.50 \\
          Emu       & stuffed  & 33.33 \\
          Armadillo & frozen   &  8.99 \\
          \bottomrule
       \end{tabular}
       \caption{Tab. 2}
       \label{tab:booktabs2}
    \end{table}
    \index{Table!Example2}

\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{BibliographyFile}

\renewcommand{\indexname}{Index}
\addcontentsline{toc}{chapter}{Index}
\printindex

\end{document}

Best Answer

You can change the meaning of \chapter* that's issued for the special chapter:

\documentclass{scrbook}

\usepackage[demo]{graphicx}
\usepackage{booktabs}
\usepackage{imakeidx}
\makeindex

\makeatletter
\newif\ifintoc
\def\@schapter#1{%
  \if@twocolumn
    \if@at@twocolumn
      \@makeschapterhead{#1}%
    \else
      \@topnewpage[\@makeschapterhead{#1}]%
    \fi
  \else
    \@makeschapterhead{#1}\@afterheading
  \fi
  \ifintoc
    \stepcounter{specialchapter}%
    \addcontentsline{toc}{chapter}{\protect\numberline{\thespecialchapter}#1}%
  \fi
}
\makeatother
\newcounter{specialchapter}
\renewcommand{\thespecialchapter}{\Roman{specialchapter}}

\begin{document}

\intocfalse
\tableofcontents
\intoctrue

\listoffigures
\listoftables

\chapter{First chapter}

\section{Section}

    \begin{figure}[htbp]
       \centering
       \includegraphics{example.png} 
       \caption{example caption}
       \label{fig:example1}
    \end{figure}
    \index{Figure!Example1}

\subsection{Subsection}

    \begin{table}[htbp]
       \centering
       \begin{tabular}{@{} lcr @{}} 
          \toprule
          \multicolumn{2}{c}{Item} \\
          \cmidrule(r){1-2} 
          Animal    & Description & Price (\$)\\
          \midrule
          Gnat      & per gram & 13.65 \\
                    & each     &  0.01 \\
          Gnu       & stuffed  & 92.50 \\
          Emu       & stuffed  & 33.33 \\
          Armadillo & frozen   &  8.99 \\
          \bottomrule
       \end{tabular}
       \caption{Tab. 1}
       \label{tab:booktabs1}
    \end{table}
    \index{Table!Example1}

\chapter{Second chapter}
\section{Section}

    \begin{figure}[htbp]
       \centering
       \includegraphics{example.png} 
       \caption{example caption}
       \label{fig:example2}
    \end{figure}
    \index{Figure!Example2}

\subsection{Subsection}

    \begin{table}[htbp]
       \centering
       \begin{tabular}{@{} lcr @{}} 
          \toprule
          \multicolumn{2}{c}{Item} \\
          \cmidrule(r){1-2} 
          Animal    & Description & Price (\$)\\
          \midrule
          Gnat      & per gram & 13.65 \\
                    & each     &  0.01 \\
          Gnu       & stuffed  & 92.50 \\
          Emu       & stuffed  & 33.33 \\
          Armadillo & frozen   &  8.99 \\
          \bottomrule
       \end{tabular}
       \caption{Tab. 2}
       \label{tab:booktabs2}
    \end{table}
    \index{Table!Example2}

\bibliography{BibliographyFile}

\begin{thebibliography}{1}
\bibitem x
\end{thebibliography}

\renewcommand{\indexname}{Index}
\printindex

\end{document}

I've added a mock bibliography just to show the result.

enter image description here


The \listof... commands and the bibliography/index environments issue \chapter* for their working and this command is defined not to add an entry in the table of contents. So I redefine it (more precisely the \@schapter command) to add one and in the form

<Roman numeral> <Title> .... <page>

where the numeral is obtained from a new counter that is stepped. However, since we don't want that the table of contents does the same, this part of the code is executed only if a conditional (\ifintoc) is true. The conditional is set to false before \tableofcontents and to true just after it. This last part might be made automatic, but I believe that it will be a "just once" application, so it shouldn't be a problem.

If you find that something you need to be crazy numbered isn't, just add a line

\addcontentsline{toc}{chapter}{\protect\numberline{\thespecialchapter}Foo}

in a suitable place as you did for the bibliography.


In order to get the number also in the headers (the usefulness of which I'm even less convinced than of putting the numbers in the table of contents), you can modify the definitions as follows (just the needed part):

\makeatletter
\newif\ifintoc
\def\@schapter#1{%
  \if@twocolumn
    \if@at@twocolumn
      \@makeschapterhead{#1}%
    \else
      \@topnewpage[\@makeschapterhead{#1}]%
    \fi
  \else
    \@makeschapterhead{#1}\@afterheading
  \fi
  \ifintoc
    \let\@mkboth\@gobbletwo
    \stepcounter{specialchapter}%
    \addcontentsline{toc}{chapter}{\protect\numberline{\thespecialchapter}#1}%
    \markboth{\MakeMarkcase{\thespecialchapter\ #1}}{\MakeMarkcase{\thespecialchapter\ #1}}
  \fi}
\makeatother
\newcounter{specialchapter}
\renewcommand{\thespecialchapter}{\Roman{specialchapter}}

If you want also that the titles bear the number, then something like the following should do.

\makeatletter
\newif\ifintoc
\def\@schapter#1{%
  \ifintoc
    \stepcounter{specialchapter}%
  \fi
  \if@twocolumn
    \if@at@twocolumn
      \@makeschapterhead{\ifintoc\thespecialchapter\ \fi#1}%
    \else
      \@topnewpage[\@makeschapterhead{\ifintoc\thespecialchapter\ \fi#1}]%
    \fi
  \else
    \@makeschapterhead{\ifintoc\thespecialchapter\ \fi#1}\@afterheading
  \fi
  \ifintoc
    \let\@mkboth\@gobbletwo
    \addcontentsline{toc}{chapter}{\protect\numberline{\thespecialchapter}#1}%
    \markboth{\MakeMarkcase{\thespecialchapter\ #1}}{\MakeMarkcase{\thespecialchapter\ #1}}
  \fi}
\makeatother
\newcounter{specialchapter}
\renewcommand{\thespecialchapter}{\Roman{specialchapter}}