2

Possible Duplicate:
How to create multilevel figure / table numbers?
Continuous v. per-chapter/section numbering of figures, tables, and other document elements

\documentclass{article}
\begin{document}

dude see Fig. \ref{myfig} ! 

\appendix{}

\section{my section heading}\label{sec:seclabel}


\begin{figure}[H]
\caption{mycaption}
\label{myfig}
\end{figure}

\end{document}

yields dude see Fig. 1 -- how do i make something that yields dude see Fig. A.1 (without manually doing Fig. \ref{sec:seclabel}.\ref{myfig}).

bshanks
  • 123

1 Answers1

1

You have to use the \numberwithin{figure}{section} macro. It needs amsmath package, see the complete example below:

\documentclass{article}
\usepackage{amsmath} %% HERE!!!
\begin{document}

dude see Fig. \ref{myfig} ! 

\appendix{}

\numberwithin{figure}{section} %% AND HERE!!!

\section{my section heading}\label{sec:seclabel}


\begin{figure}[H]
\caption{mycaption}
\label{myfig}
\end{figure}

\end{document}
yo'
  • 51,322