Skip to content

cannot create labels to subfigures #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
st-le opened this issue Oct 8, 2022 · 1 comment
Open

cannot create labels to subfigures #8

st-le opened this issue Oct 8, 2022 · 1 comment

Comments

@st-le
Copy link

st-le commented Oct 8, 2022

hi Hadziq,

Thank you and the original author to provide such a convenient template for the NTUST thesis. It lifts a huge burden from the drafting.

I am currently using this template with Overleaf with little issue. However, I cannot have labels for the subfigures and refer to them. An example follows

\begin{figure}[h]
\centering
    % \subfigure[]
    \begin{subfigure}[b]{0.5\textwidth}
        \centering
        \includegraphics[width=\textwidth]{English Version/figures/7a.png}
        \label{fig:rbcep_org}  % <-- here error
    \end{subfigure}
    % \subfigure[]
    \begin{subfigure}[b]{0.35\textwidth}
        \centering
        \includegraphics[width=\textwidth]{English Version/figures/7b.png}
        \label{fig:rbcep_crp}  % <-- here error
    \end{subfigure}
% \vspace{-5pt}
\caption{some caption}
\label{fig:train_img}
\end{figure}

the error message:

Package caption Warning: \label without proper reference on input line ...

and when it is referred to with \ref{fig:rbcep_crp}, it returns [??] and with error message

I've found that this only happens with ntust_report document class. When using overleaf's article document class, it works fine.

Could you give some suggestions or support? Thank you again.

@st-le
Copy link
Author

st-le commented Oct 8, 2022

add at least an empty caption i.e. \caption{} before the \label command fixed it. Lots of trials failed but this time it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant