0

In most of my document the referencing of figure doesn't work. I am not sure what I am doing wrong I have tried ~\ref and \ref but I just get ??

\begin{figure}[h!]
\label{fig:tcshock}
\centering
\includegraphics[width=120mm]{./Plots/TCM_Credit.png}
\captionof{figure}{Total Claim Mean before and after spread shock}
\end{figure}

\clearpage

From the figure ~\ref{fig:tcshock}

Libraries are as follows:

\RequirePackage[final]{graphicx}
\documentclass[final]{article} %changed draft -> final once the version is final
\usepackage{MRMCDocumentation}
%\usepackage{QRCDocumentation}
%\usepackage{QRCDocumentation_Anna}              %% use my own version
\usepackage{amsmath,amsfonts}
\usepackage{rotating}
\usepackage[pdfpagelayout=SinglePage,bookmarks,hyperindex]{hyperref}

% Piotr's additional changes ----------------------------------
\usepackage{ifdraft}
\usepackage{lineno}  % for line numbering during review
\usepackage{ifthen} % for conditional statements
\usepackage[obeyDraft,colorinlistoftodos]{todonotes}
\usepackage{physics} % for nice derivatives symbols
\usepackage{xspace} % for the symbols spacing
\usepackage{colortbl} % filling the tables cells
\usepackage{fancyvrb} % framed verbatim environment (for PALs quoting)
%-----------------------------------------------------------------

% Anna's additional packages
%------------------------------
\usepackage{bbm}        % for statistics symbols
\usepackage{amssymb}

%%%% ---- FMB ---  %%%%%%%%%%%%%
\usepackage{color}
\definecolor{forestgreen}{rgb}{0.0, 0.27, 0.13}
%\usepackage{tablefootnote}
\usepackage{paralist}
\usepackage{booktabs}
\ifdraft{\usepackage{draftwatermark}}
%\usepackage{natbib}
%\usepackage{showlabels}

% Sameer Packages
\usepackage{array}
\usepackage{arydshln}
\usepackage{color}
\usepackage{longtable}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[titletoc,toc,page]{appendix}
\usepackage{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X}

\usepackage{enumitem}
\usepackage{etoolbox}
\AtBeginEnvironment{table}{%
\setlist[enumerate]{nosep, % <-- list setup used in all tables
                     topsep = 0pt,
                     partopsep = 0pt,
                     wide,
                     label=\alph*),
                     before = \vspace{-0.6\baselineskip},
                     }
                        }
%\usepackage[titletoc,title]{appendix}   %Karl


%%% ------------------------ Anna's commands ----------------------------------------------------
%%% ----------------------------------------------------------------------------------------------
\usepackage[bookmarks,hyperindex,hyperindex]{hyperref} 
  • Compile twice to see. – Sigur Mar 05 '18 at 14:59
  • Put the \label after \caption, not miles before \caption ;-). Also hyperref is loaded too early and then again -- remove the first loading, the command \RequirePackage[final]{graphicx} is weird. Just say \usepackage{graphicx} after \documentclass, the final option of the class will do for the graphicx package as well –  Mar 05 '18 at 15:01
  • thanks just saw the other post...sorry for the duplicate post! – Varun Yadav Mar 05 '18 at 15:02

0 Answers0