Let's say we have this situation:
1. In a doc we're using unnumbered chapters, section etc. (\setcounter{secnumdepth}{-4})
2. We need tables to start with 1. But, if we use counters already defined, we get 0.1, 0.2 etc. Which is the best way to do this? Defining a new counter?
3. We're using caption and varioref packages.
The goal: To have tables started from 1 (no matter in which part of the doc first table appears) and to have them referenced in text as "Table 1" for the first one, "Table 2" for the second etc., and not "Table 0.1", "Table 0.2" etc.
Help, please...
Here's what I tried, but couldn't figure out how to solve referencing problem:
Code: Select all
\documentclass[12pt]{scrbook}
\usepackage{tabularx,booktabs,varioref}
\usepackage[font={footnotesize,rm,bf},textfont={md}]{caption}
\newcounter{tabela}
\setcounter{tabela}{0}
\DeclareCaptionFormat{nb}{TABELA\nobreakspace\refstepcounter{tabela}\thetabela:\nobreakspace#3}
\captionsetup[table]{format=nb}
\begin{document}
\begin{table}
\caption{Test table A}\label{tab:Test_table_A}
\begin{tabularx}{\linewidth}{XXX}
\toprule
A & B & C \\
D & E & F \\
\bottomrule
\end{tabularx}
\end{table}
Reference to the first table:~\vref{tab:Test_table_A}
\begin{table}
\caption{Test table B}\label{tab:Test_table_B}
\begin{tabularx}{\linewidth}{XXX}
\toprule
A & B & C \\
D & E & F \\
\bottomrule
\end{tabularx}
\end{table}
Reference to the second table:~\vref{tab:Test_table_B}
\end{document}