Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}).

share|improve this question
add comment

marked as duplicate by tohecz, lockstep, Paulo Cereda, percusse, cmhughes Mar 26 '12 at 16:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 1 down vote accepted

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}
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.