8

I've created a little diagram in TikZ. Only problem is, it's quite big, so I figured I should use landscape mode for it.

Only problem is, when I put it between

\begin{landscape}
\input{erd.tikz.tex} % my diagram
\end{landscape}

I get an extra white page before the diagram itself.

I can't seem to understand why, any idea?

Thanks.

Here is the document:

\documentclass[border=0.4in]{article}

\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{matrix}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usepackage{scalefnt}
\usepackage{geometry}
\usepackage{pdflscape}

\makeatletter


\begin{document}

\section{Foo}
Foo bar bar bar foo, foo bar.
\newgeometry{left=2cm,bottom=3cm}
\begin{landscape}
\input{erd.tikz.tex}
\end{landscape}
\restoregeometry
\section{Zip}
Boom boom, zip.

\end{document}

1 Answer 1

6

use

\begin{landscape}
\resizebox{!}{0.95\textheight}{\input{erd.tikz.tex}}
\end{landscape}

The image is too big. The reason why it is placed on the following page.

5
  • Tried that. Still no luck. Aug 8, 2014 at 15:41
  • 1
    True, it should be {0.95\textheight}. I`ll correct it
    – user2478
    Aug 8, 2014 at 15:43
  • 1
    Ah, yes luck, this time. Wonderful. Thanks a lot. However, I wonder why this is needed: even without that all the visible picture fits neatly on the page. Is there an invisible/fully white part of the TikZ picture? Sounds... un-TeXish to me, for lack of a better term. Aug 8, 2014 at 15:47
  • 1
    Every object (box) which cannot be placed on the current page will move to the next page.
    – user2478
    Aug 8, 2014 at 15:53
  • 1
    Any hope to avoid this behavior (additional empty page) without resizing the TikZ-picture? Feb 14, 2018 at 11:54

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.