0

Consider a document with a couple of full-page floats. These float pages you've assigned the empty page style, as you've considered it unnecessary and distracting to retain, on these pages, the complete, verbose headers that you're using on the regular text pages.

A consequence, though, is that now the float comes across as placed a bit too low in relation to the text pages' type area. With the ~two extra lines that have become available by leaving out the headers on the float pages, it's pretty awkward to see the top of the float being aligend with what's the first line of the text body (on the text pages):

enter image description here

What you want is to modify the type area (on float pages) in a way that it's as high as the area taken up by text body plus headers. For it is that latter area (at least if our header is sufficiently long, forming a proper line of text) that visually we perceive as "the" type area (hence the headinclude option, see scrguide.pdf, chap 2).

What koma-script allows us to do is to change the type area in mid-document. With this bit of code:

\KOMAoptions{
  footinclude=false,
  headinclude=false
}
\recalctypearea

...we can switch back and forth between a type area that does, and one that does not include the headers. In the second half of my MWE, that gives us pretty much the desired effect on the float page, but of course that's not anyway near a solution, since the question remains:

How do we, in a sound, robust, way, automatically trigger a type area change whenever a full-page float is invoked?

\documentclass[12pt,DIV=9]{scrartcl}
\usepackage{blindtext,floatpag}
\usepackage[automark]{scrlayer-scrpage}

%include header in type area calculation
\KOMAoptions{
  footinclude=false,
  headinclude=true
}
\recalctypearea

%setup headers/footers
\pagestyle{scrheadings}
\clearscrheadings
\ihead{\headmark}
\ohead{\thepage}


%make sure figure starts at top of text area
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother

%no headers/footers on float pages
\floatpagestyle{empty}


\begin{document}
\section{Text with regular type area}
\Blindtext

\begin{figure}[p]
\rule{\textwidth}{\textheight}
\caption{Float with regular typearea; no headings, float could be taller (using the space taken by the headers}
\end{figure}%

\Blindtext


%changing type area in mid-document. Not very elegant
\KOMAoptions{
  footinclude=false,
  headinclude=false
}
\recalctypearea

\section{Text with taller type area (no headers)}

\Blindtext

\begin{figure}[p]
\rule{\textwidth}{\textheight}
\caption{Float with tall typearea, as it should be; no headings, float uses the space taken by the headers}
\end{figure}%


\Blindtext

\end{document} 

PS

There is, of course, a brute-force approach. If we're using the @fptop modification anyway (which I do), we can as well set that value to something negative, such as:

\makeatletter
\setlength{\@fptop}{-2\baselineskip}
\makeatother

This does seem to work, and it even makes any use of koma-script's features unnecessary, so it's a class-independent solution. But very brutal it is.

1

This solution uses \afterpage and \newgeometry to activate the full page figure, rather than the other way around.

Note: Putting the caption into a savebox outside the \afterpage is to guarantee that the captions are numbered correctly (overkill).

\documentclass[12pt,DIV=9]{scrartcl}
\usepackage{blindtext,floatpag}
\usepackage[automark]{scrlayer-scrpage}
\usepackage{geometry}
\usepackage{afterpage}

\newsavebox{\tempbox}

%include header in type area calculation
\KOMAoptions{
  footinclude=false,
  headinclude=true
}
\recalctypearea

%setup headers/footers
\pagestyle{scrheadings}
\clearscrheadings
\ihead{\headmark}
\ohead{\thepage}


%make sure figure starts at top of text area
\makeatletter
\setlength{\@fptop}{0pt}
\makeatother

%no headers/footers on float pages
\floatpagestyle{empty}


\begin{document}
\section{Text with regular type area}
\Blindtext

\begin{figure}[p]
\rule{\textwidth}{\textheight}
\caption{Float with regular typearea; no headings, float could be taller (using the space taken by the headers}
\end{figure}%

\Blindtext

\section{Text with taller type area (no headers)}

\Blindtext

\setbox\tempbox=\vbox{\expandafter\def\csname @captype\endcsname{figure}% increment caption counter NOW
\caption{Float with tall typearea, as it should be; no headings, float uses the space taken by the headers}%
}
\afterpage{\newgeometry{noheadfoot}% automatic \clearpage
\begin{figure}[p]
\rule{\textwidth}{\textheight}
\unvbox\tempbox
\end{figure}%
\restoregeometry}

\Blindtext

\end{document}
| improve this answer | |

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.