# How can I have different caption delimiters for captions and contcaptions?

I'm using the memoir class and have a figure that is continued on the next page. The markup is roughly this:

\captiondelim{: }

\begin{figure}
% ...
\caption{Foo bar}
\end{figure}

\begin{figure}
% ...
\contcaption{(Continued)}
\end{figure}


This results in two figures with the captions

Figure 1: Foo bar

and

Figure 1: (Continued)

Is there any chance to change the caption delimiter (automatically) for "contcaption"s, such that the result would be (the colon must still be there for normal captions though):

Figure 1 (Continued)

I tried to understand what the \concaption command actually does, but it didn't look like there was a simple solution...

-

Assuming that in a figure environment you just have a \contcaption, never accompanied by a \caption command, which seems a reasonable assumption, you can do it with

\documentclass{memoir}

\usepackage{etoolbox}

\captiondelim{: }
\preto{\contcaption}{\captiondelim{ }} % change \captiondelim

\begin{document}

\begin{figure}[htp]
% ...
\caption{Foo bar}
\end{figure}

\begin{figure}[htp]
% ...
\contcaption{(Continued)}
\end{figure}

\begin{figure}[htp]
% ...
\caption{Oh}
\end{figure}

\end{document}


-
ahh, that was a good one, hadn't though of that. – daleif Aug 22 '14 at 9:47

Not really no. I think the easiest thing is to use

\newcommand\mycontcaption[1]{
\begingroup
\captiondelim{~}
\contcaption{#1}
\endgroup
}


and then use

\mycontcaption{(Continued)}

-
That's perfect! I didn't know about "begingroup" and "endgroup"... – Niko Aug 22 '14 at 9:35

An automatic solution can be obtained with the caption package: it has a \ContinuedFloat switch that defines the figure environment in which it is used, as of type continuedfloat for which we can define a specific formatting:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}

\usepackage{caption}
\DeclareCaptionFormat{continued}{ #1~(continued)}
\captionsetup[ContinuedFloat]{format=continued}

\begin{document}

\begin{figure}
\centering
\includegraphics[scale = 0.4]{Piero_di_Cosimo_1}
\caption{Piero di Cosimo}
\end{figure}

\begin{figure}\ContinuedFloat
\centering
\includegraphics[scale = 0.3]{Piero_di_Cosimo_2}
\caption{}
\end{figure}

\end{document}


-