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.

It was asked a while ago how to make equation use the same counter as a theorem for example and one solution was to make the theorem counter use the equation instead by using

\newtheorem{thm}[equation]{Theorem}

Now what if I also want figures to follow the same pattern? Figures use the counter figure and theorem can’t have two counters.

share|improve this question
2  
This is lockstep again. :-) Please split your question/answer into one question and one answer (self-answers are allowed, although one should normally wait some time to give other users a chance to answer). BTW, I have a (hopefully) better solution. –  lockstep Apr 19 '11 at 20:29

2 Answers 2

Adding \addtocounter{equation}{1} before every figure environment is cumbersome and error-prone. Assuming you have succeeded in connecting theorem counters to the equation counter, here's how to make equations and figures share a counter (add this to your preamble):

\makeatletter
\let\c@equation\c@figure
\makeatother
share|improve this answer

Note: The OP provided an answer to his own question as part of the question. I cut and pasted his text into a separate answer.

After some digging I found a (not so satisfactory) solution: put this in a preamble to the document

\renewcommand{\thefigure}{\arabic{chapter}.\arabic{equation}}

and whenever you have a figure, just before the \begin{figure}, put the following:

\addtocounter{equation}{1}

Funny enough moving the above command (which increments the equation counter) inside the \renewcommand above doesn’t work! All figures will remain with the same number... :/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.