[Tex/LaTex] How to have different caption delimiters for captions and contcaptions

captionsmemoir

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…

Best Answer

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}

enter image description here

Related Question