0

writing a document I founded that after a landscape page, LaTeX was leaving a big withe space between paragraphs after a subsection heading, especially when the paragraph had less than 3 lines. When the first paragraph after the section had more than 3 lines, there was no problem. Any hint why it is happening?

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[%
    left=3.00cm,
    right=2.00cm,
    top=3.00cm,
    bottom=2.00cm
]{geometry}
\usepackage[none]{hyphenat}
\usepackage{pdflscape}
\usepackage[parfill]{parskip}
\usepackage{afterpage}
\usepackage{microtype}
\setlength{\parskip}{\baselineskip}
\linespread{1.3}
\sloppy
\begin{document}
\blindtext\par
\afterpage{%
\begin{landscape}
\begin{figure}[htb]
\centering
A Figure
\end{figure}
\end{landscape}
}
\blindtext\par
\blindtext
\blindtext\par
\subsection{A long long long long longlong long long long long long long long long long long long long long long long long Title}
A sentence with less than 3 lines.\par
\blindtext\par
\blindtext
\end{document}

enter image description here

More than 3 lines

enter image description here

2

Probably an \afterpage feature.

It can be avoided by putting \clearpage before the section heading (which leaves the heading in the same place but flushes out the afterpage before the page heading code kicks in.

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[%
    left=3.00cm,
    right=2.00cm,
    top=3.00cm,
    bottom=2.00cm
]{geometry}
\usepackage[none]{hyphenat}
\usepackage{pdflscape}
\usepackage[parfill]{parskip}
\usepackage{afterpage}
\usepackage{microtype}
\setlength{\parskip}{\baselineskip}
\linespread{1.3}
\sloppy
\begin{document}
\blindtext\par
\afterpage{%
\begin{landscape}
\begin{figure}[htb]
\centering
A Figure
\end{figure}
\end{landscape}%
}%

\blindtext\par
\blindtext
\blindtext\par
\clearpage
\subsection{A long long long long longlong long long long long long long long long long long long long long long long long Title}
A sentence with less than 3 lines.\par
\blindtext\par
\blindtext
\end{document}

note this warns

Package mathdesign/mdbch Warning: Package 'amsfonts' shouldn't be used
in conjonction with package mdbch, on input line 24.

I would not use afterpage or landscape her but rather a rotated float

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[%
    left=3.00cm,
    right=2.00cm,
    top=3.00cm,
    bottom=2.00cm
]{geometry}
\usepackage[none]{hyphenat}
\usepackage[parfill]{parskip}
\usepackage{rotating}
\usepackage{microtype}
\setlength{\parskip}{\baselineskip}
\linespread{1.3}
\sloppy
\begin{document}
\blindtext\par

\begin{sidewaysfigure}[htb]
\centering
A Figure
\end{sidewaysfigure}


\blindtext\par
\blindtext
\blindtext\par
\clearpage % if you want it
\subsection{A long long long long longlong long long long long long long long long long long long long long long long long Title}
A sentence with less than 3 lines.\par
\blindtext\par
\blindtext
\end{document}
  • It works partially, I liked. But if I need to put some text before the figure, the document doesn't look good – Daniel Valencia C. Sep 22 '17 at 23:17

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.