Graphics, Figures & Tablesindex shown on the graph is inconsistent with in the text

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
bsmile
Posts: 3
Joined: Mon Oct 04, 2010 3:09 am

index shown on the graph is inconsistent with in the text

Post by bsmile »

plain latex, under ubuntu(don't know version number)

the index shown on the graph is different from shown in the context. say, on the graph, it is generated as Figure 1, but in the context, it is something like Figure 3.2.1, where the context is exactly under the 3.2 section.

The class used is article.cls. It must have something to do with a specific class used to generate document, but how to track it and fix it?!

any idea on how this could happen would be greatly appreciated! Thank you very much for a quick hint!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

index shown on the graph is inconsistent with in the text

Post by frabjous »

Please do not cross-post. It is against the Board Rules.

If you are not already, load the amsmath package, and then use the \numberwithin command, as follows:

Code: Select all

\usepackage{amsmath}
\numberwithin{figure}{subsection}
If that does not work, then provide a minimal working example showing the problem (something also specified in the board rules; see also the Post on Avoidable Mistakes.)
bsmile
Posts: 3
Joined: Mon Oct 04, 2010 3:09 am

Re: index shown on the graph is inconsistent with in the tex

Post by bsmile »

Thanks! It works like magic! But what if I want to work the other way round, to display the labels in ascending order in the context instead of section.subsection... format?

BTW, sorry to post multiple board. I am in need of an answer very urgently. I saw the board does not have answers in the last three days, I thus posted the question into a board with more people ... I would not it again,
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

index shown on the graph is inconsistent with in the text

Post by frabjous »

I'm not entirely sure about what you mean. Do you mean that the first figure in subsection 2 of section 3 should be listed as "1.2.3" rather than "3.2.1"? I've never seen that format used before, but perhaps you could add to the above with:

Code: Select all

\renewcommand*{\thefigure}{\arabic{figure}.\arabic{subsection}.\arabic{section}}
Post Reply