[Tex/LaTex] Package Caption Error Please help

captions

Dear Friends,
Greetings, I have one error with my latex code. Kindly help me to remove this error.

This is the error message

package caption error: something's wrong perhaps a missing \caption

I am putting MWE. Thanks

\documentclass[smallextended]{svjour3}       % onecolumn (second format)
\usepackage[monochrome]{color}
\usepackage[sort&compress]{natbib}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{float}
 \usepackage{hhline}
\usepackage{longtable}
\usepackage{stfloats}
\usepackage{epstopdf}
\usepackage{pgfplots}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[pagewise]{lineno}
    \usetikzlibrary{patterns}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{stfloats}
\usepackage{soul}
\usepackage{empheq}
\makeatletter  %highlight
\AtBeginDocument{\let\hl\@firstofone}
\makeatother
\usepackage{tikz}

\begin{document}



\begin{figure}[H]
        \centering
        \begin{subfigure}[b]{0.4\textwidth}
                \centering
                \includegraphics[width=\textwidth]{Apneafft}
                \caption{Power spectrum in Apnea case \cite{Drinnan2000}}
                \label{Apneafft}
        \end{subfigure}
        \begin{subfigure}[b]{0.4\textwidth}
                \centering
                \includegraphics[width=\textwidth]{normalfft}
                \caption{Power spectrum in normal case \cite{Drinnan2000}}
                \label{normalfft}
        \end{subfigure}
         \caption{Power spectrum}
\end{figure}

\end{document}

Best Answer

What you provide is no minimal working example. Reducing your code to one yields this, and shows that the relevant part of the code works fine:

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}[h]
        \centering
        \begin{subfigure}[b]{0.4\textwidth}
                \centering\large A
                \caption{Power spectrum in Apnea case}
                \label{Apneafft}
        \end{subfigure}
        \begin{subfigure}[b]{0.4\textwidth}
                \centering\large B
                \caption{Power spectrum in normal case}
                \label{normalfft}
        \end{subfigure}
        \caption{Power spectrum}
\end{figure}

\end{document}

Please work your way from here to find, what causes your problems, so that we may help you further.

Further, you load wrapfig and float twice in your code.