Graphics, Figures & TablesRunning out of Labels for Sub-floats

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Niels
Posts: 2
Joined: Sat Apr 27, 2013 10:43 pm

Running out of Labels for Sub-floats

Post by Niels »

Dear all,

Thank you for taking time to read my first post ever on this forum!

I'm using LaTeX for my thesis and it's my first experience with it. So far I'm very happy with it, but today I encountered a problem. I'm inserting figures that are made of 4 subfigures each. The subfigures are labeled a, b, c, ... x, y and z. But since the alphabet has only 26 characters and I want to implement more than 8 figures each consisting of 4 subfigures, LaTeX gives an error when I try to insert the 9th figure because it has arrived at the end of the alphabet when labeling the subplots. Is there any way to extend the numbering of the subplots? You can find the code that I'm using to do it as well as the preamble below.

Thanks in advance,
Niels

Code: Select all

\begin{center}            
  \subfloat[$Snelheidsveld$]{\label{Snelheidsveld}\includegraphics[width=0.5\textwidth]{H2}}
  \subfloat[$Snelheidsveld$]{\label{Snelheidsveld}\includegraphics[width=0.5\textwidth]{H3}}\\
  \subfloat[$Snelheidsveld$]{\label{Snelheidsveld}\includegraphics[width=0.5\textwidth]{H4}}
  \subfloat[$Snelheidsveld$]{\label{Snelheidsveld}\includegraphics[width=0.5\textwidth]{H1}}
  \captionof{figure}{Figuren van het luchtstromingsveld in een van de koelcellen bij een uitblaassnelheid}
  \label{origineel}
  \end{center}

Code: Select all

\documentclass[11pt, twoside]{report}
\usepackage[left=2.5cm,top=1.7cm,right=1.5cm,bottom=25mm]{geometry}
\usepackage[parfill]{parskip}    						
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{color}
\usepackage{textcomp}
\usepackage[dutch]{babel}
\usepackage{graphicx}
\usepackage[demo]{graphicx}
\usepackage{fancyhdr}
\setlength{\headheight}{13.2pt}
\usepackage{titlesec}
\usepackage{url}
\usepackage{hyperref}
\usepackage{eurosym,mathcomp}
\usepackage{amssymb}
\usepackage{babelbib}
\usepackage{amsmath}
\usepackage{subfig}
\usepackage{morefloats}
\usepackage{booktabs} 
\usepackage{pifont}               
\usepackage{textcomp}          
\usepackage{caption} \captionsetup{margin=1ex, font={small, sf}, labelfont={bf, sf}, labelsep= endash}}
\renewcommand{\topfraction}{.95} \renewcommand{\bottomfraction}{.95} \renewcommand{\textfraction}{0.05}
\newcommand{\gradencelsius}{\ensuremath{\,\tccelsius}}
\newcommand\procent{\,\%}
\usepackage{fullpage}
\usepackage{perpage}
\title{\bf Master thesis}
\author{Niels Bessemans}
\date{22-03-2012}
\renewcommand{\contentsname}{Inhoudsopgave}
\MakePerPage{Niels Bessemans}
\setcounter{secnumdepth}{7}
\setcounter{tocdepth}{7}
\linespread{1.3}
\begin{document}
\titlespacing*{\chapter}{5pt}{-50pt}{20pt}
\titleformat{\chapter}[display]{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\renewcommand{\bibname}{Referenties}
\fancyhf{}
\pagestyle{fancy}
\headsep = 25pt
\fancyhf[HL]{\nouppercase{\textit{\leftmark}}}
\fancyhf[FC]{\thepage}

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

Niels
Posts: 2
Joined: Sat Apr 27, 2013 10:43 pm

Running out of Labels for Sub-floats

Post by Niels »

The problem can easily be solved by simply inserting \setcounter{subtable}{0}. This makes the caption label for the subplots of each figure start with a.

Hopefully it's handy for someone else.

Kind regards,
Niels
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Running out of Labels for Sub-floats

Post by sommerfee »

Niels wrote:The problem can easily be solved by simply inserting \setcounter{subtable}{0}. This makes the caption label for the subplots of each figure start with a.
The subplots of each figure should start with "a" automatically, there is no need to reset the sub-figure counter manually. So it seems you are doing something wrong.

BTW:

Code: Select all

\captionsetup{margin=1ex, font={small, sf}, labelfont={bf, sf}, labelsep= endash}}
=> There is an additional closing brace which results in error "! Too many }'s."

Code: Select all

\begin{center}
  \subfloat[...]{...}
=> This results in error "! LaTeX Error: \subfloat outside float."

So your code snippets are inappropriate to describe and examine your problem.
Post Reply