In my report i have a last section that only contains spectra, which i add via \includepdf[]{}. Often there is a pagebreak before the section so there is an almost empty page with only the section title and then the added pdfs. How do I prevent latex from making a pagebreak before this section if anyhow possible?

Bla bla

does sometimes work but it seems not in the current case... I don't have a MWE because it would not be very "minimal" and if I put some dummy text instead it seems to work. Hope in the picture one sees what the problem is.

enter image description here

edit: added "minimal" working example (still not complete Praeambula) that reproduces the issue.

It seems I also found a workaround. When adding


then it works. But I have no clue why. Of course there is the float in the previous subsection (the big black box in the MWE). But wth should it prevent the next section title to be set on a page that oviously has enough whitespace available? Also, it prevents the float to float past upcoming subsections which is totally fine in the current case but which is I do not really intend here.

\usepackage[british,ngerman]{babel} %Letzte Sprache = Hauptsprache
\setkomafont{disposition}{\normalfont\bfseries} %Section Titel in Serifen
\setkomafont{caption}{\footnotesize\sffamily\bfseries}  %Captions in Serifenlos und fett
\setkomafont{captionlabel}{\usekomafont{caption}}   %Text nach caption gleich wie caption
\usepackage{textgreek}  %Aufrechte griechische Buchstaben: upgreek, textgreek
\usepackage{color, lipsum, pdfpages}
\usepackage[onehalfspacing]{setspace}   %Zeilenumbruch Abstand
\parskip=0.5\baselineskip   %Abstand zwischen Abschnitten
    nomenclature/iupac = strict,

\lohead{Baron von Tannenhausen}
\rohead{Experiment 3.14}
\rofoot*{\pagemark\ von \pageref{LastPage}}

\Huge Titlepage

\section{Ziel des Versuchs}\lipsum[1]\section{Einleitung}\lipsum[1-2]\section{Experimentelle Durchführung}\lipsum[1-3]\section{Diskussion}\lipsum[1]\section{Schlussfolgerung}\lipsum[1]\bibliography{bibliography}\section{Beantwortung der Fragen}\subsection{Template Synthese}\lipsum[1]\subsection{Stabilität von Komplexen}\lipsum[1]
\question{Welche Isomere existieren für die unten gezeigten Verbindungen? Zeichne die Strukturen aller Isomere und benenne sie.}

\rule{0.7\textwidth}{0.6\textwidth} %NEWLY ADDED FOR MWE
\caption{1a: \ch{\L-[Rh(acac)3]}, 1b: \ch{\D-[Rh(acac)3]}, 2a: \ch{\cis-[PtCl2(PMe3)2]}, 2b: \ch{\trans-[PtCl2(PMe3)2]}, 3a: \ch{\fac-[TiCl3(THF)3)]}, 3b: \ch{\mer-[TiCl3(THF)3)]}, 4a: \ch{\cis-[IrClCO(PPh3)2]}, 4b: \ch{\trans-[IrClCO(PPh3)2]}, 5a: \ch{\L-[Fe(phen)3]^{2+}}, 5b: \ch{\D-[Fe(phen)3]^{2+}}, 6a: \ch{\cis-\L-[RuCl2(bpy)2]}, 6b: \ch{\cis-\D-[RuCl2(bpy)2]}, 6c: \ch{\trans-[RuCl2(bpy)2]}, 7: \ch{CoCl2Br2}; 8a: \ch{\L-[Cu(etbpy)2)]^{+}}, 8b: \ch{\D-[Cu(etbpy)2)]^{+}}.

\question{Für Salze der Form \ch{[ML_{x}]X_{y}} (L = Ligand, \ch{X-} = Gegenion) ist es üblich, im Massenspektrum peaks für die Ionen \ch{[ML_xX_{y-1}]+}, \ch{[ML_xX_{y-2}]^{2+}}, usw. zu sehen. Die intensivste Gruppe an Peaks im Massenspektrum von \ch{[Co(en)3]Cl3} ist unten gezeigt. Cobalt hat nur ein Isotop. Erkläre das Muster der Peaks.}

\rule{0.8\textwidth}{1.2\textwidth} %NEWLY ADDED FOR MWE
$m/z$   &   ca. Int. / \%   &   Zuordnung   \\ \hline\hline
309.1   &   100 &   Basispeak; \ch{C6H24^{35}Cl2CoN6}   \\
310.1   &   10  &   \ch{^{13}C^{12}C5H24^{35}Cl2CoN6}; ein \isotope*{12,C} durch \ch{13,C} ersetzt  \\
311.1   &   65  &   \ch{C6H24^{37}Cl^{35}ClCoN6} und \ch{^{13}C2^{12}C4H24^{35}Cl2CoN6}; ein \isotope*{35,Cl} durch \isotope*{37,Cl} erstzt oder zwei \isotope*{12,C} durch \isotope*{13,C} ersetzt \\
312.1   &   5   &   \ch{^{13}C^{12}C5H24^{37}Cl^{35}ClCoN6}; ein \isotope*{35,Cl} durch \isotope*{37,Cl} erstzt und ein \isotope*{12,C} durch \isotope*{13,C} ersetzt   \\
313.1   &   10  &   \ch{C6H24^{37}Cl2CoN6}; zwei \isotope*{35,Cl} durch \isotope*{37,Cl} erstzt \\
314.1   &   2   &   \ch{^{13}C^{12}C5H24^{37}Cl2CoN6}; zwei \isotope*{35,Cl} durch \isotope*{37,Cl} erstzt und ein \isotope*{12,C} durch \isotope*{13,C} ersetzt    \\
Natürlich sind auch Isotope von Stickstoff und Sauerstoff vorhanden sowie Spezies mit mehr als zwei \isotope*{13,C}. Diese sind jedoch  vernachlässigbar unwahrscheinlich.

  • I would imagine that you want \clearpage after \section{Spectra} – David Carlisle Jun 1 '17 at 19:48
  • Well, that still puts the \section{Spectra} on an otherwise empty page while there is still way enough space left on the previous page. – Wulfram Jun 1 '17 at 19:50
  • if it does there is something stopping the section head going on the previous page but without any code pretty hard to guess why, I am assuming that you are using a document class where sections do normally start mid-page. – David Carlisle Jun 1 '17 at 19:52
  • in particular the page before the heading looks like a figure but impossible to tell if it is a float page or a text page – David Carlisle Jun 1 '17 at 19:54
  • i use scrartcl. Usually it works fine. If it doesn't it worked till now with \nopagebreak. The previous page page contains a minipage with an \includegraphics[]{} and a minipage with a \tabularx. – Wulfram Jun 1 '17 at 19:58

The problem is due to \usepackage[section]{placeins} because with this option the package redefine \section command by adding \FloatBarrier (-> \clearpage) before the original definition.

  • So to prevent such behaviour I just put \usepackage{placeins} without the option [section] and put all the \FloatBarrier 's manually where needed? – Wulfram Jun 5 '17 at 12:13
  • @Wulfram exactly as far as i know. – touhami Jun 5 '17 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.