4

Let's say I have a two-column scrbook document, with its last page of each chapter balanced by using the balance package because multicol is not an option for me for reasons that are not part of this question.

\documentclass[twocolumn]{scrbook}

\usepackage{lipsum}
\usepackage{balance}

\begin{document}

\lipsum[1]

\balance

\lipsum[2]

\end{document}

Is there some way to fill the remaining space with an image spanning both columns?

I know this is somewhat awkwardly phrased, but I hope you get the idea of what I am trying. I am aware that this might end up being done completely differently, e.g not using balance in the first place, and that is fine for me. But I have to repeat, multicol is not an option, and neither is using a different documentclass than scrbook. (Mostly because the document, at >500 pages, is mostly layed out, I am applying finishing touches, and doing such fundamental changes at this point will require more re-working than I am willing to apply at this point. Sorry.)

2

This possible solution defines a new figure environment called figurehere to suppress the floating property and then seek help from tikz via current page node skill. Since the exact text height is unknown in advacne, some parameters many need to change accordingly. One may use

  1. current page.north or current page.south, for example, if the text height is less than or more than 1/2 of the text height.

  2. shift={(x,y)} can be used as a fine tune once the current page node is determined, which is served as the point of origin. x>0, y>0 is for first quadrant whilst x<0,y<0 would means the 4th quadrant.

  3. The width and height of a graph can also be used as a fine tune parameters.

Edit: To elaborate on point 1 and 2, please refer to enter image description here

If the center, 0, is selected as the current page.center node, then

the upper right corner(A) has x>0,y>0. 1st quadrant

the upper left corner (D) has x<0,y>0. 2nd quadrant

the lower left corner (C) has x<0, y<0. 3rd qudarant

the lower right corner (B) has x>0, y<0. 4rd quadrant

  1. If C corner is selected as current page.south west node, then the grid area all have x>0, y>0 coordinates.

  2. If B corner is selected as current page.south east node, then the grid area all have x<0, y>0 coordinates.

  3. If A corner is selected as `current page.north east node, then the grid area all have x<0, y<0 coordinates.

  4. If D corner is selected as current page.north west node, then the grid area all have x>0, y<0 coordinates.

shift={(x,y)} follows the same notion to determine a particular position to shift to.

\makeatletter
\newenvironment{figurehere}
{\def\@captype{figure}}
{}
\makeatother

enter image description here

Code

\documentclass[twocolumn]{scrbook}

\usepackage{lipsum}
\usepackage{balance}
\usepackage{graphicx}

\usepackage{tikz}

\makeatletter
\newenvironment{figurehere}
{\def\@captype{figure}}
{}
\makeatother

\begin{document}

\lipsum[1]

\balance

\lipsum[2]

\begin{tikzpicture}[remember picture,overlay]
\node[anchor=center,shift={(-1.1cm,-2cm)}] at (current page.center) {
\begin{figurehere}
\includegraphics[width=\textwidth,height=10cm]{example-image-a}
\end{figurehere}};
\end{tikzpicture}
\end{document}
  • +1 probably with -1.1cm the image is better positioned. – karlkoeller Mar 31 '14 at 8:58
  • Yep, works like a charm... in the MWE. +1. Checkmark will be given as soon as I figure out why it doesn't work in my document (where the image is centered on the last line, i.e. the top half rendered on top of the text)... ;-) (I'm a complete Tikz noob, so I have a hard time finding the right thing to tweak. ;-) ) – DevSolar Mar 31 '14 at 9:07
  • Would it be possible, for the benefit of Tikz newbies, to elaborate a bit on 1. and 2.? This works, but for me positioning the picture on the page is basically trial & error without really understanding what I'm doing... the parameters to shift seem completely un-intuitive to me. – DevSolar Mar 31 '14 at 9:45
  • @karlkoeller -- Indeed, thanks, done accordingly. – Jesse Mar 31 '14 at 11:40
  • 1
    @DevSolar -- Thanks for your patient. Gladly add more info and hope it helps. – Jesse Mar 31 '14 at 11:42

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.