LyX ⇒ force floats to end of pdf, but keep numbering per chapter...
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
force floats to end of pdf, but keep numbering per chapter...
I have a lot of my figures in floats, and LaTeX puts them on good places in the pdf. But for my students it would be great if I could produce a second pdf-version of the same text, without the figures in the text, and all the figures in a separate document.
Why?
*figures are in colour, so students can print these figures on a better quality printer.
* Also, while studying, it is for some students more comfortable to have the figures separate to the text, because I often refer to a figure that appears a few pages earlier then the second or third reference in the text.
Of course, the numbering (like "fig. 2.1") should be kept unchanged, so the numbering in both versions of the document stays the same.
I tried using endfloat, pushing all the floats to the end, but then all the numbers start with the number of the last chapter (e.g. 5.9, where it orig. was 2.1).
Is there a workaround? Or another simple way to achieve this?
Many thanks,
Stef
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
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
force floats to end of pdf, but keep numbering per chapter...
for printing the figures separately, you could use
\usepackage[active,floats]{preview}
Stefan
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
force floats to end of pdf, but keep numbering per chapter...
*I get a pdf with all the floats indeed, but they are all misplaced: I just see a small bottom part of each figure, and the caption with the figure number, the rest of the figures is cut off. This way, the main part of the page remains blanc this way
*is there a way to produce a version of the text withouut the floats then? So just the references to the figures in the text? Otherwise, this doesnt solve my problem really, I'm afraid.
*It seems that preview forces every figure on a separate page, while endfloat seems to have options to allow more than one figure on a page.... but as stated in my question: I can't get the numbering correct with endfloat...

Thanks for your time
Stef
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
force floats to end of pdf, but keep numbering per chapter...
I feel for an academic print it would be good to keep numbering consistent in the way, that if there's an appendix (second document) the numbering should refer to the appendix and not to main document chapters. The perfect reasoning

I recommend to use the classic endfloat or an appendix.
Stefan
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
force floats to end of pdf, but keep numbering per chapter...
Thanks for the help, I'll try to apply some "manual cut-and-paste"-solution (allthough I still have no idea how...)
Stef
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
force floats to end of pdf, but keep numbering per chapter...
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
force floats to end of pdf, but keep numbering per chapter...

https://tex.stackexchange.com/questions ... 846#406846
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
force floats to end of pdf, but keep numbering per chapter...
as a bit of explanation:
- By
\AtBeginFigures{\setcounter{chapter}{0}}
the chapter counter is reset, right in the place when the placement of figures start. - If your document name is
file
,endfloat
already puts the figure placement commands intofile.fff
(and for tables intofile.ttt
) - The internal
\@chapter
command is patched so that theres the command\stepcounter{chapter}
is inserted into thatfile.fff
file; that way the numbering is increased accordingly - For printing the figures with numbers, endfloat now starts with (chapter) 1 (since it was reset to 0) and increases the number following the chapters (as it was stepped up each new chapter, written to
file.fff
)
endfloat
hack.Stefan
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
force floats to end of pdf, but keep numbering per chapter...
Stef