I'm generating LaTex automagically from a lengthy document that is written in the multimarkdown language, compiled by a software package called Scrivener. It's a workflow that works well, but this is one of the issues I'm hitting. I don't want to have to replace / delete numerous caption command each time I compile to LaTex.
The MWE below illustrates the issue.
This remove Figure n:
and caption from included graphic. However, it leaves a blank line, which makes the images spacing appear gauche. Is there a simple way to remove the blank line , without inserting space adjustments, each time a figure is used Thanks.
\documentclass{memoir}
\usepackage{mwe} % for dummy images
\usepackage[labelformat=empty]{caption} % remove figure captions
\begin{document}
\begin{figure}[!ht]
\centering
\includegraphics[width=0.5\textwidth]{image}
\caption{}
\end{figure}
This is first text after caption.
\end{document}
Best Answer
memoir
provides its own interface for caption management, and there may be some clashes when using it in conjunction withcaption
(see section 10.13 The class versus thecaption
package (and its friends), p 206 of thememoir
user manual).However, you can update
\caption
to grab its contents, evaluate whether the argument is empty/not, and condition accordingly:If you're not using the optional argument of
\caption
in your workflow, then the redefinition could be a bit simpler: