Use the chngcntr package for avoiding the counter reset per chapter:
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}
It's very similar to @lockstep's answer here, and you can do it similarly regarding sections in classes which are not based on chapter, such as here also with LyX: How to control figure numbering in LyX.
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.
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}}
Best Answer
The
figure
environment uses thefigure
counter, which is defined to be reset when thechapter
is increased (e.g. each time a new chapter is begun.)This will also lead to use the chapter counter prefix (here Roman) in the figure counter output, i.e.
\thefigure
is\thechapter.\arabic{figure}
most likely.If this is not wanted, the
\thefigure
command must be redefined, say, toHere is minimal example: