4

I have a paragraph ending by the middle of the page. Then, I have a tikzpicture, which is just a bit too big to fit in the page. I want to allow it to stay there, even if it exceed the bottom margin.

Here is a (silly) example

\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}

\lipsum[1-5]

\begin{tikzpicture}
  \draw (0,0) -- (0,2);
\end{tikzpicture}

\end{document}

In this example, the line jumps to the next page. I want the line to stay in the first page, even if it will exceed the margin.

This is what I get with this example:

enter image description here

This is what I want:

enter image description here

1
  • Search for pgfinterruptboundingbox/\pgfresetboundingbox/remember picture,overlay.
    – Symbol 1
    Commented May 12, 2017 at 19:09

2 Answers 2

5

In the following, I use the \raisebox command to (a) typeset the picture "to the bottom" (raise the content by -\height) and (b) specify it to have a height and depth of 0.

    \documentclass[a4paper]{article}
    \usepackage{tikz}
    \usepackage{lipsum}
    \begin{document}

    \lipsum[1-5]

    \raisebox{-\height}[0pt][0pt]{%
    \begin{tikzpicture}
        \draw (0,0) -- (0,2);
    \end{tikzpicture}
    }
    \end{document}

enter image description here

For an environment version, check out the adjustbox package, which provides all kinds of box manipulations.

4

As a last resort:

\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}

\lipsum[1-5]
\enlargethispage{0.009cm}

\begin{tikzpicture}
  \draw (0,0) -- (0,2);
\end{tikzpicture}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .