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

Darío darioslc at gmail.com
Thu Jun 28 16:37:55 CEST 2012


>> 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
> \@addtoreset{table}{subsection}
> \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
>

Thanks Heiko!, i´m use this
\documentclass{article}

 \makeatletter
 \@addtoreset{table}{section}
 \renewcommand*{\thefigure}{\thesection.\arabic{figure}}
 \makeatother
for the figure in the sections and works perfectly, at the first
figure appears correctly
2.1 and not 1.


-- 
Darío
|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
Por favor, no utilice formatos de archivo propietarios para el intercambio
de documentos, como ser DOC, XLS, BMP, PPT, RAR, MP3, DWG,
MOV, FLV, WMV, etc.  sino  ODT, ODS, DJVU, PDF, TXT,
CSV, PNG, FLAC, OGV, GZ o cualquier otro que no obligue a utilizar
un programa de un fabricante concreto.
Info: http://www.gnu.org/philosophy/no-word-attachments.es.html
       http://www.vaslibre.org.ve/publicaciones/odfvsooxml-es.pdf
|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
 ,              ,
/                \
((__-^^-,-^^-__))
 `-_---' `---_-'
  `--|o` 'o|--'
     \  `  /
      ): :(
     :o_o:
       "-"



More information about the texhax mailing list