# \caption{title subsubsection}

I am entering the following code in more than 180 times after each \subsubsection.

Is there any way to automate \caption{subsubsection title}?

I tried with \caption{\subsubsectiontitlename} but it does not work.

%%%%%%%%

\begin{figure}[H]
\caption{títol \subsubsection}
\subfloat[Mostres absolutes]{
\includegraphics[width=0.50\linewidth]{Columna_34_absol.jpg}}
\includegraphics[width=0.50\linewidth]{Columna_34_pond.jpg}}
\\
\subfloat[]{
\includegraphics[scale=0.1]{Formatge_34_preg.jpg}}
\subfloat[]{\includegraphics[width=0.33\linewidth]{Formatge_34_absol.jpg}}
\hfil
\subfloat[]{\includegraphics[width=0.33\linewidth]{Formatge_34_pond.jpg}}\hfil
}
\end{figure}

%%%%%%%%%%%%%%%%

-

Use a personal environment:

\newenvironment{subsectionfigure}[1]
{\subsection{#1}\begin{figure}[H]\caption{#1}}
{\end{figure}}


and then

\begin{subsectionfigure}{Title of this subsection}
\subfloat[Mostres absolutes]{
\includegraphics[width=0.50\linewidth]{Columna_34_absol.jpg}}
\includegraphics[width=0.50\linewidth]{Columna_34_pond.jpg}}
\\
\subfloat[]{
\includegraphics[scale=0.1]{Formatge_34_preg.jpg}}
\subfloat[]{\includegraphics[width=0.33\linewidth]{Formatge_34_absol.jpg}}
\hfil
\subfloat[]{\includegraphics[width=0.33\linewidth]{Formatge_34_pond.jpg}}\hfil
}
\end{subsectionfigure}


In the argument of the newly defined argument you put the subsection title, which will be repeated in the caption (although it seems a useless repetition).

-
Hi egreg, thanks a lot for your help! – José Monllor Apr 26 '12 at 21:04
@egreg I'm having trouble seeing how this automates the process of repeatedly typing the title of the subsubsection. Won't he still have to type the title of the subsubsection for every single figure? – JohnReed Apr 27 '12 at 4:35
@JohnReed I assumed that each subsection has its own title. – egreg Apr 27 '12 at 8:08

Here a solution that works by modifying the subsubsection command. Note: this only works properly if the figure is inside of a subsubsection.

\let\oldsubsubsection\subsubsection

Then, for your captions in your figures you can use \caption{\ssv}. This should output the name of the current subsubsection title in the caption.