2

I have the problem that alot of my floats show up before the subsection they are in.

I did read about placeins and \FloatBarrier here: How do I ensure that figures appear in the section they're associated with?

But this seem to only work for floats showing up in the next section but not for floats showing up in the last subsection.

My academic advisor wants all floats to be in the same subsection. There is no "but it's okay as long as they are in the same section".

I'm using LuaTex + scrreprt documentclass.

Spenhouet
  • 952
  • 4
    Revolutionary idea: Just don't use the figure environment ;-) You can use \captionof{figure}{your caption text} instead of \caption (requires the caption (sic!!!) package. It's one of the greatest misunderstandings of LaTeX users that graphics must be in figure environments and tabulars in table environments. –  Aug 22 '16 at 17:59
  • @ChristianHupfer In which environment should i put the includegraphic instead? – Spenhouet Aug 22 '16 at 18:13
  • In no environment ;-) \includegraphics{yourfilename}\captionof{figure}{your caption text} (or the other way round if you prefer the caption above the figure). Neither graphics nor tabular environments require an outer floating environment. The only exception is \begin{center}...\end{center}, perhaps –  Aug 22 '16 at 18:15
  • @ChristianHupfer I think inserting the figures that way prevents latex from selecting the decent figure location in view of the context. – Diaa Aug 22 '16 at 18:15
  • @DiaaAbidou: No, why? Letting the figure floating away from text where it is described is much more inconvenient. I find floating dreadful in most cases –  Aug 22 '16 at 18:17
  • @ChristianHupfer: With no environment i can't center the figures. – Spenhouet Aug 22 '16 at 18:17
  • @Spen: See my updated comment ;-) Please have a look also in a LaTeX introduction manual or textbook on LaTeX itself. –  Aug 22 '16 at 18:17
  • @ChristianHupfer sometimes, it is better to move the figure a little bit away from the line we placed in at. For example, multiple figures and tables may need to be separated by some text to keep the layout decent instead of enforcing them to be printed successively after each other. – Diaa Aug 22 '16 at 18:19
  • 2
    @DiaaAbidou: Well, I have another opinion on this, because I using LaTeX for educational purposes and in that way floating figures and tables is confusing readers. –  Aug 22 '16 at 18:22
  • @ChristianHupfer in this case, you are right :) – Diaa Aug 22 '16 at 18:23
  • Don't be sorry you don't have an MWE. Provide one. (If you were really sorry, you wouldn't fail to give us one, after all.) Right now, there is no way to test an idea or develop a solution for you. Otherwise, just place float barriers manually. But it would be better not to do that, of course. – cfr Aug 22 '16 at 23:00
  • 1
    You might also try increasing the number of floats allowed per page. See http://tex.stackexchange.com/questions/161754/how-can-i-adjust-the-number-of-figures-latex-will-display-on-a-page/161760?s=4|0.2868#161760 – John Kormylo Aug 23 '16 at 04:13
  • @ChristianHupfer: I did go with your suggested solution and it did improve the readability alot. Since working with tex everyone here is like "don't place figures where you want... because typography... blablabla". I just wanted to do the right thing and lissend... but you are right! It does destroy the textflow of every reader... typography aside... tex does a really bad job at typography anyway. – Spenhouet Aug 23 '16 at 09:59
  • @Spen: Well, TeX is quite good at typography, but it is a program following some rules, sometimes, one has to break those rules. I don't say that any of your figure environment should be removed, but some of them. –  Aug 23 '16 at 10:35
  • @ChristianHupfer: But there should be rules that can be broken and rules that can't. For example text going over the page border... i will never understand how that sould be acceptable at all. – Spenhouet Aug 23 '16 at 10:59

0 Answers0