LaTeX forum ⇒ LyXforce floats to end of pdf, but keep numbering per chapter... Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Stef Pillaert
Posts: 33
Joined: Sat Oct 22, 2016 3:43 pm

force floats to end of pdf, but keep numbering per chapter...

Postby Stef Pillaert » Sun Dec 17, 2017 5:06 pm

Hello,
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

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8954
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Dec 18, 2017 5:43 am

Hi Stef,

for printing the figures separately, you could use

\usepackage[active,floats]{preview}

Stefan
Site admin

Stef Pillaert
Posts: 33
Joined: Sat Oct 22, 2016 3:43 pm

Postby Stef Pillaert » Mon Dec 18, 2017 12:43 pm

hmm... A few problems seem to arrise with "preview":
*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

User avatar
Stefan Kottwitz
Site Admin
Posts: 8954
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Dec 19, 2017 4:33 am

Hi Stef!

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 ;-) of cause is, that if this "zippered" mixed numbering would be acceptable, it would habe been implemented since 20 years already, and I guess it's not until now. Good idea though!

I recommend to use the classic endfloat or an appendix.

Stefan
Site admin

Stef Pillaert
Posts: 33
Joined: Sat Oct 22, 2016 3:43 pm

Postby Stef Pillaert » Tue Dec 19, 2017 9:07 am

I agree about the numbering, if there were anly one version of the document... But the second version is for practical reasons (quality of printers, having the figures alongside the text, figures are in colour,...), and having the numbers here different than the "original" text is definitely a "no-no", as you surely understand...
Thanks for the help, I'll try to apply some "manual cut-and-paste"-solution (allthough I still have no idea how...)
Stef

User avatar
Johannes_B
Site Moderator
Posts: 3795
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Dec 19, 2017 1:12 pm

Crosspost on TeX.SX
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


User avatar
Stefan Kottwitz
Site Admin
Posts: 8954
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Dec 20, 2017 4:38 am

Hi Stef,

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 into file.fff (and for tables into file.ttt)
  • The internal \@chapter command is patched so that theres the command \stepcounter{chapter} is inserted into that file.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)

Your question was interesting, and it's a nice endfloat hack.

Stefan
Site admin

Stef Pillaert
Posts: 33
Joined: Sat Oct 22, 2016 3:43 pm

Postby Stef Pillaert » Wed Dec 20, 2017 9:19 am

Many, many thanks! You helped me to understand things a lot better!
Stef


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 4 guests