I have a document with a figure
environment that looks like this:
\documentclass[a4paper,10pt]{article}
\usepackage{subfig}
\usepackage{tikz}
\makeatletter
\newbox\sf@box
\newenvironment{SubFloat}[2][]%
{\def\sf@one{#1}%
\def\sf@two{#2}%
\setbox\sf@box\hbox
\bgroup}%
{ \egroup
\ifx\@empty\sf@two\@empty\relax
\def\sf@two{\@empty}
\fi
\ifx\@empty\sf@one\@empty\relax
\subfloat[\sf@two]{\box\sf@box}%
\else
\subfloat[\sf@one][\sf@two]{\box\sf@box}%
\fi}
\makeatother
\begin{document}
\begin{figure}
\centering
\begin{SubFloat}
{\label{image1}}
\includegraphics[width=0.4\textwidth]{image1.jpg}
\end{SubFloat}
\qquad
\begin{SubFloat}
{\label{image2}}
\includegraphics[width=0.4\textwidth]{image2.jpg}
\end{SubFloat}
\end{figure}
\end{document}
(compiled with pdflatex
)
LaTeX puts letters below each image ((a)
, (b)
, (c)
, etc..) and I want it to put numbers instead.
How could I do that?
\renewcommand*\thesubfloatfigure{\themainfigure--\arabic{subfloatfigure}}
should do it. Adjust the--
separator. While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the\documentclass
and the appropriate packages so that those trying to help don't have to recreate it. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving problem.MWE
, I know I should always include one with the question I just thought in this case it was a simple enough question not to need one (also I was lazy) Won't happen again. Quick follow-up question: where should I put the line you wrote? Above the figure? Will this also affect all the figures that come after that one? And, how should I adjust the--
? Thank you very much!\begin{figure}
should work, but I can't test it without a MWE, so you'll have to do that...MWE
now. I still don't quite get how should I adjust the--
. What do I do with those dashes? Regards.