Graphics, Figures & TablesCustom Table and Figure numbers

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
imdadullah

Custom Table and Figure numbers

Post by imdadullah »

I require the custom table number Like that

Table 4.1: Simple linear regression results
.
.
.
Table 4.2.1: dakdsdsfadfasdf

Similarly

Fig. 2.2.1 a: Scatter plot
Fig. 2.4: histogram

Hope get help soon

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

Custom Table and Figure numbers

Post by Stefan Kottwitz »

Hi imdadullah,

welcome to the board!

You could use the caption package, it offers many ways for customizing captions and their numbering and it's well documented. Just follow the link to find the manual.

Stefan
LaTeX.org admin
echo
Posts: 3
Joined: Wed Jun 15, 2011 10:27 am

Re: Custom Table and Figure numbers

Post by echo »

I have a different question though.
\caption package did give figure2.1 figure 2.2 etc. for figures under chapter 2.
Then to make all figures in the same document numbering continuously like figure 1, figure 2, ... , figure 15. even though figure 15 belongs to chapter 4.

I tried following code after surfing the internet.
\newcounter{figure}
\def\thefigure{\arabic{figure}}
\def\p@figure{Figure~}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{Figure~\thefigure}
\def\figure{\@isatablefalse\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}

However, during compile, I was given the error
! LaTex Error: command \c@figure already defined. Or name \end... illegal, see P.192 of the manual.

And the final result by ignoring this error is:
for each chapter, I have figure 1, figure 2, figure 3 on Chapter 1. I have figure 1, figure 2 on Chapter 4 rather than figure 14, figure 15.

Can anyone help??
Post Reply