1

In my file, i have som tables, which are numbered incorrectly. What I mean by that: I have two tables in chapter 4 and one in chapter 5. They are numbered as 4.1, 4.2 and 5.1, while I want them to be 1, 2 and 3. MWE is here:

\documentclass{report}

\begin{document}

\section{one}

...

\section{four}

\begin{table}
\caption{Table one}
%a table
\end{table}

\begin{table}
\caption{Table two}
%a table
\end{table}

\section{five}

\begin{table}
\caption{Table three}
%a table
\end{table}

\end{document}

1 Answers1

0

The problem is that you're using report document class. The \section is not meant for reports (however, \chapter on the other hand is, so I suggest you use it instead). Just use article document class to fix the issue. Here, let me show you.

\documentclass{article}

\begin{document}

    \section{one}

    ...

    \section{four}

    \begin{table}
        \caption{Table one}
        %a table
    \end{table}

    \begin{table}
        \caption{Table two}
        %a table
    \end{table}

    \section{five}

    \begin{table}
        \caption{Table three}
        %a table
    \end{table}

\end{document}

The result is the following.

enter image description here

I wish you a nice day and plenty of future successes with LaTeX.

God bless
  • 1,767
  • Why are \sections not meant for reports? – Werner Mar 17 '17 at 19:27
  • I found this claim in The Not So Short Introduction to LaTeX2ε (https://tobi.oetiker.ch/lshort/lshort.pdf). I can't tell the restrictions of mixing the document class and a command (since I only program in Java, Python and C++ I can't use Lua for my research on the topic), but it might be connected to the age of certain aspects of LaTeX (kind of similar to some color packages that caused plenty of errors when compiled in LaTeX2ε, as they were outdated). Furthermore, I tried every "trick" I knew, I used TeXnician's suggestion (which didn't work, at least for me), but without success. – God bless Mar 17 '17 at 20:01