As I want my captions to be the same width as my tables and figures I used the threeparttable
package and the measuredfigure
environment. However since, I have issues with referencing and labels of tables and figures in my text. Basically the figure/table number is replaced by ??. I've searched online but cannot find the appropriate help I need to fix this issue.
If I remove the caption and label from the measuredfigure
environment and place it just above under \centering
it works fine but the caption is no longer the width of the table/figure.
Many thanks
Egm1b
Here is WME
\documentclass[12pt,a4paper,oneside,english,oldfontcommands]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{csquotes}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{gensymb}
\usepackage{tikz}
\usepackage{wasysym}
\usepackage{tabularx}
\usepackage{cleveref}
\usepackage{threeparttable}
\usepackage{caption}
\captionsetup{justification = raggedright,
singlelinecheck = false}
\newsubfloat{figure}% Allow subfloats in figure environment
\begin{document}
Below is summary table \Cref{tab:marker}
% Table generated by Excel2LaTeX from sheet 'Sheet6'
\begin{table}
\centering
\begin{measuredfigure}
\caption{Caribou age groups at Nunalleq based on epiphyseal fusion \label{tab:marker}}
\begin{tabular}{lcc}
\toprule
Age group & NISP & \% NISP \\
\midrule
Adult (fused) & 441 & 88.6\% \\
Subadult (unfused) & 46 & 9.2\% \\
Juvenile (unfused) & 11 & 2.2\% \\
\midrule
Total & 498 & 100.0\% \\
\bottomrule
\end{tabular}%
\end{measuredfigure}
\end{table}%
And MWE code for figures
Here is example with reference to \Cref{marker2}
\begin{figure}
\centering
\begin{measuredfigure}
\includegraphics[width=5cm]{figures/ch7_caribouwear1}
\caption{This is a very long caption very long}
\label{marker2}
\end{measuredfigure}
\end{figure}
\end{document}
measuredfigure
environment at all, and not thethreeparttable
environment?Here is example with reference to \Cref{marker2} \begin{figure} \centering \begin{measuredfigure} \includegraphics[width=5cm]{figures/ch7_caribouwear1} \caption{This is a very long caption very long} \label{marker2} \end{measuredfigure} \end{figure}