1

I use package caption and I want to cite to a figure, but I can't cite. How can I cite to figure?

\documentclass[12pt,a4paper]{article}
\usepackage{fouriernc}
\usepackage[utf8]{vietnam}
\usepackage{graphicx}
\usepackage{float}
\usepackage{hyperref}
\usepackage{caption}
\captionsetup[figure]{format=plain,labelsep=period}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}

\begin{document}
\begin{center}
\begin{figure}
\includegraphics[scale=1]{pic_02}
\label{toan1}
\caption{{}}
\end{figure}
\end{center}
See Figure~\cite{toan1}
\end{document}

enter image description here

I got enter image description here

This is a figure.

enter image description here

1 Answers1

2

Your example has a few flaws:

  1. Use \ref instead of \cite: Understanding how references and labels work
  2. The \label has to be placed after \caption: Why does an environment's label have to appear after the caption?
  3. It is advised to use the fig:<name> notation for figure labels: What is the advantage of using the notation 'fig:' in the \label {}?
\documentclass{article}
\usepackage{graphicx}
\begin{document}

\begin{figure}
  \centering
  \includegraphics[width=5cm]{example-image-a}
  \caption{Look at my picture}
  \label{fig:toan1}
\end{figure}

See Figure~\ref{fig:toan1}

\end{document}

enter image description here

Henri Menke
  • 109,596