Graphics, Figures & Tables ⇒ Numbering figures in LyX fails (figures have same numbers)
Numbering figures in LyX fails (figures have same numbers)
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Numbering figures in LyX fails (figures have same numbers)
looks like you're usingSteveF wrote:But when I lable a figure with insert label, then "fig:....." , then all figures within the same subsection are numbered with the same number : the number of the subsection. How do I solve this problem ?
\label
before \caption
(or no \caption
at all). Reverse the order: first \caption
, then \label
.Not sure how that translates to LyX.
KR
Rainer
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Numbering figures in LyX fails (figures have same number
welcome to the forum!
Perhaps post a reduced copy of the LyX file here, as attachment to a post. Or the LaTeX export.
Stefan
Re: Numbering figures in LyX fails (figures have same number
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Numbering figures in LyX fails (figures have same numbers)
You are writing a scientific document, as I understand. And it seems to be a big one, as you have subsections. So, think again about the whole concept of figures, numbering, and cross-referencing.
You number figures not to count them, but to refer to their number by a cross-reference. That's common in large scientific documents, because figures are moving to the optimal place. This is often the top of the page. And the writing software does it automatically for optimal page breaks. If it doesn't fit to the page, following text comes first and the figure goes to the top of the next page. While a 300 pages document grows, text is inserted here and there, and page breaking and figures would automatically be adjusted.
That's what Word users often don't know at all, and that's very often new to LaTeX users. I suggest, use floats, and let LaTeX do the placement. Otherwise inserting text would mean adjusting figure position or page break, depending on the changing space on the page. And, if you place a figure right at the page where you talk about it, you don't need reference or number.
For easier placement, so the figure won't move much, choose all existing options for LyX' figure placement, which mean "here", "top", "bottom", "page", possibly there's also a "relaxed" option. The corresponding maximum set of LaTeX options is
[htbp!]
.Stefan