LyXSize of figures makes them move to the end... but when?

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

Size of figures makes them move to the end... but when?

Post by Stef Pillaert »

Hello,
I have a lot of figures (in floats, "Here if possible"), and I notice that when they are "too big", they get moved to the end of the section (pushing all the floats that come after it also to the end, of course). But: all my figures are scaled to a max. % of textwidth en max. % of texthight, keeping the aspect ratio: how can they be "too big" then? Whenever this happens, I try to scale down the figure causing the problem, untill this doens't happen anymore.
Is there a way to know "in advance" when the figures will be too big? Is there a maximum percentage, or a maximum absolute size, or ...
Now I feel like "try-and-error"-wise changing the percentages untill it doesn't get swapped to the end, without "knowing" what's/why this is happening. But this is probably because I 'm just using LyX as a LaTeX dummy :?

Recommended reading 2024:

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

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

Size of figures makes them move to the end... but when?

Post by Stefan Kottwitz »

Hi Stef!

It would be good to see the effect with the actual code. Can you please post a small LyX example document in the same way you did with your original document, that shows the problem. Please also as a pdfLaTeX export (so I can test without LyX) and with a sample figure file. We can add attachments to forum posts, there's a link below the text edit field for this.

Stefan
LaTeX.org admin
Stef Pillaert
Posts: 51
Joined: Sat Oct 22, 2016 3:43 pm

Size of figures makes them move to the end... but when?

Post by Stef Pillaert »

OK, by narrowing it down to a small example, I noticed that it seems to be caused by rotating the figures within LyX: there is an option "first scale, then rotate" (sorry, translation from dutch LyX-version). Sorry that I didn't narrow it down to the rotation of 90° from the start...
    When I don't use this option (which seems logical to me), I get the problem (see files "test_with_problem").
      When I do use the option (didn't try this before, sorry), the figure is in the correct place in the pdf, but... it is too small (which is expexted, if you scale first, and then rotate it....). So by using the option, my problem dissapears ... but the figure is too small :)
      (I'll add the actual figures in a reply next: it seems that there is a limit to the attachments...)
      [Update: sorry, the first version of the test.lyx file could be the wrong one, now it should be OK]
      Attachments
      test.lyx
      (33.62 KiB) Downloaded 256 times
      test_with_problem.pdf
      (252.31 KiB) Downloaded 188 times
      test_with_problem.lyx
      (33.73 KiB) Downloaded 263 times
      test.pdf
      (247.65 KiB) Downloaded 208 times
      Last edited by Stef Pillaert on Wed Nov 30, 2016 1:13 pm, edited 3 times in total.
      Stef Pillaert
      Posts: 51
      Joined: Sat Oct 22, 2016 3:43 pm

      Size of figures makes them move to the end... but when?

      Post by Stef Pillaert »

      (Here the figures...)
      Attachments
      025.pdf
      (13.68 KiB) Downloaded 173 times
      024.pdf
      (18.74 KiB) Downloaded 167 times
      023.pdf
      (18.68 KiB) Downloaded 158 times
      022.pdf
      (14.92 KiB) Downloaded 167 times
      Stef Pillaert
      Posts: 51
      Joined: Sat Oct 22, 2016 3:43 pm

      Size of figures makes them move to the end... but when?

      Post by Stef Pillaert »

      hmm... and now I'm wondering if it is really the rotation that's causing the problem: here is another situation with (I think?) a problem similar to the previous one:
      why are the figures starting from "figuur 2" (= "011.pdf") pushed so far to the back? (In the original document, which is longer than this example, it was even a lot further to the back, at the end of the entire section)
      "Figuur 2" has (in LyX) a scaling of max. 90% of textheight and/or textwidth, and keeping (of course) the aspect ratio. I understand the output places this page on an entire page, but why so far from it's location in the LyX-text?
      Or am I really missing something about how LaTeX arranges figures (in floats)? Maybe LaTeX can't solve my problem without making the rest of the text more "ugly" (e.g. with bigger spacings between the formulas)?
      Stef
      (Is it ok if I only add the first two figures? Let me know if someone wants all the figures separately)
      Attachments
      011.pdf
      (11.68 KiB) Downloaded 176 times
      010.pdf
      (7.76 KiB) Downloaded 182 times
      test2_with_problem.lyx
      (237.57 KiB) Downloaded 247 times
      test2_with_problem.pdf
      (234.23 KiB) Downloaded 214 times
      scottkosty
      Site Moderator
      Posts: 542
      Joined: Sat Sep 01, 2012 6:38 am

      Size of figures makes them move to the end... but when?

      Post by scottkosty »

      I'm not sure. I don't have any experience with figure rotation. Instead of "Here if possible" did you try "Here definitely" ?
      Stef Pillaert
      Posts: 51
      Joined: Sat Oct 22, 2016 3:43 pm

      Size of figures makes them move to the end... but when?

      Post by Stef Pillaert »

      If I use 'here definitely', then the figure is exactly where I ask ... but the rest of the lay out is not OK (way too much spacing between formulas, ...). I don't want to insist on the exact place, most of the time LaTeX does a good job on placing the figures.
      But I don't understand why the figures in my examples are placed completely to the end of the section, while they are not bigger than 90% of text heigth and width ....
      I doesn't seem logical to me: it seems that they could have been placed earlier in the text ...
      Stef
      User avatar
      Johannes_B
      Site Moderator
      Posts: 4182
      Joined: Thu Nov 01, 2012 4:08 pm

      Size of figures makes them move to the end... but when?

      Post by Johannes_B »

      Remove all instructions for placement for the figures. Every decision you make, is restricting LaTeX.
      If you decide you want the picture here, LaTeX cannot place it at the bottom of a page or on a page of its own. The float is passing page by page without a suitable place, so all images are ooutput at the very end.
      The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
      Stef Pillaert
      Posts: 51
      Joined: Sat Oct 22, 2016 3:43 pm

      Size of figures makes them move to the end... but when?

      Post by Stef Pillaert »

      OK, removing all the settings indeed made it a lot better, thanks!
      Stef
      Post Reply