4

I have a long, two column document. In one of these pages, I added a graphic that spans exactly the right half of that page and touches the edge; done with this code:

\begin{tikzpicture}[remember picture,overlay]
\node[anchor =north east, inner sep=0pt,outer sep=0pt] at (current page.north east) {\includegraphics[width=0.5\paperwidth,height=\paperheight]{gfx/portraitmod}};
\end{tikzpicture}

The problem is that the text on the right column just flows through the image, which looks pretty ugly.

How can I tell Latex to not use the left or right column for a given page (e.g., this page), without disrupting any other typesetting?

  • 1
    Remove overlay. – user11232 May 11 '15 at 22:12
3

The overlay option to the tikzpicture makes the picture to occupy no space and hence text flows over the picture. FYI, remember picture allows you to use the page anchors like current page.north east. Further, you have to use \columnwidth and \textheight instead of \paperwidth and \paperheight.

Solution is to remove overlay option.

\documentclass[twocolumn]{article}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}
  \lipsum[1-3]
  \begin{tikzpicture}[remember picture]
    \node[anchor =north east, inner sep=0pt,outer sep=0pt] at (current page.north east)
        {\includegraphics[width=\columnwidth,height=\textheight]{example-image}};
  \end{tikzpicture}
\end{document}

enter image description here

On the other hand, if you want the graphic to cover the right side of the paper, use afterpage package and issue \afterpage{\mbox{}\pagebreak}:

\documentclass[twocolumn]{article}
\usepackage{tikz,afterpage}
\usepackage{lipsum}
\begin{document}
  \afterpage{\mbox{}\pagebreak}
  \lipsum[1]
  \begin{tikzpicture}[remember picture,overlay]
    \node[anchor =north east, inner sep=0pt,outer sep=0pt] at (current page.north east)
        {\includegraphics[width=0.5\paperwidth,height=\paperheight]{example-image}};
  \end{tikzpicture}
  \lipsum
\end{document}

enter image description here

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.