Graphics, Figures & TablesReseting the subfloat numbering

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
User avatar
arkara
Posts: 9
Joined: Mon Nov 03, 2008 11:52 pm

Reseting the subfloat numbering

Post by arkara »

Hi, i use the subfig package, and i have 2 figures using subfloats.
just like that.

Code: Select all

\begin{figure}[H]
	\caption*{\Large \textbf{\underline{Χωρίο 1}}}
        \hspace{-1.4cm}
	%
        \subfloat[][Συνοριακοί Κόμβοι]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/11.pdf}}
        \subfloat[][Συνοριακοί και εσωτερικοί κόμβοι]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/12.pdf}} %\\[1cm]
        
        \hspace{-1.4cm}
        \subfloat[Πλέγμα κατά \en{Coons}]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/13.pdf}}
        \subfloat[Πλέγμα \en{Coons} με εξομάλυνση]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/14.pdf}}

	\caption{Στο σχήμα (α), φαίνονται οι κόμβοι οι οποίοι βρίσκονται στο περίγραμμα του προς πλεγματοποίηση
	χωρίου. Στο σχήμα (β) είναι οι κόμβοι σε όλη την επιφάνεια του χωρίου μετά την μεταφορά τους από το λογικό
	τετράγωνο στο πραγματικό επίπεδο. Στο σχήμα (γ) φαίνεται το πλέγμα που προκύπτει από τους κόμβους του σχήματος (β)
	και στο σχήμα (δ) απεικονίζεται το πλέγμα μετά την διαδικασία της εξομάλυνσης.}
	%\\[1.5cm]
\end{figure}



\begin{figure}[H]
	\caption*{\Large \textbf{\underline{Χωρίο 2}}}
        \hspace{-1.4cm}
	%
        \subfloat[Συνοριακοί Κόμβοι]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/21.pdf}}
        \subfloat[Συνοριακοί και εσωτερικοί κόμβοι]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/22.pdf}} %\\[1cm]
        
        \hspace{-1.4cm}
        \subfloat[Πλέγμα κατά \en{Coons}]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/23.pdf}}
        \subfloat[Πλέγμα \en{Coons} με εξομάλυνση]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/24.pdf}}

	\caption{Τα σχήματα ακολουθού}
	%\\[1.5cm]
\end{figure}


But what it seems to happen is that the numbering on the second float is not start over, but continues from 4 and ends to 8. How do i reset the numbering so that i have 2 floats with 4 figures each and their numbering starts from 1 and ends to 4 on both of them?
Last edited by arkara on Fri Mar 13, 2009 9:26 pm, edited 1 time in total.

Recommended reading 2024:

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

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

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Reseting the subfloat numbering

Post by sommerfee »

Code: Select all

\setcounter{subfigure}{0}
within the 2nd figure should help.
User avatar
arkara
Posts: 9
Joined: Mon Nov 03, 2008 11:52 pm

Re: Reseting the subfloat numbering

Post by arkara »

Wow, thanks for the quick reply,
ok i have done that, the document compiles normally but nothing changes in the numbering
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Reseting the subfloat numbering

Post by sommerfee »

While building a complete minimal example I realized that I can't reproduce your problem. This one is working fine here, each subfigures numbered from a) to d):

Code: Select all

\documentclass{article}
\usepackage{float,subfig}
\usepackage[demo]{graphicx}
\begin{document}
Some text\ldots

\begin{figure}[H]
   \caption*{\Large \textbf{\underline{some text}}}
        \hspace{-1.4cm}
   %
        \subfloat[][some text]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/11.pdf}}
        \subfloat[][some text]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/12.pdf}}
%\\[1cm]
        \hspace{-1.4cm}
        \subfloat[some text]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/13.pdf}}
        \subfloat[some text]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/14.pdf}}
   %
   \caption{some more text}
   %\\[1.5cm]
\end{figure}

\begin{figure}[H]
   \caption*{\Large \textbf{\underline{some text}}}
        \hspace{-1.4cm}
   %
        \subfloat[some text]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/21.pdf}}
        \subfloat[some text]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/22.pdf}} %\\[1cm]
       
        \hspace{-1.4cm}
        \subfloat[some text]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/23.pdf}}
        \subfloat[some text]
        {\includegraphics[trim=1cm 0cm 5cm 1cm,clip,width=0.6\linewidth]{images/24.pdf}}
   %
   \caption{some text}
   %\\[1.5cm]
\end{figure}

\end{document}
So please give us a minimal example showing your problem, or modify the one above so the misbehaviour shows up.
User avatar
arkara
Posts: 9
Joined: Mon Nov 03, 2008 11:52 pm

Re: Reseting the subfloat numbering

Post by arkara »

Hi, i copy and paste your code. It compiles normally and the numbering
does not change. it goes a) - h)

[EDIT]

OK solved :D
I replaced the subfig package with the subfigure package
then when i place the figures,i write subfigure rather than subfloat
and BAM!, solved!
Post Reply