On the question How to create a box with caption and label like a float?, they teach how to create your own caption with the caption
package command \DeclareCaptionType
, but it not seems to be working with memoir class: memoir class with subcaption and hyperref packages
Then I tried loading \usepackage{capt-of}
instead of caption
:
\documentclass[10pt,a5paper,twoside]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{capt-of}
\usepackage{graphicx,newfloat}
\DeclareCaptionType{InfoBox}
\begin{document}
\fboxsep=8pt\relax
\fboxrule=2pt\relax
\begin{center}
\fbox{\centering
\includegraphics[width=2in]{example-image-A}}\par
\captionof{InfoBox}{Here is my caption\label{fg:A}}
\end{center}
\begin{InfoBox}[ht]
\centering
\fbox{\centering\medskip
\includegraphics[width=2in]{example-image-B}}\par
\caption{Here is my caption\label{fg:B}}
\end{InfoBox}
\end{document}
But still creating errors:
test3.tex:9: Undefined control sequence
Here is how much of TeX's memory you used:
...
On line 14 there is the \DeclareCaptionType
command for the caption
package. How can it be used with the memoir class?
Best Answer
Based on the questions:
You can use the following code for suppressing the warning, as the warning is only documentation on how to use the
memoir
's class, instead of something you should be fixing.Noticing know on you need to ignore the caption documentation from the
memoir
's class and use the caption documentation from thecaption
package.