5

I'm inserting plenty of subfigures within a figure, when I reach the letter "z" in the subfiures captions it won't compile any more, can please anybody confirm this? (Can't post a MWE as I don't really know how to place dummy images, but feel free to access this work and make any change you want).

I don't wanna be a pain, but I do need this as soon as possible.

If the subfigure package is unable to continue placing subfigures, is there a workaround for this?.

Thanks in advance.

  • 1
    Can you accept arabic subfigure counters? Insert \DeclareCaptionSubType*[arabic]{figure} somewhere in your preamble. – Ignasi Mar 19 '15 at 8:27
  • I guess so, all I need is being able to keep inserting subfigures and keep a good track at them. What should I do?, just insert that code in my preamble and then I'm set?. – Hans Mar 19 '15 at 8:30
10

The alphabetic counter is limited to 26 values, but if you can consider a numeric counter, there is no problem.

\documentclass{article}
\usepackage{subcaption}
\usepackage{pgffor}
\DeclareCaptionSubType*[arabic]{figure}

\begin{document}
\begin{figure}
\foreach \i in {1,...,20}{
\begin{minipage}[b]{.3\linewidth}
\centering\large A\i
\subcaption{A subfigure}\label{fig:1A\i}
\end{minipage}%
\begin{minipage}[b]{.3\linewidth}
\centering\large B\i
\subcaption{A subfigure}\label{fig:1b\i}
\end{minipage}
\begin{minipage}[b]{.3\linewidth}
\centering\large C\i
\subcaption{A subfigure}\label{fig:1c\i}
\end{minipage}\\
}
\end{figure}
\end{document}

enter image description here

  • DUDE!!! Works like a charm, I owe you my academic life, thank you so much. Any way if you find a way to make it let's say (a,b,...,z,aa,ab,...,az,ba,...) it would be awesome, However, by now this is perfect, THANK YOU SO MUCH. – Hans Mar 19 '15 at 8:37
12

If you still want your subfigures numbering to be a, b, ... , aa, ab, ... , you can load the alphalph package and declare:

\renewcommand\thesubfigure{\alphalph{\value{subfigure}}}

MWE (borrowed from Ignasi's answer)

\documentclass{article}
\usepackage{subcaption}
\usepackage{pgffor}
\usepackage{alphalph}

\renewcommand\thesubfigure{\alphalph{\value{subfigure}}}

\begin{document}
\begin{figure}
\foreach \i in {1,...,20}{
\begin{minipage}[b]{.3\linewidth}
\centering\large A\i
\subcaption{A subfigure}\label{fig:1A\i}
\end{minipage}%
\begin{minipage}[b]{.3\linewidth}
\centering\large B\i
\subcaption{A subfigure}\label{fig:1b\i}
\end{minipage}
\begin{minipage}[b]{.3\linewidth}
\centering\large C\i
\subcaption{A subfigure}\label{fig:1c\i}
\end{minipage}\\
}
\end{figure}
\end{document} 

enter image description here

  • It works as well!!!, thank you so much, this is the one I'll be implementing now. However I think Ignasi still deserves the accepted answer (he was the fastest answering, and actually that is what I needed), this was just an extra. I do have to say I am really happy with this solution. Thanks again. – Hans Mar 19 '15 at 9:15
  • @Hans You're welcome. No problem for accepting Ignasi's answer. Just remember to upvote both answers. :-) – karlkoeller Mar 19 '15 at 9:17
  • I did so :) Dude, thanks again, from deep in my heart, Thanks for taking the time to do this. – Hans Mar 19 '15 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.