# [texhax] Modifying number of the first table/figure

Thu Jun 21 16:28:42 CEST 2012

On Thu, Jun 21, 2012 at 10:27:58AM -0300, Darío wrote:

> Hi list, my questions is whether possible numbering the first table or
> figure of a section or subsub...., because when compiling, the first
> table appears as number one, ie Table 1, and not as for example 3.4.1
> (where 3 is a section and 4 the subsection and 1 the number of table
> or figure).

\documentclass{article}

\makeatletter
\renewcommand*{\thetable}{\thesubsection.\arabic{table}}
\makeatother

\begin{document}
\section{First section}
\section{Second section}
\subsection{Subsection}
\begin{table}
\caption{Table caption in 2.1}
\end{table}
\section{Third section}
\subsection{First subsection}
\subsection{Second subsection}
\subsection{Third subsection}
\subsection{Fourth subsection}
\begin{table}
\caption{Table caption in 3.4}
\end{table}
\end{document}

If package amsmath is loaded, then its \numberwithin can be used:

\usepackage{amsmath}
\numberwithin{table}{subsection}

Yours sincerely
Heiko Oberdiek
{"ft_lang_label":"__label__en","ft_lang_prob":0.6317862,"math_prob":0.77711445,"size":1188,"snap":"2023-40-2023-50","text_gpt3_token_len":354,"char_repetition_ratio":0.20861487,"word_repetition_ratio":0.0,"special_character_ratio":0.25252524,"punctuation_ratio":0.13235295,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9949603,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-29T13:19:48Z\",\"WARC-Record-ID\":\"<urn:uuid:a87133a9-5097-406a-91f3-6e0c253a9889>\",\"Content-Length\":\"3901\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5ec63ad0-ef9b-4b5d-9608-dbbf0690e89f>\",\"WARC-Concurrent-To\":\"<urn:uuid:ecc81153-9f33-4b46-9649-0dba51ee0320>\",\"WARC-IP-Address\":\"46.4.94.215\",\"WARC-Target-URI\":\"https://www.tug.org/pipermail/texhax/2012-June/019348.html\",\"WARC-Payload-Digest\":\"sha1:BI346EPVOIVNW6XMWPNOMTSFNOOU6ELW\",\"WARC-Block-Digest\":\"sha1:6W6BHG2YSVERN52HCWXHRRVN5JRKKUVG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510516.56_warc_CC-MAIN-20230929122500-20230929152500-00166.warc.gz\"}"}